Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/inet Use C89 definitions



details:   https://anonhg.NetBSD.org/src/rev/386408e75bef
branches:  trunk
changeset: 778249:386408e75bef
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 20 17:08:13 2012 +0000

description:
Use C89 definitions

diffstat:

 lib/libc/inet/inet_cidr_pton.c |  11 +++++------
 lib/libc/inet/inet_net_ntop.c  |  26 +++++++++-----------------
 lib/libc/inet/inet_net_pton.c  |  17 +++++++++++------
 lib/libc/inet/inet_ntop.c      |  20 +++++---------------
 4 files changed, 30 insertions(+), 44 deletions(-)

diffs (213 lines):

diff -r c3a3e2e2e76b -r 386408e75bef lib/libc/inet/inet_cidr_pton.c
--- a/lib/libc/inet/inet_cidr_pton.c    Tue Mar 20 17:06:43 2012 +0000
+++ b/lib/libc/inet/inet_cidr_pton.c    Tue Mar 20 17:08:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_cidr_pton.c,v 1.7 2012/03/13 21:13:38 christos Exp $      */
+/*     $NetBSD: inet_cidr_pton.c,v 1.8 2012/03/20 17:08:13 matt Exp $  */
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -22,7 +22,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp";
 #else
-__RCSID("$NetBSD: inet_cidr_pton.c,v 1.7 2012/03/13 21:13:38 christos Exp $");
+__RCSID("$NetBSD: inet_cidr_pton.c,v 1.8 2012/03/20 17:08:13 matt Exp $");
 #endif
 #endif
 
@@ -55,10 +55,9 @@
 __weak_alias(inet_cidr_pton,_inet_cidr_pton)
 #endif
 
-static int     inet_cidr_pton_ipv4 __P((const char *src, u_char *dst,
-                                        int *bits, int ipv6));
-static int     inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
-                                        int *bits));
+static int     inet_cidr_pton_ipv4(const char *src, u_char *dst,
+                                        int *bits, int ipv6);
+static int     inet_cidr_pton_ipv6(const char *src, u_char *dst, int *bits);
 
 static int     getbits(const char *, int ipv6);
 
diff -r c3a3e2e2e76b -r 386408e75bef lib/libc/inet/inet_net_ntop.c
--- a/lib/libc/inet/inet_net_ntop.c     Tue Mar 20 17:06:43 2012 +0000
+++ b/lib/libc/inet/inet_net_ntop.c     Tue Mar 20 17:08:13 2012 +0000
@@ -20,7 +20,7 @@
 #ifdef notdef
 static const char rcsid[] = "Id: inet_net_ntop.c,v 1.1.2.1 2002/08/02 02:17:21 marka Exp ";
 #else
-__RCSID("$NetBSD: inet_net_ntop.c,v 1.2 2009/02/07 07:25:22 lukem Exp $");
+__RCSID("$NetBSD: inet_net_ntop.c,v 1.3 2012/03/20 17:08:13 matt Exp $");
 #endif
 #endif
 
@@ -49,10 +49,10 @@
 # define SPRINTF(x) sprintf x
 #endif
 
-static char *  inet_net_ntop_ipv4 __P((const u_char *src, int bits,
-                                       char *dst, size_t size));
-static char *  inet_net_ntop_ipv6 __P((const u_char *src, int bits,
-                                       char *dst, size_t size));
+static char *  inet_net_ntop_ipv4(const u_char *src, int bits,
+                                       char *dst, size_t size);
+static char *  inet_net_ntop_ipv6(const u_char *src, int bits,
+                                       char *dst, size_t size);
 
 /*
  * char *
@@ -65,12 +65,7 @@
  *     Paul Vixie (ISC), July 1996
  */
 char *
-inet_net_ntop(af, src, bits, dst, size)
-       int af;
-       const void *src;
-       int bits;
-       char *dst;
-       size_t size;
+inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size)
 {
        switch (af) {
        case AF_INET:
@@ -97,11 +92,7 @@
  *     Paul Vixie (ISC), July 1996
  */
 static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
-       const u_char *src;
-       int bits;
-       char *dst;
-       size_t size;
+inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
 {
        char *odst = dst;
        char *t;
@@ -176,7 +167,8 @@
  */
 
 static char *
-inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
+inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
+{
        u_int   m;
        int     b;
        size_t  p;
diff -r c3a3e2e2e76b -r 386408e75bef lib/libc/inet/inet_net_pton.c
--- a/lib/libc/inet/inet_net_pton.c     Tue Mar 20 17:06:43 2012 +0000
+++ b/lib/libc/inet/inet_net_pton.c     Tue Mar 20 17:08:13 2012 +0000
@@ -20,7 +20,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
 #else
-__RCSID("$NetBSD: inet_net_pton.c,v 1.3 2012/03/13 21:13:38 christos Exp $");
+__RCSID("$NetBSD: inet_net_pton.c,v 1.4 2012/03/20 17:08:13 matt Exp $");
 #endif
 #endif
 
@@ -71,7 +71,8 @@
  *     Paul Vixie (ISC), June 1996
  */
 static int
-inet_net_pton_ipv4( const char *src, u_char *dst, size_t size) {
+inet_net_pton_ipv4(const char *src, u_char *dst, size_t size)
+{
        static const char xdigits[] = "0123456789abcdef";
        static const char digits[] = "0123456789";
        int ch, dirty, bits;
@@ -197,7 +198,8 @@
 }
 
 static int
-getbits(const char *src, int *bitsp) {
+getbits(const char *src, int *bitsp)
+{
        static const char digits[] = "0123456789";
        int n;
        int val;
@@ -227,7 +229,8 @@
 }
 
 static int
-getv4(const char *src, u_char *dst, int *bitsp) {
+getv4(const char *src, u_char *dst, int *bitsp)
+{
        static const char digits[] = "0123456789";
        u_char *odst = dst;
        int n;
@@ -270,7 +273,8 @@
 }
 
 static int
-inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
+inet_net_pton_ipv6(const char *src, u_char *dst, size_t size)
+{
        static const char xdigits_l[] = "0123456789abcdef",
                          xdigits_u[] = "0123456789ABCDEF";
        u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
@@ -402,7 +406,8 @@
  *     Paul Vixie (ISC), June 1996
  */
 int
-inet_net_pton(int af, const char *src, void *dst, size_t size) {
+inet_net_pton(int af, const char *src, void *dst, size_t size)
+{
        switch (af) {
        case AF_INET:
                return (inet_net_pton_ipv4(src, dst, size));
diff -r c3a3e2e2e76b -r 386408e75bef lib/libc/inet/inet_ntop.c
--- a/lib/libc/inet/inet_ntop.c Tue Mar 20 17:06:43 2012 +0000
+++ b/lib/libc/inet/inet_ntop.c Tue Mar 20 17:08:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_ntop.c,v 1.8 2009/04/12 17:07:17 christos Exp $   */
+/*     $NetBSD: inet_ntop.c,v 1.9 2012/03/20 17:08:13 matt Exp $       */
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -22,7 +22,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
 #else
-__RCSID("$NetBSD: inet_ntop.c,v 1.8 2009/04/12 17:07:17 christos Exp $");
+__RCSID("$NetBSD: inet_ntop.c,v 1.9 2012/03/20 17:08:13 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -66,11 +66,7 @@
  *     Paul Vixie, 1996.
  */
 const char *
-inet_ntop(af, src, dst, size)
-       int af;
-       const void *src;
-       char *dst;
-       socklen_t size;
+inet_ntop(int af, const void *src, char *dst, socklen_t size)
 {
 
        _DIAGASSERT(src != NULL);
@@ -100,10 +96,7 @@
  *     Paul Vixie, 1996.
  */
 static const char *
-inet_ntop4(src, dst, size)
-       const u_char *src;
-       char *dst;
-       socklen_t size;
+inet_ntop4(const u_char *src, char *dst, socklen_t size)
 {
        char tmp[sizeof "255.255.255.255"];
        int l;
@@ -128,10 +121,7 @@
  *     Paul Vixie, 1996.
  */
 static const char *
-inet_ntop6(src, dst, size)
-       const u_char *src;
-       char *dst;
-       socklen_t size;
+inet_ntop6(const u_char *src, char *dst, socklen_t size)
 {
        /*
         * Note that int32_t and int16_t need only be "at least" large enough



Home | Main Index | Thread Index | Old Index