Pull in prototypes
authortholo <tholo@openbsd.org>
Mon, 25 Mar 1996 22:06:52 +0000 (22:06 +0000)
committertholo <tholo@openbsd.org>
Mon, 25 Mar 1996 22:06:52 +0000 (22:06 +0000)
Do the right thing in presense of __STDC__

lib/libc/net/gethostnamadr.c
lib/libc/net/htons.c
lib/libc/net/ns_ntoa.c
lib/libc/net/ntohs.c

index ec3f14a..6d8072b 100644 (file)
@@ -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;
index b2500a5..9b1de6c 100644 (file)
@@ -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;
index ad32653..777028c 100644 (file)
@@ -45,6 +45,8 @@ static char rcsid[] = "$NetBSD: ns_ntoa.c,v 1.4 1995/02/25 06:20:51 cgd Exp $";
 #include <netns/ns.h>
 #include <stdio.h>
 
+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));
index 93ab83e..6e180c1 100644 (file)
@@ -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;