Enabled a few more gcc warnings with --enable-debug. Renamed a few

variables to avoid shadowing global declarations.
This commit is contained in:
Dan Fandrich 2007-09-27 01:45:22 +00:00
parent 9c5cd6c413
commit 16b95fc773
16 changed files with 102 additions and 98 deletions

View file

@ -31,14 +31,14 @@ struct userdata {
};
/* lock callback */
static void my_lock(CURL *handle, curl_lock_data data, curl_lock_access access,
static void my_lock(CURL *handle, curl_lock_data data, curl_lock_access laccess,
void *useptr )
{
const char *what;
struct userdata *user = (struct userdata *)useptr;
(void)handle;
(void)access;
(void)laccess;
switch ( data ) {
case CURL_LOCK_DATA_SHARE:

View file

@ -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

View file

@ -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;