]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: fix conversion warnings with gcc on macOS
authorJay Satiro <raysatiro@yahoo.com>
Sat, 20 May 2023 03:44:07 +0000 (23:44 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 21 May 2023 12:02:31 +0000 (14:02 +0200)
docs/examples/multi-legacy.c
docs/examples/sendrecv.c
src/tool_cb_rea.c
tests/libtest/lib530.c
tests/libtest/lib582.c

index e34600cd2af06035caefdbdc3f5bde6cf4ee6984..f36139fe1d74e4d029443d14b7021cd827137f4e 100644 (file)
@@ -102,7 +102,7 @@ int main(void)
       if(timeout.tv_sec > 1)
         timeout.tv_sec = 1;
       else
-        timeout.tv_usec = (curl_timeo % 1000) * 1000;
+        timeout.tv_usec = (int)(curl_timeo % 1000) * 1000;
     }
 
     /* get file descriptors from the transfers */
index 80b4751ea94ef97955c8de7d6354a223ae886523..b935bee10ca8ce888ae349eb377367b33c040118 100644 (file)
@@ -38,7 +38,7 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
   int res;
 
   tv.tv_sec = timeout_ms / 1000;
-  tv.tv_usec = (timeout_ms % 1000) * 1000;
+  tv.tv_usec = (int)(timeout_ms % 1000) * 1000;
 
   FD_ZERO(&infd);
   FD_ZERO(&outfd);
index 21e242309762b4c8cd933adb99529634e78e8c0d..c9379a3d8cfb5fe4e31a6c04baf840e68da73933 100644 (file)
@@ -65,7 +65,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
 
       /* wait this long at the most */
       timeout.tv_sec = wait/1000;
-      timeout.tv_usec = (wait%1000)*1000;
+      timeout.tv_usec = (int)((wait%1000)*1000);
 
       FD_ZERO(&bits);
       FD_SET(in->fd, &bits);
index 8025c40c2dcb523376dbf52b9cf33932ef6a0aa7..0173dd9789e25d6b9f95e3f4af0e90bc831557b6 100644 (file)
@@ -162,7 +162,7 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
   }
   if(timeout_ms != -1) {
     *timeout = tutil_tvnow();
-    timeout->tv_usec += timeout_ms * 1000;
+    timeout->tv_usec += (int)timeout_ms * 1000;
   }
   else {
     timeout->tv_sec = -1;
index 1f685669f5583dcb18df33d35e5793d20ae15a4a..a50f8a429f789fd494757c26e4f49c6f8c1d9a4e 100644 (file)
@@ -136,7 +136,7 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
   (void)multi; /* unused */
   if(timeout_ms != -1) {
     *timeout = tutil_tvnow();
-    timeout->tv_usec += timeout_ms * 1000;
+    timeout->tv_usec += (int)timeout_ms * 1000;
   }
   else {
     timeout->tv_sec = -1;