diff --git a/lib/context.c b/lib/context.c
index 0b34ee14ac32e50585ac77162aeb694dca6117f5..bf359265aeaaf28244ae9bd4771dc44ce9b9d390 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -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
 
diff --git a/lib/libuv.c b/lib/libuv.c
index 64e5a7ed4ac00f34ac07b0974be13f89299e855a..0b6b60f7bc3fb2aa3b6e3dbe7d6e185621a3395d 100644
--- a/lib/libuv.c
+++ b/lib/libuv.c
@@ -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];
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 96dc5339637f46aac6512aa744b3f3f006d92a20..6ac8639ba34626c507aae34631dcb2c88fa0a951 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -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);
diff --git a/lib/server.c b/lib/server.c
index 94a028068a53ffdf766b40692a2b391abb015e02..c109585fe14e4eb238f40cb24fba758196eead88 100644
--- a/lib/server.c
+++ b/lib/server.c
@@ -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)) {
 
diff --git a/lwsws/conf.c b/lwsws/conf.c
index 7367397373da57270909c50062b7dc0224e307bd..c78184dc9221ff962ebc1b5e12d77cd5d7a51af1 100644
--- a/lwsws/conf.c
+++ b/lwsws/conf.c
@@ -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;
diff --git a/test-server/test-server-v2.0.c b/test-server/test-server-v2.0.c
index b66a84e2dba5fd586c737c4a5a2b5ce743ad55fa..b6feafe7d73df42af296e8bcacb655440ac5646e 100644
--- a/test-server/test-server-v2.0.c
+++ b/test-server/test-server-v2.0.c
@@ -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) {