Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/yp Convert to use C89 prototypes.



details:   https://anonhg.NetBSD.org/src/rev/7932ca88b196
branches:  trunk
changeset: 778244:7932ca88b196
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 20 16:30:26 2012 +0000

description:
Convert to use C89 prototypes.
Remove use of __P

diffstat:

 lib/libc/yp/local.h    |   6 +++---
 lib/libc/yp/xdryp.c    |  12 ++++++------
 lib/libc/yp/yp_match.c |  34 ++++++++++------------------------
 lib/libc/yp/yplib.c    |  29 +++++++++++------------------
 4 files changed, 30 insertions(+), 51 deletions(-)

diffs (221 lines):

diff -r 2573868ee274 -r 7932ca88b196 lib/libc/yp/local.h
--- a/lib/libc/yp/local.h       Tue Mar 20 16:26:12 2012 +0000
+++ b/lib/libc/yp/local.h       Tue Mar 20 16:30:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: local.h,v 1.3 2009/10/21 01:07:46 snj Exp $    */
+/*     $NetBSD: local.h,v 1.4 2012/03/20 16:30:26 matt Exp $   */
 
 /*
  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
@@ -25,6 +25,6 @@
  */
 
 __BEGIN_DECLS
-void __yp_unbind __P((struct dom_binding *));
-int _yp_invalid_domain __P((const char *));
+void __yp_unbind(struct dom_binding *);
+int _yp_invalid_domain(const char *);
 __END_DECLS
diff -r 2573868ee274 -r 7932ca88b196 lib/libc/yp/xdryp.c
--- a/lib/libc/yp/xdryp.c       Tue Mar 20 16:26:12 2012 +0000
+++ b/lib/libc/yp/xdryp.c       Tue Mar 20 16:30:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xdryp.c,v 1.31 2012/03/13 21:13:49 christos Exp $      */
+/*     $NetBSD: xdryp.c,v 1.32 2012/03/20 16:30:26 matt Exp $  */
 
 /*
  * Copyright (c) 1996 Jason R. Thorpe <thorpej%NetBSD.org@localhost>.
@@ -61,7 +61,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: xdryp.c,v 1.31 2012/03/13 21:13:49 christos Exp $");
+__RCSID("$NetBSD: xdryp.c,v 1.32 2012/03/20 16:30:26 matt Exp $");
 #endif
 
 /*
@@ -115,10 +115,10 @@
 /*
  * Functions used only within this file.
  */
-static bool_t xdr_ypbind_binding __P((XDR *, struct ypbind_binding *));
-static bool_t xdr_ypbind_resptype __P((XDR *, enum ypbind_resptype *));
-static bool_t xdr_ypstat __P((XDR *, enum ypbind_resptype *));
-static bool_t xdr_ypmaplist_str __P((XDR *, char *));
+static bool_t xdr_ypbind_binding(XDR *, struct ypbind_binding *);
+static bool_t xdr_ypbind_resptype(XDR *, enum ypbind_resptype *);
+static bool_t xdr_ypstat(XDR *, enum ypbind_resptype *);
+static bool_t xdr_ypmaplist_str(XDR *, char *);
 
 __warn_references(xdr_domainname,
     "warning: this program uses xdr_domainname(), which is deprecated and buggy.")
diff -r 2573868ee274 -r 7932ca88b196 lib/libc/yp/yp_match.c
--- a/lib/libc/yp/yp_match.c    Tue Mar 20 16:26:12 2012 +0000
+++ b/lib/libc/yp/yp_match.c    Tue Mar 20 16:30:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yp_match.c,v 1.18 2012/03/02 17:27:49 christos Exp $    */
+/*     $NetBSD: yp_match.c,v 1.19 2012/03/20 16:30:26 matt Exp $        */
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt <deraadt%fsa.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: yp_match.c,v 1.18 2012/03/02 17:27:49 christos Exp $");
+__RCSID("$NetBSD: yp_match.c,v 1.19 2012/03/20 16:30:26 matt Exp $");
 #endif
 
 #include "namespace.h"
@@ -65,17 +65,12 @@
        time_t                   expire_t;
 } *ypmc;
 
-static bool_t ypmatch_add __P((const char *, const char *, int, char *, int));
-static bool_t ypmatch_find __P((const char *, const char *, int, const char **,
-    int *));
+static bool_t ypmatch_add(const char *, const char *, int, char *, int);
+static bool_t ypmatch_find(const char *, const char *, int, const char **,
+    int *);
 
 static bool_t
-ypmatch_add(map, key, keylen, val, vallen)
-       const char     *map;
-       const char     *key;
-       int             keylen;
-       char           *val;
-       int             vallen;
+ypmatch_add(const char *map, const char *key, int keylen, char *val, int vallen)
 {
        struct ypmatch_ent *ep;
        time_t t;
@@ -138,12 +133,8 @@
 }
 
 static bool_t
-ypmatch_find(map, key, keylen, val, vallen)
-       const char     *map;
-       const char     *key;
-       int             keylen;
-       const char    **val;
-       int            *vallen;
+ypmatch_find(const char *map, const char *key, int keylen, const char **val,
+       int *vallen)
 {
        struct ypmatch_ent *ep;
        time_t          t;
@@ -176,13 +167,8 @@
 #endif
 
 int
-yp_match(indomain, inmap, inkey, inkeylen, outval, outvallen)
-       const char     *indomain;
-       const char     *inmap;
-       const char     *inkey;
-       int             inkeylen;
-       char          **outval;
-       int            *outvallen;
+yp_match(const char *indomain, const char *inmap, const char *inkey,
+       int inkeylen, char **outval, int *outvallen)
 {
        struct dom_binding *ysd;
        struct ypresp_val yprv;
diff -r 2573868ee274 -r 7932ca88b196 lib/libc/yp/yplib.c
--- a/lib/libc/yp/yplib.c       Tue Mar 20 16:26:12 2012 +0000
+++ b/lib/libc/yp/yplib.c       Tue Mar 20 16:30:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yplib.c,v 1.44 2012/03/02 17:27:49 christos Exp $       */
+/*     $NetBSD: yplib.c,v 1.45 2012/03/20 16:30:26 matt Exp $   */
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt <deraadt%fsa.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: yplib.c,v 1.44 2012/03/02 17:27:49 christos Exp $");
+__RCSID("$NetBSD: yplib.c,v 1.45 2012/03/20 16:30:26 matt Exp $");
 #endif
 
 #include "namespace.h"
@@ -86,7 +86,8 @@
 #endif
 
 int
-yp_setbindtries(int ntries) {
+yp_setbindtries(int ntries)
+{
        int old_val = _yplib_bindtries;
 
        if (ntries >= 0)
@@ -95,9 +96,7 @@
 }
 
 int
-_yp_dobind(dom, ypdb)
-       const char     *dom;
-       struct dom_binding **ypdb;
+_yp_dobind(const char *dom, struct dom_binding **ypdb)
 {
        static int      pid = -1;
        char            path[MAXPATHLEN];
@@ -281,8 +280,7 @@
 }
 
 void
-__yp_unbind(ypb)
-       struct dom_binding *ypb;
+__yp_unbind(struct dom_binding *ypb)
 {
 
        _DIAGASSERT(ypb != NULL);
@@ -293,8 +291,7 @@
 }
 
 int
-yp_bind(dom)
-       const char     *dom;
+yp_bind(const char *dom)
 {
        if (_yp_invalid_domain(dom))
                return YPERR_BADARGS;
@@ -303,8 +300,7 @@
 }
 
 void
-yp_unbind(dom)
-       const char     *dom;
+yp_unbind(const char *dom)
 {
        struct dom_binding *ypb, *ypbp;
 
@@ -328,8 +324,7 @@
 }
 
 int
-yp_get_default_domain(domp)
-       char          **domp;
+yp_get_default_domain(char **domp)
 {
        if (domp == NULL)
                return YPERR_BADARGS;
@@ -342,8 +337,7 @@
 }
 
 int
-_yp_check(dom)
-       char          **dom;
+_yp_check(char **dom)
 {
        char           *unused;
        int             good;
@@ -369,8 +363,7 @@
  * returns non-zero if invalid
  */
 int
-_yp_invalid_domain(dom)
-       const char *dom;
+_yp_invalid_domain(const char *dom)
 {
        if (dom == NULL || *dom == '\0')
                return 1;



Home | Main Index | Thread Index | Old Index