summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
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 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;
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 4c9c8f03c4..91e18e916f 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;