From 36485e56ed428d324fb08cd94cc36031310806e6 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 11 Dec 2005 12:03:01 +0000 Subject: [PATCH] Fix compiler warning and compatibility issue with the type of the parameter used in getnameinfo() to receive the length of the sockaddr struct. --- ares/ares.h | 2 +- ares/ares_getnameinfo.c | 2 +- lib/ftp.c | 2 +- lib/hostip.h | 2 +- lib/hostip6.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ares/ares.h b/ares/ares.h index 7f76112f71..6a5b4efabc 100644 --- a/ares/ares.h +++ b/ares/ares.h @@ -172,7 +172,7 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family, void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg); void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, - socklen_t salen, int flags, ares_nameinfo_callback callback, + size_t salen, int flags, ares_nameinfo_callback callback, void *arg); int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds); struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv, diff --git a/ares/ares_getnameinfo.c b/ares/ares_getnameinfo.c index d13b11d47f..33704b11df 100644 --- a/ares/ares_getnameinfo.c +++ b/ares/ares_getnameinfo.c @@ -78,7 +78,7 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid, #endif static char *ares_striendstr(const char *s1, const char *s2); -void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen, +void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, size_t salen, int flags, ares_nameinfo_callback callback, void *arg) { struct sockaddr_in *addr = NULL; diff --git a/lib/ftp.c b/lib/ftp.c index 6c35ce215a..7b177468ca 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -780,7 +780,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn, */ struct Curl_sockaddr_storage ss; struct addrinfo *res, *ai; - socklen_t sslen; + size_t sslen; char hbuf[NI_MAXHOST]; struct sockaddr *sa=(struct sockaddr *)&ss; unsigned char *ap; diff --git a/lib/hostip.h b/lib/hostip.h index 3baf8284b4..f9be23c22c 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -191,7 +191,7 @@ int curl_dogetaddrinfo(char *hostname, char *service, struct addrinfo *hints, struct addrinfo **result, int line, const char *source); -int curl_dogetnameinfo(const struct sockaddr *sa, socklen_t salen, +int curl_dogetnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags, int line, const char *source); diff --git a/lib/hostip6.c b/lib/hostip6.c index 867b38a788..edfbd54f42 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -138,12 +138,12 @@ int curl_dogetaddrinfo(char *hostname, char *service, return res; } -int curl_dogetnameinfo(const struct sockaddr *sa, socklen_t salen, +int curl_dogetnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags, int line, const char *source) { - int res = (int)(getnameinfo)(sa, salen, host, hostlen, serv, servlen, flags); + int res = (getnameinfo)(sa, salen, host, hostlen, serv, servlen, flags); if(0 == res) { /* success */ if(logfile)