Bläddra i källkod

microhttpd/tests: muted compiler warnings

Evgeny Grin (Karlson2k) 3 år sedan
förälder
incheckning
b34d7a3e02

+ 3 - 3
src/microhttpd/test_client_put_stop.c

@@ -2011,7 +2011,7 @@ static int
 testInternalGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;
@@ -2027,7 +2027,7 @@ static int
 testMultithreadedGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;
@@ -2042,7 +2042,7 @@ static int
 testMultithreadedPoolGet (enum testMhdPollType pollType)
 {
   struct MHD_Daemon *d;
-  int d_port = global_port; /* Daemon's port */
+  uint16_t d_port = global_port; /* Daemon's port */
   struct ahc_cls_type *ahc_param;
   struct check_uri_cls *uri_cb_param;
   struct term_notif_cb_param *term_result;

+ 6 - 2
src/microhttpd/test_upgrade.c

@@ -1196,8 +1196,12 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
                               &to64);
     if (1000 < to64)
       to64 = 1000;
-    tv.tv_sec = to64 / 1000;
-    tv.tv_usec = 1000 * (to64 % 1000);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+    tv.tv_sec = (time_t) (to64 / 1000);
+#else  /* Native W32 */
+    tv.tv_sec = (long) (to64 / 1000);
+#endif /* Native W32 */
+    tv.tv_usec = (int) (1000 * (to64 % 1000));
     ret = select (ep + 1,
                   &rs,
                   NULL,

+ 6 - 2
src/microhttpd/test_upgrade_large.c

@@ -1382,8 +1382,12 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
                               &to64);
     if (1000 < to64)
       to64 = 1000;
-    tv.tv_sec = to64 / 1000;
-    tv.tv_usec = 1000 * (to64 % 1000);
+#if ! defined(_WIN32) || defined(__CYGWIN__)
+    tv.tv_sec = (time_t) (to64 / 1000);
+#else  /* Native W32 */
+    tv.tv_sec = (long) (to64 / 1000);
+#endif /* Native W32 */
+    tv.tv_usec = (int) (1000 * (to64 % 1000));
     ret = select (ep + 1,
                   &rs,
                   NULL,