From 9102a25679890ff04808dc56d8fd192966921c49 Mon Sep 17 00:00:00 2001 From: tholo Date: Mon, 25 Mar 1996 22:06:52 +0000 Subject: [PATCH] Pull in prototypes Do the right thing in presense of __STDC__ --- lib/libc/net/gethostnamadr.c | 15 +++++++-------- lib/libc/net/htons.c | 4 ++++ lib/libc/net/ns_ntoa.c | 3 ++- lib/libc/net/ntohs.c | 4 ++++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index ec3f14a9002..6d8072bd79e 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -144,7 +144,7 @@ getanswer(answer, anslen, iquery) if (qdcount) { if (iquery) { if ((n = dn_expand((u_char *)answer->buf, - (u_char *)eom, (u_char *)cp, (u_char *)bp, + (u_char *)eom, (u_char *)cp, bp, buflen)) < 0) { h_errno = NO_RECOVERY; return ((struct hostent *) NULL); @@ -174,7 +174,7 @@ getanswer(answer, anslen, iquery) haveanswer = 0; while (--ancount >= 0 && cp < eom) { if ((n = dn_expand((u_char *)answer->buf, (u_char *)eom, - (u_char *)cp, (u_char *)bp, buflen)) < 0) + (u_char *)cp, bp, buflen)) < 0) break; cp += n; type = _getshort(cp); @@ -195,7 +195,7 @@ getanswer(answer, anslen, iquery) } if (iquery && type == T_PTR) { if ((n = dn_expand((u_char *)answer->buf, - (u_char *)eom, (u_char *)cp, (u_char *)bp, + (u_char *)eom, (u_char *)cp, bp, buflen)) < 0) break; cp += n; @@ -368,11 +368,11 @@ gethostbyaddr(addr, len, type) switch (lookups[i]) { #ifdef YP case 'y': - hp = _yp_gethtbyaddr(addr, len, type); + hp = _yp_gethtbyaddr(addr); break; #endif case 'b': - n = res_query(qbuf, C_IN, T_PTR, (char *)&buf, sizeof(buf)); + n = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf)); if (n < 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) @@ -469,7 +469,7 @@ again: struct hostent * _gethtbyname(name) - char *name; + const char *name; { register struct hostent *p; register char **cp; @@ -598,9 +598,8 @@ done: } struct hostent * -_yp_gethtbyaddr(addr, len, type) +_yp_gethtbyaddr(addr) const char *addr; - int len, type; { struct hostent *hp = (struct hostent *)NULL; static char *__ypcurrent; diff --git a/lib/libc/net/htons.c b/lib/libc/net/htons.c index b2500a51d1c..9b1de6ccfcf 100644 --- a/lib/libc/net/htons.c +++ b/lib/libc/net/htons.c @@ -15,8 +15,12 @@ static char *rcsid = "$NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $"; #undef htons unsigned short +#if __STDC__ +htons(unsigned short x) +#else htons(x) unsigned short x; +#endif { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; diff --git a/lib/libc/net/ns_ntoa.c b/lib/libc/net/ns_ntoa.c index ad3265399b6..777028cff28 100644 --- a/lib/libc/net/ns_ntoa.c +++ b/lib/libc/net/ns_ntoa.c @@ -45,6 +45,8 @@ static char rcsid[] = "$NetBSD: ns_ntoa.c,v 1.4 1995/02/25 06:20:51 cgd Exp $"; #include #include +static char *spectHex __P((char *)); + char * ns_ntoa(addr) struct ns_addr addr; @@ -56,7 +58,6 @@ ns_ntoa(addr) char *cp2; register u_char *up = addr.x_host.c_host; u_char *uplim = up + 6; - static char *spectHex(); net.net_e = addr.x_net; sprintf(obuf, "%lx", ntohl(net.long_e)); diff --git a/lib/libc/net/ntohs.c b/lib/libc/net/ntohs.c index 93ab83ee4d8..6e180c16ab2 100644 --- a/lib/libc/net/ntohs.c +++ b/lib/libc/net/ntohs.c @@ -15,8 +15,12 @@ static char *rcsid = "$NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $"; #undef ntohs unsigned short +#if __STDC__ +ntohs(unsigned short x) +#else ntohs(x) unsigned short x; +#endif { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; -- 2.20.1