From 1b7465e893131c8a8b27078704223ecfb2311119 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 20 Jun 2006 18:02:17 +0000 Subject: * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehner . [ruby-core:08029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/getaddrinfo.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'ext/socket/getaddrinfo.c') diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c index 02f2ab9d35..5a3c1377f4 100644 --- a/ext/socket/getaddrinfo.c +++ b/ext/socket/getaddrinfo.c @@ -198,8 +198,7 @@ if (pai->ai_flags & AI_CANONNAME) {\ const #endif char * -gai_strerror(ecode) - int ecode; +gai_strerror(int ecode) { if (ecode < 0 || ecode > EAI_MAX) ecode = EAI_MAX; @@ -207,7 +206,7 @@ gai_strerror(ecode) } void -freeaddrinfo(ai) +freeaddrinfo(struct addrinfo *ai) struct addrinfo *ai; { struct addrinfo *next; @@ -222,8 +221,7 @@ freeaddrinfo(ai) } static int -str_isnumber(p) - const char *p; +str_isnumber(const char *p) { char *q = (char *)p; while (*q) { @@ -237,10 +235,7 @@ str_isnumber(p) #ifndef HAVE_INET_PTON static int -inet_pton(af, hostname, pton) - int af; - const char *hostname; - void *pton; +inet_pton(int af, const char *hostname, void *pton) { struct in_addr in; @@ -268,10 +263,7 @@ inet_pton(af, hostname, pton) #endif 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; @@ -538,13 +530,7 @@ getaddrinfo(hostname, servname, hints, res) } static int -get_name(addr, afd, res, numaddr, pai, port0) - const char *addr; - const struct afd *afd; - struct addrinfo **res; - char *numaddr; - struct addrinfo *pai; - int port0; +get_name(const char *addr, const struct aft *afd, struct addrinfo **res, char *numaddr, struct addrinfo *pai, int port0) { u_short port = port0 & 0xffff; struct hostent *hp; @@ -584,12 +570,7 @@ get_name(addr, afd, res, numaddr, pai, port0) } static int -get_addr(hostname, af, res, pai, port0) - const char *hostname; - int af; - struct addrinfo **res; - struct addrinfo *pai; - int port0; +get_addr(const char *hostname, int af, struct addrinfo **res, struct addrinfo *pai, int port0) { u_short port = port0 & 0xffff; struct addrinfo sentinel; -- cgit v1.2.3