diff --git a/lib/fops-zip.c b/lib/fops-zip.c
index 140419b0..f2550557 100644
--- a/lib/fops-zip.c
+++ b/lib/fops-zip.c
@@ -224,7 +224,7 @@ lws_fops_zip_scan(lws_fops_zip_t priv, const char *name, int len)
 		if (get_u32(buf + ZC_SIGNATURE) != 0x02014B50)
 			return LWS_FZ_ERR_CENTRAL_SANITY;
 
-		lwsl_debug("cstart 0x%lx\n", priv->content_start);
+               lwsl_debug("cstart 0x%lx\n", (unsigned long)priv->content_start);
 
 		priv->hdr.filename_len = get_u16(buf + ZC_FILE_NAME_LENGTH);
 		priv->hdr.extra = get_u16(buf + ZC_EXTRA_FIELD_LENGTH);
@@ -272,7 +272,7 @@ lws_fops_zip_scan(lws_fops_zip_t priv, const char *name, int len)
 				      get_u16(buf + ZL_REL_OFFSET_CONTENT);
 
 		lwsl_debug("content supposed to start at 0x%lx\n",
-			   priv->content_start);
+                          (unsigned long)priv->content_start);
 
 		if (priv->content_start > priv->zip_fop_fd->len)
 			return LWS_FZ_ERR_CONTENT_SANITY;
diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c
index 49c3d21e..3349079e 100644
--- a/lib/lws-plat-unix.c
+++ b/lib/lws-plat-unix.c
@@ -669,7 +669,7 @@ _lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset)
 		fop_fd->pos = r;
 	else
 		lwsl_err("error seeking from cur %ld, offset %ld\n",
-			 fop_fd->pos, offset);
+                        (long)fop_fd->pos, (long)offset);
 
 	return r;
 }
@@ -687,7 +687,7 @@ _lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount,
 	}
 	fop_fd->pos += n;
 	lwsl_debug("%s: read %ld of req %ld, pos %ld, len %ld\n", __func__, n,
-		   (long)len, fop_fd->pos, fop_fd->len);
+                  (long)len, (long)fop_fd->pos, (long)fop_fd->len);
 	*amount = n;
 
 	return 0;
diff --git a/test-server/test-server-http.c b/test-server/test-server-http.c
index 81445ca7..9c122b70 100644
--- a/test-server/test-server-http.c
+++ b/test-server/test-server-http.c
@@ -184,7 +184,7 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
 	struct per_session_data__http *pss =
 			(struct per_session_data__http *)user;
 	unsigned char buffer[4096 + LWS_PRE];
-	unsigned long amount, file_len, sent;
+       lws_filepos_t amount, file_len, sent;
 	char leaf_path[1024];
 	const char *mimetype;
 	char *other_headers;