win fix warnings from appveyor
authorAndy Green <andy@warmcat.com>
Sun, 15 May 2016 00:29:37 +0000 (08:29 +0800)
committerAndy Green <andy@warmcat.com>
Sun, 15 May 2016 00:31:01 +0000 (08:31 +0800)
Signed-off-by: Andy Green <andy@warmcat.com>
lib/context.c
lib/libuv.c
lib/libwebsockets.c
lib/server.c
lwsws/conf.c
test-server/test-server-v2.0.c

index 0b34ee1..bf35926 100644 (file)
@@ -447,7 +447,7 @@ lws_create_vhost(struct lws_context *context,
 #ifdef LWS_WITH_ACCESS_LOG
        if (info->log_filepath) {
                vh->log_fd = open(info->log_filepath, O_CREAT | O_APPEND | O_RDWR, 0600);
-               if (vh->log_fd == LWS_INVALID_FILE) {
+               if (vh->log_fd == (int)LWS_INVALID_FILE) {
                        lwsl_err("unable to open log filepath %s\n",
                                 info->log_filepath);
                        goto bail;
@@ -460,7 +460,7 @@ lws_create_vhost(struct lws_context *context,
                                                info->log_filepath);
 #endif
        } else
-               vh->log_fd = LWS_INVALID_FILE;
+               vh->log_fd = (int)LWS_INVALID_FILE;
 #endif
 
        if (lws_context_init_server_ssl(info, vh))
@@ -940,7 +940,7 @@ lws_context_destroy(struct lws_context *context)
 #endif
 #endif
 #ifdef LWS_WITH_ACCESS_LOG
-               if (vh->log_fd != LWS_INVALID_FILE)
+               if (vh->log_fd != (int)LWS_INVALID_FILE)
                        close(vh->log_fd);
 #endif
 
index 64e5a7e..0b6b60f 100644 (file)
@@ -269,7 +269,7 @@ lws_libuv_destroyloop(struct lws_context *context, int tsi)
 }
 
 void
-lws_libuv_accept(struct lws *wsi, int accept_fd)
+lws_libuv_accept(struct lws *wsi, lws_sockfd_type accept_fd)
 {
        struct lws_context *context = lws_get_context(wsi);
        struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
index 96dc533..6ac8639 100644 (file)
@@ -2343,7 +2343,7 @@ lws_access_log(struct lws *wsi)
                     wsi->access_log.header_log,
                     wsi->access_log.response, wsi->access_log.sent, p);
 
-       if (wsi->vhost->log_fd != LWS_INVALID_FILE) {
+       if (wsi->vhost->log_fd != (int)LWS_INVALID_FILE) {
                if (write(wsi->vhost->log_fd, ass, l) != l)
                        lwsl_err("Failed to write log\n");
        } else
@@ -2448,7 +2448,7 @@ lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len)
                        if (!first)
                                buf += snprintf(buf, end - buf, ",");
                        buf += snprintf(buf, end - buf,
-                                       "\n  {\n   \"%s\":\{\n"
+                                       "\n  {\n   \"%s\":{\n"
                                        "    \"status\":\"ok\"\n   }\n  }"
                                        ,
                                        vh->protocols[n].name);
index 94a0280..c109585 100644 (file)
@@ -674,7 +674,7 @@ lws_http_action(struct lws *wsi)
                 */
                if (hit->origin_protocol == LWSMPRO_CALLBACK) {
 
-                       for (n = 0; n < wsi->vhost->count_protocols; n++)
+                       for (n = 0; n < (unsigned int)wsi->vhost->count_protocols; n++)
                                if (!strcmp(wsi->vhost->protocols[n].name,
                                           hit->origin)) {
 
index 7367397..c78184d 100644 (file)
@@ -378,7 +378,7 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason)
                break;
        case LEJPVP_MOUNTPOINT:
                a->m.mountpoint = a->p;
-               a->m.mountpoint_len = strlen(ctx->buf);
+               a->m.mountpoint_len = (unsigned char)strlen(ctx->buf);
                break;
        case LEJPVP_ORIGIN:
                a->m.origin = a->p;
index b66a84e..b6feafe 100644 (file)
@@ -229,7 +229,8 @@ int main(int argc, char **argv)
        info.port = 7681;
 
        while (n >= 0) {
-               n = getopt_long(argc, argv, "i:hsap:d:Dr:C:K:A:R:vu:g:", options, NULL);
+               n = getopt_long(argc, argv, "i:hsap:d:Dr:C:K:A:R:vu:g:",
+                               (struct option *)options, NULL);
                if (n < 0)
                        continue;
                switch (n) {