]> granicus.if.org Git - curl/commitdiff
libtest: fix MinGW-w64 warnings
authorMarcel Raad <raad@teamviewer.com>
Mon, 8 May 2017 17:59:46 +0000 (19:59 +0200)
committerMarcel Raad <raad@teamviewer.com>
Mon, 8 May 2017 17:59:46 +0000 (19:59 +0200)
long is 32 bits while size_t is 64 bits on MinGW-w64, so
typecheck-gcc.h complains when using size_t for a long option.
Also, curl_socket_t is unsigned long long rather than int.

tests/libtest/lib1525.c
tests/libtest/lib1526.c
tests/libtest/lib1527.c
tests/libtest/lib555.c
tests/libtest/lib578.c
tests/libtest/lib582.c

index 39d51bb114c0f6dd31997519c18a50bb267237a5..a764945897d310378a399efcc2179387e464f458 100644 (file)
@@ -82,7 +82,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
   test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
-  test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
+  test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data));
 
   res = curl_easy_perform(curl);
 
index b2d2a4118c334f9ca9b6b242737695ab40e105c5..704ae497d9bfd2fba0a819a49c71e0374f76246b 100644 (file)
@@ -85,7 +85,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
   test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
-  test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
+  test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data));
 
   res = curl_easy_perform(curl);
 
index 5dec7fcc0e24b80f93a5462549d202615473549c..689839e3dc2fbc22864124a728796709b3424faf 100644 (file)
@@ -83,7 +83,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
   test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
   test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
-  test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
+  test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data));
   test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
 
   res = curl_easy_perform(curl);
index e84af87e51648d64c7ef00a22f1763484bbad69d..8156a95e7dcc373ac56eb64ffc52bced10df79c4 100644 (file)
@@ -98,7 +98,7 @@ int test(char *URL)
   easy_setopt(curl, CURLOPT_READDATA, &counter);
   /* We CANNOT do the POST fine without setting the size (or choose
      chunked)! */
-  easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(UPLOADTHIS));
+  easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
 
   easy_setopt(curl, CURLOPT_POST, 1L);
 #ifdef CURL_DOES_CONVERSIONS
index 9603b58d72a2afe7445c858735312e63c3f6ac8f..41b23db34ff2f10962765b8c9a06777956cbe431 100644 (file)
@@ -77,7 +77,7 @@ int test(char *URL)
 #endif
 
   /* Set the expected POST size */
-  test_setopt(curl, CURLOPT_POSTFIELDSIZE, data_size);
+  test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)data_size);
   test_setopt(curl, CURLOPT_POSTFIELDS, data);
 
   /* we want to use our own progress function */
index eec0455f616cdfb8911a267f4b14d27be04a4258..1eb9b02d52278eb5e263a8575e9f828ff16a2ff4 100644 (file)
@@ -320,7 +320,7 @@ int test(char *URL)
       tv.tv_usec = 100000;
     }
 
-    select_test(maxFd, &readSet, &writeSet, NULL, &tv);
+    select_test((int)maxFd, &readSet, &writeSet, NULL, &tv);
 
     /* Check the sockets for reading / writing */
     checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read");