From a43ce2c320786f6065886469aa964b99f49d9c9c Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 7 May 2003 10:27:32 -0400 Subject: [PATCH] ERR: Fix some HP specific warnings --- Source/CTest/Curl/connect.c | 12 ++++++++++-- Source/CTest/Curl/ftp.c | 16 ++++++++++++++-- Source/CTest/Curl/telnet.c | 2 +- Source/CTest/Curl/url.c | 4 ++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Source/CTest/Curl/connect.c b/Source/CTest/Curl/connect.c index 0f95bd5d3..2165271a1 100644 --- a/Source/CTest/Curl/connect.c +++ b/Source/CTest/Curl/connect.c @@ -269,9 +269,13 @@ static CURLcode bindlocal(struct connectdata *conn, /* we succeeded to bind */ struct sockaddr_in add; - size = sizeof(add); +#ifdef __hpux + int gsize = sizeof(add); +#else + socklen_t gsize = sizeof(add); +#endif if(getsockname(sockfd, (struct sockaddr *) &add, - (socklen_t *)&size)<0) { + &gsize)<0) { failf(data, "getsockname() failed"); return CURLE_HTTP_PORT_FAILED; } @@ -337,7 +341,11 @@ static int socketerror(int sockfd) { int err = 0; +#ifdef __hpux + int errSize = sizeof(err); +#else socklen_t errSize = sizeof(err); +#endif if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) diff --git a/Source/CTest/Curl/ftp.c b/Source/CTest/Curl/ftp.c index d9de10379..0163d3a18 100644 --- a/Source/CTest/Curl/ftp.c +++ b/Source/CTest/Curl/ftp.c @@ -142,11 +142,15 @@ static CURLcode AllowServerConnect(struct SessionHandle *data, /* we have received data here */ { int s; +#ifdef __hpux + int size = sizeof(struct sockaddr_in); +#else socklen_t size = sizeof(struct sockaddr_in); +#endif struct sockaddr_in add; - getsockname(sock, (struct sockaddr *) &add, (socklen_t *)&size); - s=(int)accept(sock, (struct sockaddr *) &add, (socklen_t *)&size); + getsockname(sock, (struct sockaddr *) &add, &size); + s=(int)accept(sock, (struct sockaddr *) &add, &size); sclose(sock); /* close the first socket */ @@ -1220,7 +1224,11 @@ CURLcode ftp_use_port(struct connectdata *conn) if(! *myhost) { /* pick a suitable default here */ +#ifdef __hpux + int sslen; +#else socklen_t sslen; +#endif sslen = sizeof(sa); if (getsockname(conn->firstsocket, (struct sockaddr *)&sa, &sslen) < 0) { @@ -1259,7 +1267,11 @@ CURLcode ftp_use_port(struct connectdata *conn) if(bind(portsock, (struct sockaddr *)&sa, size) >= 0) { /* we succeeded to bind */ struct sockaddr_in add; +#ifdef __hpux + int socksize = sizeof(add); +#else socklen_t socksize = sizeof(add); +#endif if(getsockname(portsock, (struct sockaddr *) &add, &socksize)<0) { diff --git a/Source/CTest/Curl/telnet.c b/Source/CTest/Curl/telnet.c index 75dd03ae6..56d3ebdfd 100644 --- a/Source/CTest/Curl/telnet.c +++ b/Source/CTest/Curl/telnet.c @@ -454,7 +454,7 @@ void rec_wont(struct connectdata *conn, int option) } } -void set_local_option(struct connectdata *conn, int option, int newstate) +static void set_local_option(struct connectdata *conn, int option, int newstate) { struct TELNET *tn = (struct TELNET *)conn->proto.telnet; if(newstate == YES) diff --git a/Source/CTest/Curl/url.c b/Source/CTest/Curl/url.c index b22510a55..b7460cd98 100644 --- a/Source/CTest/Curl/url.c +++ b/Source/CTest/Curl/url.c @@ -1391,8 +1391,8 @@ static int handleSock5Proxy( int sock) { unsigned char socksreq[600]; /* room for large user/pw (255 max each) */ - int actualread; - int written; + ssize_t actualread; + ssize_t written; CURLcode result; Curl_nonblock(sock, FALSE);