summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2012-03-20 16:38:44 +0000
committermatt <matt@NetBSD.org>2012-03-20 16:38:44 +0000
commit8b2adf03d68747d8bff76190ea8ea3ea3ce54aa8 (patch)
treea64396b3b0d234fd9fc5039b131221ad47a13c47 /lib/libc/stdlib
parent4bcc9813383bdfbfd775bcd439711308e952ecc0 (diff)
Remove use of __P
Switch to using C89 definitions.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/lsearch.c10
-rw-r--r--lib/libc/stdlib/twalk.c17
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/libc/stdlib/lsearch.c b/lib/libc/stdlib/lsearch.c
index 45c60698248..23fe40071a6 100644
--- a/lib/libc/stdlib/lsearch.c
+++ b/lib/libc/stdlib/lsearch.c
@@ -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;
diff --git a/lib/libc/stdlib/twalk.c b/lib/libc/stdlib/twalk.c
index 1d061369016..0e239a18ea4 100644
--- a/lib/libc/stdlib/twalk.c
+++ b/lib/libc/stdlib/twalk.c
@@ -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/18 19:36:36 dsl Exp $");
#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);