Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/compat Switch to C89 definitions.



details:   https://anonhg.NetBSD.org/src/rev/b70292150a7c
branches:  trunk
changeset: 778247:b70292150a7c
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 20 17:05:59 2012 +0000

description:
Switch to C89 definitions.
Remove use of __P

diffstat:

 lib/libc/compat/gen/compat_getmntinfo.c    |   8 +++-----
 lib/libc/compat/gen/compat_sigsetops.c     |  22 +++++++---------------
 lib/libc/compat/gen/compat_timezone.c      |   8 +++-----
 lib/libc/compat/net/compat_ns_addr.c       |  28 ++++++++++------------------
 lib/libc/compat/net/compat_ns_ntoa.c       |  20 +++++++++-----------
 lib/libc/compat/sys/compat_getdirentries.c |   9 +++------
 lib/libc/compat/sys/compat_msync.c         |   8 +++-----
 lib/libc/compat/sys/compat_sigaltstack.c   |   8 +++-----
 8 files changed, 41 insertions(+), 70 deletions(-)

diffs (truncated from 347 to 300 lines):

diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/gen/compat_getmntinfo.c
--- a/lib/libc/compat/gen/compat_getmntinfo.c   Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/gen/compat_getmntinfo.c   Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_getmntinfo.c,v 1.1 2005/09/13 01:44:09 christos Exp $   */
+/*     $NetBSD: compat_getmntinfo.c,v 1.2 2012/03/20 17:05:59 matt Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getmntinfo.c       8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: compat_getmntinfo.c,v 1.1 2005/09/13 01:44:09 christos Exp $");
+__RCSID("$NetBSD: compat_getmntinfo.c,v 1.2 2012/03/20 17:05:59 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -58,9 +58,7 @@
  * Return information about mounted filesystems.
  */
 int
-getmntinfo(mntbufp, flags)
-       struct statfs12 **mntbufp;
-       int flags;
+getmntinfo(struct statfs12 **mntbufp, int flags)
 {
        static struct statfs12 *mntbuf;
        static int mntsize;
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/gen/compat_sigsetops.c
--- a/lib/libc/compat/gen/compat_sigsetops.c    Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/gen/compat_sigsetops.c    Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_sigsetops.c,v 1.2 2009/01/11 02:46:25 christos Exp $    */
+/*     $NetBSD: compat_sigsetops.c,v 1.3 2012/03/20 17:05:59 matt Exp $        */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)sigsetops.c        8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: compat_sigsetops.c,v 1.2 2009/01/11 02:46:25 christos Exp $");
+__RCSID("$NetBSD: compat_sigsetops.c,v 1.3 2012/03/20 17:05:59 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -66,25 +66,21 @@
     "warning: reference to compatibility sigismember(); include <signal.h> for correct reference")
 
 int
-sigemptyset(set)
-       sigset13_t *set;
+sigemptyset(sigset13_t *set)
 {
        *set = 0;
        return (0);
 }
 
 int
-sigfillset(set)
-       sigset13_t *set;
+sigfillset(sigset13_t *set)
 {
        *set = ~(sigset13_t)0;
        return (0);
 }
 
 int
-sigaddset(set, signo)
-       sigset13_t *set;
-       int signo;
+sigaddset(sigset13_t *set, int signo)
 {
        if (signo <= 0 || signo >= NSIG13) {
                errno = EINVAL;
@@ -95,9 +91,7 @@
 }
 
 int
-sigdelset(set, signo)
-       sigset13_t *set;
-       int signo;
+sigdelset(sigset13_t *set, int signo)
 {
        if (signo <= 0 || signo >= NSIG13) {
                errno = EINVAL;
@@ -108,9 +102,7 @@
 }
 
 int
-sigismember(set, signo)
-       const sigset13_t *set;
-       int signo;
+sigismember(const sigset13_t *set, int signo)
 {
        if (signo <= 0 || signo >= NSIG13) {
                errno = EINVAL;
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/gen/compat_timezone.c
--- a/lib/libc/compat/gen/compat_timezone.c     Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/gen/compat_timezone.c     Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_timezone.c,v 1.3 2009/01/11 02:46:25 christos Exp $     */
+/*     $NetBSD: compat_timezone.c,v 1.4 2012/03/20 17:05:59 matt Exp $ */
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)timezone.c 8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: compat_timezone.c,v 1.3 2009/01/11 02:46:25 christos Exp $");
+__RCSID("$NetBSD: compat_timezone.c,v 1.4 2012/03/20 17:05:59 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -116,9 +116,7 @@
  *     STANDARD LIBRARY.
  */
 char *
-_tztab(zone,dst)
-       int     zone;
-       int     dst;
+_tztab(int zone, int dst)
 {
        const struct zone       *zp;
        char    sign;
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/net/compat_ns_addr.c
--- a/lib/libc/compat/net/compat_ns_addr.c      Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/net/compat_ns_addr.c      Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_ns_addr.c,v 1.1 2006/08/26 16:07:01 matt Exp $  */
+/*     $NetBSD: compat_ns_addr.c,v 1.2 2012/03/20 17:05:59 matt Exp $  */
 
 /*
  * Copyright (c) 1986, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)ns_addr.c  8.1 (Berkeley) 6/7/93";
 #else
-__RCSID("$NetBSD: compat_ns_addr.c,v 1.1 2006/08/26 16:07:01 matt Exp $");
+__RCSID("$NetBSD: compat_ns_addr.c,v 1.2 2012/03/20 17:05:59 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -49,12 +49,11 @@
 #include <stdio.h>
 #include <string.h>
 
-static void Field __P((char *, u_int8_t *, int));
-static void cvtbase __P((long, int, int[], int, u_int8_t[], int));
+static void Field(char *, uint8_t *, int);
+static void cvtbase(long, int, int[], int, uint8_t [], int);
 
 struct ns_addr 
-ns_addr(name)
-       const char *name;
+ns_addr(const char *name)
 {
        char separator;
        char *hostname, *socketname, *cp;
@@ -93,7 +92,7 @@
        socketname = strchr(hostname, separator);
        if (socketname) {
                *socketname++ = 0;
-               Field(socketname, (u_int8_t *)(void *)&addr.x_port, 2);
+               Field(socketname, (uint8_t *)(void *)&addr.x_port, 2);
        }
 
        Field(hostname, addr.x_host.c_host, 6);
@@ -102,10 +101,7 @@
 }
 
 static void
-Field(buf, out, len)
-       char *buf;
-       u_int8_t *out;
-       int len;
+Field(char *buf, uint8_t *out, int len)
 {
        register char *bp = buf;
        int i, ibase, base16 = 0, base10 = 0, clen = 0;
@@ -218,19 +214,15 @@
 }
 
 static void
-cvtbase(oldbase,newbase,input,inlen,result,reslen)
-       long oldbase;
-       int newbase;
-       int input[];
-       int inlen;
-       unsigned char result[];
-       int reslen;
+cvtbase(long oldbase, int newbase, int input[], int inlen,
+       uint8_t result[], int reslen)
 {
        int d, e;
        long sum;
 
        _DIAGASSERT(input != NULL);
        _DIAGASSERT(result != NULL);
+       _DIAGASSERT(inlen > 0);
 
        e = 1;
        while (e > 0 && reslen > 0) {
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/net/compat_ns_ntoa.c
--- a/lib/libc/compat/net/compat_ns_ntoa.c      Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/net/compat_ns_ntoa.c      Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_ns_ntoa.c,v 1.1 2006/08/26 16:07:01 matt Exp $  */
+/*     $NetBSD: compat_ns_ntoa.c,v 1.2 2012/03/20 17:05:59 matt Exp $  */
 
 /*
  * Copyright (c) 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)ns_ntoa.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: compat_ns_ntoa.c,v 1.1 2006/08/26 16:07:01 matt Exp $");
+__RCSID("$NetBSD: compat_ns_ntoa.c,v 1.2 2012/03/20 17:05:59 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -44,19 +44,18 @@
 #include <assert.h>
 #include <stdio.h>
 
-static char *spectHex __P((char *));
+static char *spectHex(char *);
 
 char *
-ns_ntoa(addr)
-       struct ns_addr addr;
+ns_ntoa(struct ns_addr addr)
 {
        static char obuf[40];
-       union { union ns_net net_e; u_int32_t long_e; } net;
-       u_int16_t port = htons(addr.x_port);
+       union { union ns_net net_e; uint32_t long_e; } net;
+       uint16_t port = htons(addr.x_port);
        char *cp;
        char *cp2;
-       u_int8_t *up = addr.x_host.c_host;
-       u_int8_t *uplim = up + 6;
+       uint8_t *up = addr.x_host.c_host;
+       uint8_t *uplim = up + 6;
 
        net.net_e = addr.x_net;
        sprintf(obuf, "%x", ntohl(net.long_e));
@@ -85,8 +84,7 @@
 }
 
 static char *
-spectHex(p0)
-       char *p0;
+spectHex(char *p0)
 {
        int ok = 0;
        int nonzero = 0;
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/sys/compat_getdirentries.c
--- a/lib/libc/compat/sys/compat_getdirentries.c        Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/sys/compat_getdirentries.c        Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_getdirentries.c,v 1.2 2009/02/22 06:33:38 dholland Exp $        */
+/*     $NetBSD: compat_getdirentries.c,v 1.3 2012/03/20 17:06:00 matt Exp $    */
 
 /*
  * Copyright (c) 1997 Frank van der Linden
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_getdirentries.c,v 1.2 2009/02/22 06:33:38 dholland Exp $");
+__RCSID("$NetBSD: compat_getdirentries.c,v 1.3 2012/03/20 17:06:00 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #define __LIBC12_SOURCE__
@@ -48,10 +48,7 @@
     "reference to compatibility-only getdirentries(); this will break; use getdents() or readdir() instead")
 
 int
-getdirentries(fd, buf, nbytes, basep)
-       int fd, nbytes;
-       char *buf;
-       long *basep;
+getdirentries(int fd, char *buf, int nbytes, long *basep)
 {
        *basep = (long)lseek(fd, (off_t)0, SEEK_CUR);
        return getdents(fd, buf, (size_t)nbytes);
diff -r b2781b8623e0 -r b70292150a7c lib/libc/compat/sys/compat_msync.c
--- a/lib/libc/compat/sys/compat_msync.c        Tue Mar 20 16:38:44 2012 +0000
+++ b/lib/libc/compat/sys/compat_msync.c        Tue Mar 20 17:05:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_msync.c,v 1.1 2005/09/13 01:44:09 christos Exp $        */
+/*     $NetBSD: compat_msync.c,v 1.2 2012/03/20 17:06:00 matt Exp $    */
 
 /*
  * Copyright (c) 1997 Frank van der Linden
@@ -33,7 +33,7 @@
 



Home | Main Index | Thread Index | Old Index