Source-Changes-HG archive

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

[src/trunk]: src/lib/libc Use C89 Prototypes.



details:   https://anonhg.NetBSD.org/src/rev/98666e922880
branches:  trunk
changeset: 778252:98666e922880
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 20 17:44:17 2012 +0000

description:
Use C89 Prototypes.
Remove use of __P

diffstat:

 lib/libc/isc/ev_timers.c         |    7 +-
 lib/libc/locale/current_locale.c |    6 +-
 lib/libc/net/ethers.c            |   23 ++----
 lib/libc/net/getnameinfo.c       |   73 ++++++++-------------
 lib/libc/net/getnetent.c         |   20 ++---
 lib/libc/net/hesiod.c            |   54 +++++----------
 lib/libc/net/ip6opt.c            |  129 ++++++++++++++++----------------------
 lib/libc/net/iso_addr.c          |   10 +-
 lib/libc/net/linkaddr.c          |    7 +-
 lib/libc/net/nslexer.l           |    6 +-
 lib/libc/net/nsparser.y          |    9 +-
 lib/libc/net/recv.c              |    9 +-
 lib/libc/net/send.c              |   10 +-
 lib/libc/net/sethostent.c        |   15 ++--
 lib/libc/net/sockatmark.c        |    7 +-
 lib/libc/nls/catopen.c           |   13 +--
 lib/libc/resolv/res_init.c       |   50 ++++++++------
 lib/libc/resolv/res_send.c       |   15 +--
 lib/libc/string/__strsignal.c    |    9 +-
 19 files changed, 198 insertions(+), 274 deletions(-)

diffs (truncated from 1447 to 300 lines):

diff -r 66110a6eb86f -r 98666e922880 lib/libc/isc/ev_timers.c
--- a/lib/libc/isc/ev_timers.c  Tue Mar 20 17:14:50 2012 +0000
+++ b/lib/libc/isc/ev_timers.c  Tue Mar 20 17:44:17 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ev_timers.c,v 1.9 2012/03/13 21:13:38 christos Exp $   */
+/*     $NetBSD: ev_timers.c,v 1.10 2012/03/20 17:44:17 matt Exp $      */
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -26,7 +26,7 @@
 #ifdef notdef
 static const char rcsid[] = "Id: ev_timers.c,v 1.6 2005/04/27 04:56:36 sra Exp";
 #else
-__RCSID("$NetBSD: ev_timers.c,v 1.9 2012/03/13 21:13:38 christos Exp $");
+__RCSID("$NetBSD: ev_timers.c,v 1.10 2012/03/20 17:44:17 matt Exp $");
 #endif
 #endif
 
@@ -120,7 +120,8 @@
 }
 
 struct timespec
-evNowTime() {
+evNowTime(void)
+{
        struct timeval now;
 #ifdef CLOCK_REALTIME
        struct timespec tsnow;
diff -r 66110a6eb86f -r 98666e922880 lib/libc/locale/current_locale.c
--- a/lib/libc/locale/current_locale.c  Tue Mar 20 17:14:50 2012 +0000
+++ b/lib/libc/locale/current_locale.c  Tue Mar 20 17:44:17 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: current_locale.c,v 1.2 2009/01/11 02:46:28 christos Exp $ */
+/* $NetBSD: current_locale.c,v 1.3 2012/03/20 17:44:18 matt Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: current_locale.c,v 1.2 2009/01/11 02:46:28 christos Exp $");
+__RCSID("$NetBSD: current_locale.c,v 1.3 2012/03/20 17:44:18 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/cdefs.h>
@@ -43,7 +43,7 @@
 static struct _locale_impl_t *__current_locale = &_global_locale;
 
 struct _locale_impl_t **
-_current_locale()
+_current_locale(void)
 {
        return &__current_locale;
 }
diff -r 66110a6eb86f -r 98666e922880 lib/libc/net/ethers.c
--- a/lib/libc/net/ethers.c     Tue Mar 20 17:14:50 2012 +0000
+++ b/lib/libc/net/ethers.c     Tue Mar 20 17:44:17 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ethers.c,v 1.22 2012/03/13 21:13:40 christos Exp $     */
+/*     $NetBSD: ethers.c,v 1.23 2012/03/20 17:44:18 matt Exp $ */
 
 /* 
  * ethers(3N) a la Sun.
@@ -9,7 +9,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ethers.c,v 1.22 2012/03/13 21:13:40 christos Exp $");
+__RCSID("$NetBSD: ethers.c,v 1.23 2012/03/20 17:44:18 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -44,8 +44,7 @@
 #endif
 
 char *
-ether_ntoa(e)
-       const struct ether_addr *e;
+ether_ntoa(const struct ether_addr *e)
 {
        static char a[18];
 
@@ -59,8 +58,7 @@
 }
 
 struct ether_addr *
-ether_aton(s)
-       const char *s;
+ether_aton(const char *s)
 {
        static struct ether_addr n;
        u_int i[6];
@@ -81,9 +79,7 @@
 }
 
 int
-ether_ntohost(hostname, e)
-       char *hostname;
-       const struct ether_addr *e;
+ether_ntohost(char *hostname, const struct ether_addr *e)
 {
        FILE *f; 
        char *p;
@@ -143,9 +139,7 @@
 }
 
 int
-ether_hostton(hostname, e)
-       const char *hostname;
-       struct ether_addr *e;
+ether_hostton(const char *hostname, struct ether_addr *e)
 {
        FILE *f;
        char *p;
@@ -197,10 +191,7 @@
 }
 
 int
-ether_line(l, e, hostname)
-       const char *l;
-       struct ether_addr *e;
-       char *hostname;
+ether_line(const char *l, struct ether_addr *e, char *hostname)
 {
        u_int i[6];
 
diff -r 66110a6eb86f -r 98666e922880 lib/libc/net/getnameinfo.c
--- a/lib/libc/net/getnameinfo.c        Tue Mar 20 17:14:50 2012 +0000
+++ b/lib/libc/net/getnameinfo.c        Tue Mar 20 17:44:17 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnameinfo.c,v 1.51 2012/03/13 21:13:41 christos Exp $        */
+/*     $NetBSD: getnameinfo.c,v 1.52 2012/03/20 17:44:18 matt Exp $    */
 /*     $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $    */
 
 /*
@@ -47,7 +47,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnameinfo.c,v 1.51 2012/03/13 21:13:41 christos Exp $");
+__RCSID("$NetBSD: getnameinfo.c,v 1.52 2012/03/20 17:44:18 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -95,32 +95,29 @@
        u_short si_port;
 };
 
-static int getnameinfo_inet __P((const struct sockaddr *, socklen_t, char *,
-    socklen_t, char *, socklen_t, int));
+static int getnameinfo_inet(const struct sockaddr *, socklen_t, char *,
+    socklen_t, char *, socklen_t, int);
 #ifdef INET6
-static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *,
-                                socklen_t, int));
-static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t,
-                                int));
+static int ip6_parsenumeric(const struct sockaddr *, const char *, char *,
+                                socklen_t, int);
+static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int);
 #endif
-static int getnameinfo_atalk __P((const struct sockaddr *, socklen_t, char *,
-    socklen_t, char *, socklen_t, int));
+static int getnameinfo_atalk(const struct sockaddr *, socklen_t, char *,
+    socklen_t, char *, socklen_t, int);
 
-static int getnameinfo_link __P((const struct sockaddr *, socklen_t, char *,
-    socklen_t, char *, socklen_t, int));
-static int hexname __P((const u_int8_t *, size_t, char *, socklen_t));
+static int getnameinfo_link(const struct sockaddr *, socklen_t, char *,
+    socklen_t, char *, socklen_t, int);
+static int hexname(const uint8_t *, size_t, char *, socklen_t);
 
 /*
  * Top-level getnameinfo() code.  Look at the address family, and pick an
  * appropriate function to call.
  */
 int
-getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
-       const struct sockaddr *sa;
-       socklen_t salen;
-       char *host, *serv;
-       socklen_t hostlen, servlen;
-       int flags;
+getnameinfo(const struct sockaddr *sa, socklen_t salen,
+       char *host, socklen_t hostlen,
+       char *serv, socklen_t servlen,
+       int flags)
 {
 
        switch (sa->sa_family) {
@@ -204,14 +201,10 @@
  * Format an IPv4 or IPv6 sockaddr into a printable string.
  */
 static int
-getnameinfo_inet(sa, salen, host, hostlen, serv, servlen, flags)
-       const struct sockaddr *sa;
-       socklen_t salen;
-       char *host;
-       socklen_t hostlen;
-       char *serv;
-       socklen_t servlen;
-       int flags;
+getnameinfo_inet(const struct sockaddr *sa, socklen_t salen,
+       char *host, socklen_t hostlen,
+       char *serv, socklen_t servlen,
+       int flags)
 {
        const struct afd *afd;
        struct servent *sp;
@@ -219,7 +212,7 @@
        u_short port;
        int family, i;
        const char *addr;
-       u_int32_t v4a;
+       uint32_t v4a;
        char numserv[512];
        char numaddr[512];
 
@@ -281,7 +274,7 @@
 
        switch (sa->sa_family) {
        case AF_INET:
-               v4a = (u_int32_t)
+               v4a = (uint32_t)
                    ntohl(((const struct sockaddr_in *)
                    (const void *)sa)->sin_addr.s_addr);
                if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
@@ -401,12 +394,8 @@
 
 #ifdef INET6
 static int
-ip6_parsenumeric(sa, addr, host, hostlen, flags)
-       const struct sockaddr *sa;
-       const char *addr;
-       char *host;
-       socklen_t hostlen;
-       int flags;
+ip6_parsenumeric(const struct sockaddr *sa, const char *addr, char *host,
+       socklen_t hostlen, int flags)
 {
        size_t numaddrlen;
        char numaddr[512];
@@ -447,11 +436,7 @@
 
 /* ARGSUSED */
 static int
-ip6_sa2str(sa6, buf, bufsiz, flags)
-       const struct sockaddr_in6 *sa6;
-       char *buf;
-       size_t bufsiz;
-       int flags;
+ip6_sa2str(const struct sockaddr_in6 *sa6, char *buf, size_t bufsiz, int flags)
 {
        unsigned int ifindex;
        const struct in6_addr *a6;
@@ -565,17 +550,13 @@
        case IFT_HIPPI:
        case IFT_ISO88025:
        default:
-               return hexname((const u_int8_t *)CLLADDR(sdl),
+               return hexname((const uint8_t *)CLLADDR(sdl),
                    (size_t)sdl->sdl_alen, host, hostlen);
        }
 }
 
 static int
-hexname(cp, len, host, hostlen)
-       const u_int8_t *cp;
-       char *host;
-       size_t len;
-       socklen_t hostlen;
+hexname(const uint8_t *cp, size_t len, char *host, socklen_t hostlen)
 {
        int n;
        size_t i;
diff -r 66110a6eb86f -r 98666e922880 lib/libc/net/getnetent.c
--- a/lib/libc/net/getnetent.c  Tue Mar 20 17:14:50 2012 +0000
+++ b/lib/libc/net/getnetent.c  Tue Mar 20 17:44:17 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnetent.c,v 1.20 2012/03/13 21:13:41 christos Exp $  */
+/*     $NetBSD: getnetent.c,v 1.21 2012/03/20 17:44:18 matt Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)getnetent.c        8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: getnetent.c,v 1.20 2012/03/13 21:13:41 christos Exp $");
+__RCSID("$NetBSD: getnetent.c,v 1.21 2012/03/20 17:44:18 matt Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -71,12 +71,11 @@
 static char *net_aliases[MAXALIASES];
 int _net_stayopen;
 
-static void __setnetent __P((int));



Home | Main Index | Thread Index | Old Index