Module Name: src Committed By: matt Date: Tue Mar 20 16:38:45 UTC 2012
Modified Files: src/lib/libc/stdlib: lsearch.c twalk.c Log Message: Remove use of __P Switch to using C89 definitions. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/stdlib/lsearch.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/stdlib/twalk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/stdlib/lsearch.c diff -u src/lib/libc/stdlib/lsearch.c:1.5 src/lib/libc/stdlib/lsearch.c:1.6 --- src/lib/libc/stdlib/lsearch.c:1.5 Wed May 18 19:36:36 2011 +++ src/lib/libc/stdlib/lsearch.c Tue Mar 20 16:38:44 2012 @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: lsearch.c,v 1.5 2011/05/18 19:36:36 dsl Exp $"); +__RCSID("$NetBSD: lsearch.c,v 1.6 2012/03/20 16:38:44 matt Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -80,12 +80,8 @@ lfind(key, base, nelp, width, compar) } static void * -linear_base(key, base, nelp, width, compar, add_flag) - const void *key; - void *base; - size_t *nelp, width; - cmp_fn_t compar; - int add_flag; +linear_base(const void *key, void *base, size_t *nelp, size_t width, + cmp_fn_t compar, int add_flag) { char *element, *end; Index: src/lib/libc/stdlib/twalk.c diff -u src/lib/libc/stdlib/twalk.c:1.3 src/lib/libc/stdlib/twalk.c:1.4 --- src/lib/libc/stdlib/twalk.c:1.3 Wed May 18 19:36:36 2011 +++ src/lib/libc/stdlib/twalk.c Tue Mar 20 16:38:45 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: twalk.c,v 1.3 2011/05/18 19:36:36 dsl Exp $ */ +/* $NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -13,7 +13,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: twalk.c,v 1.3 2011/05/18 19:36:36 dsl Exp $"); +__RCSID("$NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $"); #endif /* LIBC_SCCS and not lint */ #include <assert.h> @@ -21,15 +21,12 @@ __RCSID("$NetBSD: twalk.c,v 1.3 2011/05/ #include <search.h> #include <stdlib.h> -static void trecurse(const node_t *, - void (*action)(const void *, VISIT, int), int level); +typedef void (*cmp_fn_t)(const void *, VISIT, int); /* Walk the nodes of a tree */ static void -trecurse(root, action, level) - const node_t *root; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); - int level; +trecurse(const node_t *root, /* Root of the tree to be walked */ + cmp_fn_t action, int level) { _DIAGASSERT(root != NULL); _DIAGASSERT(action != NULL); @@ -49,9 +46,7 @@ trecurse(root, action, level) /* Walk the nodes of a tree */ void -twalk(vroot, action) - const void *vroot; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); +twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */ { if (vroot != NULL && action != NULL) trecurse(vroot, action, 0);