From 16b95fc77316fdd3866f7de4ebb5d14bd136ac11 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 27 Sep 2007 01:45:22 +0000 Subject: Enabled a few more gcc warnings with --enable-debug. Renamed a few variables to avoid shadowing global declarations. --- tests/server/sockfilt.c | 16 ++++++++-------- tests/server/tftpd.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'tests/server') diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 2cca0b37b..ae576237e 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -411,7 +411,7 @@ static int juggle(curl_socket_t *sockfdp, } static curl_socket_t sockdaemon(curl_socket_t sock, - unsigned short *port) + unsigned short *listenport) { /* passive daemon style */ struct sockaddr_in me; @@ -441,7 +441,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, #endif me.sin_family = AF_INET; me.sin_addr.s_addr = INADDR_ANY; - me.sin_port = htons(*port); + me.sin_port = htons(*listenport); rc = bind(sock, (struct sockaddr *) &me, sizeof(me)); #ifdef ENABLE_IPV6 } @@ -449,7 +449,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, memset(&me6, 0, sizeof(struct sockaddr_in6)); me6.sin6_family = AF_INET6; me6.sin6_addr = in6addr_any; - me6.sin6_port = htons(*port); + me6.sin6_port = htons(*listenport); rc = bind(sock, (struct sockaddr *) &me6, sizeof(me6)); } #endif /* ENABLE_IPV6 */ @@ -459,7 +459,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, return CURL_SOCKET_BAD; } - if(!*port) { + if(!*listenport) { /* The system picked a port number, now figure out which port we actually got */ /* we succeeded to bind */ @@ -471,7 +471,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, logmsg("getsockname() failed with error: %d", SOCKERRNO); return CURL_SOCKET_BAD; } - *port = ntohs(add.sin_port); + *listenport = ntohs(add.sin_port); } /* start accepting connections */ @@ -485,13 +485,13 @@ static curl_socket_t sockdaemon(curl_socket_t sock, return sock; } -static curl_socket_t mksock(bool use_ipv6) +static curl_socket_t mksock(bool ipv6) { curl_socket_t sock; #ifdef ENABLE_IPV6 - if(!use_ipv6) + if(!ipv6) #else - (void)use_ipv6; + (void)ipv6; #endif sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef ENABLE_IPV6 diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index e7fae0d47..416317eac 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -286,7 +286,7 @@ static int writeit(struct testcase *test, struct tftphdr **dpp, */ static ssize_t write_behind(struct testcase *test, int convert) { - char *buf; + char *writebuf; int count; int ct; char *p; @@ -312,15 +312,15 @@ static ssize_t write_behind(struct testcase *test, int convert) b->counter = BF_FREE; /* reset flag */ dp = (struct tftphdr *)b->buf; nextone = !nextone; /* incr for next time */ - buf = dp->th_data; + writebuf = dp->th_data; if (count <= 0) return -1; /* nak logic? */ if (convert == 0) - return write(test->ofile, buf, count); + return write(test->ofile, writebuf, count); - p = buf; + p = writebuf; ct = count; while (ct--) { /* loop over the buffer */ c = *p++; /* pick up a character */ @@ -363,8 +363,8 @@ static int synchnet(curl_socket_t f /* socket to flush */) #endif int j = 0; char rbuf[PKTSIZE]; - struct sockaddr_in from; - socklen_t fromlen; + struct sockaddr_in fromaddr; + socklen_t fromaddrlen; while (1) { #if defined(HAVE_IOCTLSOCKET) @@ -374,9 +374,9 @@ static int synchnet(curl_socket_t f /* socket to flush */) #endif if (i) { j++; - fromlen = sizeof from; + fromaddrlen = sizeof fromaddr; (void) recvfrom(f, rbuf, sizeof (rbuf), 0, - (struct sockaddr *)&from, &fromlen); + (struct sockaddr *)&fromaddr, &fromaddrlen); } else break; -- cgit v1.2.3