[Midnightbsd-cvs] src [10529] trunk/lib/libc/stdlib/twalk.c: update twalk

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 7 18:54:38 EDT 2018


Revision: 10529
          http://svnweb.midnightbsd.org/src/?rev=10529
Author:   laffer1
Date:     2018-06-07 18:54:38 -0400 (Thu, 07 Jun 2018)
Log Message:
-----------
update twalk

Modified Paths:
--------------
    trunk/lib/libc/stdlib/twalk.c

Modified: trunk/lib/libc/stdlib/twalk.c
===================================================================
--- trunk/lib/libc/stdlib/twalk.c	2018-06-07 22:53:14 UTC (rev 10528)
+++ trunk/lib/libc/stdlib/twalk.c	2018-06-07 22:54:38 UTC (rev 10529)
@@ -1,4 +1,4 @@
-/*	$NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos 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
@@ -14,24 +14,21 @@
 #include <sys/cdefs.h>
 #if 0
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $");
+__RCSID("$NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 #endif
-__FBSDID("$FreeBSD$");
+__MBSDID("$MidnightBSD$");
 
 #define _SEARCH_PRIVATE
 #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)
 {
 
 	if (root->llink == NULL && root->rlink == NULL)
@@ -49,9 +46,7 @@
 
 /* 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);



More information about the Midnightbsd-cvs mailing list