aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_get_iovec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_get_iovec.c')
-rw-r--r--src/testcurl/test_get_iovec.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c
index 0a41e6d1..f979ae6e 100644
--- a/src/testcurl/test_get_iovec.c
+++ b/src/testcurl/test_get_iovec.c
@@ -169,8 +169,8 @@ ahc_cont (void *cls,
169 169
170 for (i = 0; i < TESTSTR_IOVCNT; ++i) 170 for (i = 0; i < TESTSTR_IOVCNT; ++i)
171 { 171 {
172 iov[i].iov_base = data + (i * (TESTSTR_SIZE / TESTSTR_IOVCNT 172 iov[i].iov_base = data + (((size_t) i)
173 / sizeof(int))); 173 * (TESTSTR_SIZE / TESTSTR_IOVCNT / sizeof(int)));
174 iov[i].iov_len = TESTSTR_SIZE / TESTSTR_IOVCNT; 174 iov[i].iov_len = TESTSTR_SIZE / TESTSTR_IOVCNT;
175 } 175 }
176 176
@@ -230,7 +230,7 @@ ahc_ncont (void *cls,
230 230
231 for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i) 231 for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i)
232 { 232 {
233 data[i] = i + (j * TESTSTR_IOVLEN / sizeof(int)); 233 data[i] = i + (j * (int) (TESTSTR_IOVLEN / sizeof(int)));
234 } 234 }
235 iov[j].iov_base = (const void *) data; 235 iov[j].iov_base = (const void *) data;
236 iov[j].iov_len = TESTSTR_IOVLEN; 236 iov[j].iov_len = TESTSTR_IOVLEN;
@@ -251,14 +251,14 @@ ahc_ncont (void *cls,
251} 251}
252 252
253 253
254static int 254static unsigned int
255testInternalGet (bool contiguous) 255testInternalGet (bool contiguous)
256{ 256{
257 struct MHD_Daemon *d; 257 struct MHD_Daemon *d;
258 CURL *c; 258 CURL *c;
259 struct CBC cbc; 259 struct CBC cbc;
260 CURLcode errornum; 260 CURLcode errornum;
261 int port; 261 uint16_t port;
262 262
263 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 263 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
264 port = 0; 264 port = 0;
@@ -294,7 +294,7 @@ testInternalGet (bool contiguous)
294 { 294 {
295 MHD_stop_daemon (d); return 32; 295 MHD_stop_daemon (d); return 32;
296 } 296 }
297 port = (int) dinfo->port; 297 port = dinfo->port;
298 } 298 }
299 c = curl_easy_init (); 299 c = curl_easy_init ();
300 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); 300 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/");
@@ -331,14 +331,14 @@ testInternalGet (bool contiguous)
331} 331}
332 332
333 333
334static int 334static unsigned int
335testMultithreadedGet (void) 335testMultithreadedGet (void)
336{ 336{
337 struct MHD_Daemon *d; 337 struct MHD_Daemon *d;
338 CURL *c; 338 CURL *c;
339 struct CBC cbc; 339 struct CBC cbc;
340 CURLcode errornum; 340 CURLcode errornum;
341 int port; 341 uint16_t port;
342 342
343 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 343 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
344 port = 0; 344 port = 0;
@@ -366,7 +366,7 @@ testMultithreadedGet (void)
366 { 366 {
367 MHD_stop_daemon (d); return 32; 367 MHD_stop_daemon (d); return 32;
368 } 368 }
369 port = (int) dinfo->port; 369 port = dinfo->port;
370 } 370 }
371 c = curl_easy_init (); 371 c = curl_easy_init ();
372 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); 372 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/");
@@ -403,14 +403,14 @@ testMultithreadedGet (void)
403} 403}
404 404
405 405
406static int 406static unsigned int
407testMultithreadedPoolGet (void) 407testMultithreadedPoolGet (void)
408{ 408{
409 struct MHD_Daemon *d; 409 struct MHD_Daemon *d;
410 CURL *c; 410 CURL *c;
411 struct CBC cbc; 411 struct CBC cbc;
412 CURLcode errornum; 412 CURLcode errornum;
413 int port; 413 uint16_t port;
414 414
415 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 415 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
416 port = 0; 416 port = 0;
@@ -439,7 +439,7 @@ testMultithreadedPoolGet (void)
439 { 439 {
440 MHD_stop_daemon (d); return 32; 440 MHD_stop_daemon (d); return 32;
441 } 441 }
442 port = (int) dinfo->port; 442 port = dinfo->port;
443 } 443 }
444 c = curl_easy_init (); 444 c = curl_easy_init ();
445 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); 445 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/");
@@ -476,7 +476,7 @@ testMultithreadedPoolGet (void)
476} 476}
477 477
478 478
479static int 479static unsigned int
480testExternalGet (void) 480testExternalGet (void)
481{ 481{
482 struct MHD_Daemon *d; 482 struct MHD_Daemon *d;
@@ -497,7 +497,7 @@ testExternalGet (void)
497 struct CURLMsg *msg; 497 struct CURLMsg *msg;
498 time_t start; 498 time_t start;
499 struct timeval tv; 499 struct timeval tv;
500 int port; 500 uint16_t port;
501 501
502 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 502 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
503 port = 0; 503 port = 0;
@@ -524,7 +524,7 @@ testExternalGet (void)
524 { 524 {
525 MHD_stop_daemon (d); return 32; 525 MHD_stop_daemon (d); return 32;
526 } 526 }
527 port = (int) dinfo->port; 527 port = dinfo->port;
528 } 528 }
529 c = curl_easy_init (); 529 c = curl_easy_init ();
530 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); 530 curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/");
@@ -659,7 +659,7 @@ testExternalGet (void)
659} 659}
660 660
661 661
662static int 662static unsigned int
663testUnknownPortGet (void) 663testUnknownPortGet (void)
664{ 664{
665 struct MHD_Daemon *d; 665 struct MHD_Daemon *d;
@@ -667,7 +667,7 @@ testUnknownPortGet (void)
667 CURL *c; 667 CURL *c;
668 struct CBC cbc; 668 struct CBC cbc;
669 CURLcode errornum; 669 CURLcode errornum;
670 int port; 670 uint16_t port;
671 char buf[2048]; 671 char buf[2048];
672 672
673 struct sockaddr_in addr; 673 struct sockaddr_in addr;
@@ -698,7 +698,7 @@ testUnknownPortGet (void)
698 698
699 if (addr.sin_family != AF_INET) 699 if (addr.sin_family != AF_INET)
700 return 26214; 700 return 26214;
701 port = (int) ntohs (addr.sin_port); 701 port = ntohs (addr.sin_port);
702 } 702 }
703 else 703 else
704 { 704 {
@@ -708,11 +708,11 @@ testUnknownPortGet (void)
708 { 708 {
709 MHD_stop_daemon (d); return 32; 709 MHD_stop_daemon (d); return 32;
710 } 710 }
711 port = (int) dinfo->port; 711 port = dinfo->port;
712 } 712 }
713 713
714 snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/", 714 snprintf (buf, sizeof(buf), "http://127.0.0.1:%u/",
715 port); 715 (unsigned int) port);
716 716
717 c = curl_easy_init (); 717 c = curl_easy_init ();
718 curl_easy_setopt (c, CURLOPT_URL, buf); 718 curl_easy_setopt (c, CURLOPT_URL, buf);