summaryrefslogtreecommitdiffstats
path: root/Modules/getaddrinfo.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-07-21 09:42:15 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-07-21 09:42:15 (GMT)
commitc925b1538a8b6efb752579b416c29a7738218b11 (patch)
tree6582f3108870174199eb83b17d7d03247ea6917b /Modules/getaddrinfo.c
parent20f51a7b3845fc8534d4f89cbf847dded027565f (diff)
downloadcpython-c925b1538a8b6efb752579b416c29a7738218b11.zip
cpython-c925b1538a8b6efb752579b416c29a7738218b11.tar.gz
cpython-c925b1538a8b6efb752579b416c29a7738218b11.tar.bz2
Silence warnings in MSVC++: hide unused variables, add constness back to
inet_pton/ntop, convert htons argument to u_short.
Diffstat (limited to 'Modules/getaddrinfo.c')
-rw-r--r--Modules/getaddrinfo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/getaddrinfo.c b/Modules/getaddrinfo.c
index a1f4c14..f74b5d6 100644
--- a/Modules/getaddrinfo.c
+++ b/Modules/getaddrinfo.c
@@ -343,7 +343,7 @@ getaddrinfo(hostname, servname, hints, res)
pai->ai_socktype = SOCK_DGRAM;
pai->ai_protocol = IPPROTO_UDP;
}
- port = htons(atoi(servname));
+ port = htons((u_short)atoi(servname));
} else {
struct servent *sp;
char *proto;
@@ -417,7 +417,9 @@ getaddrinfo(hostname, servname, hints, res)
for (i = 0; gai_afdl[i].a_af; i++) {
if (inet_pton(gai_afdl[i].a_af, hostname, pton)) {
u_long v4a;
+#ifdef INET6
u_char pfx;
+#endif
switch (gai_afdl[i].a_af) {
case AF_INET:
@@ -492,7 +494,10 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
u_short port = port0 & 0xffff;
struct hostent *hp;
struct addrinfo *cur;
- int error = 0, h_error;
+ int error = 0;
+#ifdef INET6
+ int h_error;
+#endif
#ifdef INET6
hp = getipnodebyaddr(addr, gai_afd->a_addrlen, gai_afd->a_af, &h_error);