From b34d7a3e0293cfd3248000bacfc5f5ae52903e21 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 30 Sep 2022 15:29:32 +0300 Subject: microhttpd/tests: muted compiler warnings --- src/microhttpd/test_client_put_stop.c | 6 +++--- src/microhttpd/test_upgrade.c | 8 ++++++-- src/microhttpd/test_upgrade_large.c | 8 ++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/microhttpd') diff --git a/src/microhttpd/test_client_put_stop.c b/src/microhttpd/test_client_put_stop.c index 03a9e87c..b4167870 100644 --- a/src/microhttpd/test_client_put_stop.c +++ b/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; diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c index 49a17dbe..fb4bdadf 100644 --- a/src/microhttpd/test_upgrade.c +++ b/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, diff --git a/src/microhttpd/test_upgrade_large.c b/src/microhttpd/test_upgrade_large.c index 275434c8..2374574e 100644 --- a/src/microhttpd/test_upgrade_large.c +++ b/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, -- cgit v1.2.3