From 5c8fc7dce9668a141a01781159817552a7cb4ef8 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 20 Oct 2007 15:11:51 +0000 Subject: [PATCH] Fix compiler warning: conversion from "int" to "unsigned short" may lose significant bits --- ares/ares_init.c | 4 ++-- lib/hostares.c | 2 +- lib/url.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ares/ares_init.c b/ares/ares_init.c index c1e10f9423..2627cb46ad 100644 --- a/ares/ares_init.c +++ b/ares/ares_init.c @@ -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; diff --git a/lib/hostares.c b/lib/hostares.c index 81707ac7c8..6a70c8276c 100644 --- a/lib/hostares.c +++ b/lib/hostares.c @@ -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; diff --git a/lib/url.c b/lib/url.c index 6f6d8c2261..e7ef802465 100644 --- 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; } -- 2.47.3