From: Simon Tatham Date: Tue, 4 Feb 2014 22:37:53 +0000 (+0000) Subject: Fix warnings when compiling with -DNO_IPV6. X-Git-Tag: 0.64~95 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e00a004e64d9de3f8ff5c4eb745faa326c307057;hp=c29ab648b96aac90971303f57eb73a64325c178e;p=PuTTY.git Fix warnings when compiling with -DNO_IPV6. A user pointed out that 'family' was uninitialised in config.c, and when I tried test-building with -DNO_IPV6 (and the usual -Werror, of course) some unused variables showed up in uxnet.c too. [originally from svn r10135] --- diff --git a/config.c b/config.c index 1596c2f1..2960cab3 100644 --- a/config.c +++ b/config.c @@ -1127,8 +1127,8 @@ static void portfwd_handler(union control *ctrl, void *dlg, else if (whichbutton == 2) family = "6"; else - family = ""; #endif + family = ""; whichbutton = dlg_radiobutton_get(pfd->direction, dlg); if (whichbutton == 0) diff --git a/unix/uxnet.c b/unix/uxnet.c index 1fe78436..4d796f5d 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -331,9 +331,7 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen) } #else struct in_addr a; - SockAddrStep step; - START_STEP(addr, step); - assert(SOCKADDR_FAMILY(addr, step) == AF_INET); + assert(SOCKADDR_FAMILY(addr, ignored_macro_parameter) == AF_INET); a.s_addr = htonl(addr->addresses[0]); strncpy(buf, inet_ntoa(a), buflen); buf[buflen-1] = '\0'; @@ -388,9 +386,7 @@ int sk_address_is_local(SockAddr addr) return sockaddr_is_loopback(addr->ais->ai_addr); #else struct in_addr a; - SockAddrStep step; - START_STEP(addr, step); - assert(SOCKADDR_FAMILY(addr, step) == AF_INET); + assert(SOCKADDR_FAMILY(addr, ignored_macro_parameter) == AF_INET); a.s_addr = htonl(addr->addresses[0]); return ipv4_is_loopback(a); #endif @@ -404,10 +400,8 @@ int sk_address_is_special_local(SockAddr addr) int sk_addrtype(SockAddr addr) { - SockAddrStep step; int family; - START_STEP(addr, step); - family = SOCKADDR_FAMILY(addr, step); + family = SOCKADDR_FAMILY(addr, ignored_macro_parameter); return (family == AF_INET ? ADDRTYPE_IPV4 : #ifndef NO_IPV6