]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Fix compiler warning: conversion from "int" to "unsigned short" may lose significant...
authorYang Tse <yangsita@gmail.com>
Sat, 20 Oct 2007 15:11:51 +0000 (15:11 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 20 Oct 2007 15:11:51 +0000 (15:11 +0000)
ares/ares_init.c
lib/hostares.c
lib/url.c

index c1e10f94230cca5f623d9eeabaccaa2b60821f15..2627cb46ade384f12978791ab8e11754655c149b 100644 (file)
@@ -266,8 +266,8 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
   options->timeout = channel->timeout;
   options->tries   = channel->tries;
   options->ndots   = channel->ndots;
-  options->udp_port = channel->udp_port;
-  options->tcp_port = channel->tcp_port;
+  options->udp_port = (unsigned short)channel->udp_port;
+  options->tcp_port = (unsigned short)channel->tcp_port;
   options->sock_state_cb     = channel->sock_state_cb;
   options->sock_state_cb_data = channel->sock_state_cb_data;
 
index 81707ac7c8cf7c3ba13e8401e8f525c80d79d653..6a70c8276cb8d55917449ed49779ed47a28ace2f 100644 (file)
@@ -255,7 +255,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
     tvp = ares_timeout(data->state.areschannel, &store, &tv);
 
     /* use the timeout period ares returned to us above */
-    ares_waitperform(conn, tvp->tv_sec * 1000 + tvp->tv_usec/1000);
+    ares_waitperform(conn, (int)(tvp->tv_sec * 1000 + tvp->tv_usec/1000));
 
     if(conn->async.done)
       break;
index 6f6d8c22617503193f9a637c8abc773be46058ff..e7ef8024658ac073a2d050a828004f4ce7d4a924 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3101,7 +3101,7 @@ static CURLcode setup_connection_internals(struct SessionHandle *data,
       }
 
       conn->port = p->defport;
-      conn->remote_port = p->defport;
+      conn->remote_port = (unsigned short)p->defport;
       conn->protocol |= p->protocol;
       return CURLE_OK;
     }