summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-03-26 00:38:26 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-03-26 00:38:26 +0000
commite198febcf8cfb75d0ffa7dda5ff0d8fc7c661126 (patch)
tree1deff69b3dfde27231bf927801f21f9c27c6c13c
parentc39414cdc7a461ee573205cfe371853d0d1f94d8 (diff)
Fix testsuite compiler warnings on W32
-rw-r--r--src/testcurl/https/test_empty_response.c8
-rw-r--r--src/testcurl/https/test_https_get_select.c16
2 files changed, 15 insertions, 9 deletions
diff --git a/src/testcurl/https/test_empty_response.c b/src/testcurl/https/test_empty_response.c
index d327786c..49174108 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -70,7 +70,7 @@ testInternalSelectGet ()
fd_set rs;
fd_set ws;
fd_set es;
- MHD_socket max;
+ int maxposixs; /* Max socket number unused on W32 */
int running;
struct CURLMsg *msg;
time_t start;
@@ -134,11 +134,11 @@ testInternalSelectGet ()
start = time (NULL);
while ((time (NULL) - start < 5) && (multi != NULL))
{
- max = 0;
+ maxposixs = -1;
FD_ZERO (&rs);
FD_ZERO (&ws);
FD_ZERO (&es);
- mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
+ mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
if (mret != CURLM_OK)
{
curl_multi_remove_handle (multi, c);
@@ -149,7 +149,7 @@ testInternalSelectGet ()
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (max + 1, &rs, &ws, &es, &tv);
+ select (maxposixs + 1, &rs, &ws, &es, &tv);
curl_multi_perform (multi, &running);
if (running == 0)
{
diff --git a/src/testcurl/https/test_https_get_select.c b/src/testcurl/https/test_https_get_select.c
index 38ab1879..487b475e 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -84,7 +84,12 @@ testExternalGet (int flags)
fd_set rs;
fd_set ws;
fd_set es;
- MHD_socket max;
+ MHD_socket maxsock;
+#ifdef MHD_WINSOCK_SOCKETS
+ int maxposixs; /* Max socket number unused on W32 */
+#else /* MHD_POSIX_SOCKETS */
+#define maxposixs maxsock
+#endif /* MHD_POSIX_SOCKETS */
int running;
struct CURLMsg *msg;
time_t start;
@@ -146,11 +151,12 @@ testExternalGet (int flags)
start = time (NULL);
while ((time (NULL) - start < 5) && (multi != NULL))
{
- max = 0;
+ maxsock = MHD_INVALID_SOCKET;
+ maxposixs = -1;
FD_ZERO (&rs);
FD_ZERO (&ws);
FD_ZERO (&es);
- mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
+ mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
if (mret != CURLM_OK)
{
curl_multi_remove_handle (multi, c);
@@ -159,7 +165,7 @@ testExternalGet (int flags)
MHD_stop_daemon (d);
return 2048;
}
- if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
+ if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
{
curl_multi_remove_handle (multi, c);
curl_multi_cleanup (multi);
@@ -169,7 +175,7 @@ testExternalGet (int flags)
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (max + 1, &rs, &ws, &es, &tv);
+ select (maxposixs + 1, &rs, &ws, &es, &tv);
curl_multi_perform (multi, &running);
if (running == 0)
{