summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-20 18:02:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-20 18:02:17 +0000
commit1b7465e893131c8a8b27078704223ecfb2311119 (patch)
tree1ef49f987a8f65bdb2c1396bf681c4f4e2ca8b6c /ext/socket
parent866e083484738db8ba8b8b37674d9292ef7cb84a (diff)
* eval.c, file.c, etc.: code-cleanup patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:08029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/getaddrinfo.c33
-rw-r--r--ext/socket/getnameinfo.c15
2 files changed, 9 insertions, 39 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 02f2ab9..5a3c137 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;
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 4c9c8f0..91e18e9 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -115,11 +115,7 @@ static struct afd {
#ifndef HAVE_INET_NTOP
static const char *
-inet_ntop(af, addr, numaddr, numaddr_len)
- int af;
- const void *addr;
- char *numaddr;
- size_t numaddr_len;
+inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
#ifdef HAVE_INET_NTOA
struct in_addr in;
@@ -136,14 +132,7 @@ inet_ntop(af, addr, numaddr, numaddr_len)
#endif
int
-getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
- const struct sockaddr *sa;
- size_t salen;
- char *host;
- size_t hostlen;
- char *serv;
- size_t servlen;
- int flags;
+getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
{
struct afd *afd;
struct servent *sp;