summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-09-07 16:10:00 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-09-07 16:10:00 (GMT)
commit39e0c5daebb9c7ac6fc4a6f1a9330a8371a4a527 (patch)
treea28a586549e7d6342e1eeb0cd3712ea3ed271186 /Modules
parenta3891ea46c6d7352171b6f1eae9df1240cb58738 (diff)
downloadcpython-39e0c5daebb9c7ac6fc4a6f1a9330a8371a4a527.zip
cpython-39e0c5daebb9c7ac6fc4a6f1a9330a8371a4a527.tar.gz
cpython-39e0c5daebb9c7ac6fc4a6f1a9330a8371a4a527.tar.bz2
Fix compiler warnings. This closes some of the #458880 problem.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getaddrinfo.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Modules/getaddrinfo.c b/Modules/getaddrinfo.c
index 3745c43..5d137d8 100644
--- a/Modules/getaddrinfo.c
+++ b/Modules/getaddrinfo.c
@@ -236,10 +236,8 @@ str_isnumber(p)
}
int
-getaddrinfo(hostname, servname, hints, res)
- const char *hostname, *servname;
- const struct addrinfo *hints;
- struct addrinfo **res;
+getaddrinfo(const char*hostname, const char*servname,
+ const struct addrinfo *hints, struct addrinfo **res)
{
struct addrinfo sentinel;
struct addrinfo *top = NULL;
@@ -367,15 +365,16 @@ getaddrinfo(hostname, servname, hints, res)
if ((sp = getservbyname(servname, proto)) == NULL)
ERR(EAI_SERVICE);
port = sp->s_port;
- if (pai->ai_socktype == GAI_ANY)
+ if (pai->ai_socktype == GAI_ANY) {
if (strcmp(sp->s_proto, "udp") == 0) {
pai->ai_socktype = SOCK_DGRAM;
pai->ai_protocol = IPPROTO_UDP;
} else if (strcmp(sp->s_proto, "tcp") == 0) {
- pai->ai_socktype = SOCK_STREAM;
- pai->ai_protocol = IPPROTO_TCP;
- } else
- ERR(EAI_PROTOCOL); /*xxx*/
+ pai->ai_socktype = SOCK_STREAM;
+ pai->ai_protocol = IPPROTO_TCP;
+ } else
+ ERR(EAI_PROTOCOL); /*xxx*/
+ }
}
}