summaryrefslogtreecommitdiff
path: root/devel/bmake/files/lst.lib/lstFindFrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'devel/bmake/files/lst.lib/lstFindFrom.c')
-rw-r--r--devel/bmake/files/lst.lib/lstFindFrom.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/devel/bmake/files/lst.lib/lstFindFrom.c b/devel/bmake/files/lst.lib/lstFindFrom.c
index 70b8ff0df51..3e076874dbd 100644
--- a/devel/bmake/files/lst.lib/lstFindFrom.c
+++ b/devel/bmake/files/lst.lib/lstFindFrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
* determine when it has been found.
*
* Results:
- * The found node or NILLNODE
+ * The found node or NULL
*
* Side Effects:
* None.
@@ -68,31 +68,23 @@ __RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
LstNode
-Lst_FindFrom(Lst l, LstNode ln, ClientData d,
- int (*cProc)(ClientData, ClientData))
+Lst_FindFrom(Lst l, LstNode ln, const void *d,
+ int (*cProc)(const void *, const void *))
{
ListNode tln;
- Boolean found = FALSE;
if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) {
- return (NILLNODE);
+ return NULL;
}
tln = ln;
do {
- if ((*cProc) (tln->datum, d) == 0) {
- found = TRUE;
- break;
- } else {
- tln = tln->nextPtr;
- }
- } while (tln != ln && tln != NilListNode);
+ if ((*cProc)(tln->datum, d) == 0)
+ return (tln);
+ tln = tln->nextPtr;
+ } while (tln != ln && tln != NULL);
- if (found) {
- return (tln);
- } else {
- return (NILLNODE);
- }
+ return NULL;
}