1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 03:55:03 -05:00

compiler warning fix

This commit is contained in:
Yang Tse 2007-02-01 15:36:56 +00:00
parent 1c63ceb317
commit d2dd3d7e16
5 changed files with 11 additions and 9 deletions

View File

@ -110,7 +110,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
port = addr->sin_port;
else
port = addr6->sin6_port;
service = lookup_service(port, flags, buf, sizeof(buf));
service = lookup_service((unsigned short)(port & 0xffff),
flags, buf, sizeof(buf));
callback(arg, ARES_SUCCESS, NULL, service);
return;
}
@ -151,7 +152,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
}
/* They also want a service */
if (flags & ARES_NI_LOOKUPSERVICE)
service = lookup_service(port, flags, srvbuf, sizeof(srvbuf));
service = lookup_service((unsigned short)(port & 0xffff),
flags, srvbuf, sizeof(srvbuf));
callback(arg, ARES_SUCCESS, ipbuf, service);
return;
}

View File

@ -609,7 +609,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
memset(&sockin, 0, sizeof(sockin));
sockin.sin_family = AF_INET;
sockin.sin_addr = server->addr;
sockin.sin_port = channel->tcp_port;
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
int err = GET_ERRNO();
@ -642,7 +642,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
memset(&sockin, 0, sizeof(sockin));
sockin.sin_family = AF_INET;
sockin.sin_addr = server->addr;
sockin.sin_port = channel->udp_port;
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
{
closesocket(s);

View File

@ -1586,7 +1586,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
}
}
if(ptr) {
newport = num;
newport = (unsigned short)(num & 0xffff);
if (conn->bits.tunnel_proxy)
/* proxy tunnel -> use other host info because ip_addr_str is the
@ -1650,7 +1650,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
else
snprintf(newhost, sizeof(newhost),
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
newport = (port[0]<<8) + port[1];
newport = (unsigned short)(((port[0]<<8) + port[1]) & 0xffff);
}
else if(ftpc->count1 == 0) {
/* EPSV failed, move on to PASV */

View File

@ -608,7 +608,7 @@ bool Curl_ssl_data_pending(struct connectdata *conn,
/* OpenSSL-specific */
if(conn->ssl[connindex].handle)
/* SSL is in use */
return SSL_pending(conn->ssl[connindex].handle);
return (bool)(0 != SSL_pending(conn->ssl[connindex].handle));
#else
(void)conn;
(void)connindex;

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -422,7 +422,7 @@ char *glob_next_url(URLGlob *glob)
}
break;
case UPTCharRange:
pat->content.CharRange.ptr_c += pat->content.CharRange.step;
pat->content.CharRange.ptr_c += (char)(pat->content.CharRange.step);
if (pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) {
pat->content.CharRange.ptr_c = pat->content.CharRange.min_c;
carry = TRUE;