diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-06-17 14:34:12 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-06-17 14:34:12 +0000 |
commit | 93fa2e228c8792a5468e8d398b5bb6c290eecb73 (patch) | |
tree | c0ea5557fc5eeb30f54bbf940c06762e68e76895 /usr.bin/make/lst.lib/lstFindFrom.c | |
parent | 73501d656ca05164437c542734297118885750b9 (diff) |
This patch moves the definition of lists and list nodes to lst.h.
C is not well-suited for opaque data structures.
Then it proceeds by removing a lot of non-sensical casts and white space.
There are two motivations behind this change:
* small functions like Lst_First can now be redefined as macros safely
(otherwise, the cast would mean that you might write Lst_First(5) and
find out about it rather late)
* the size of the Lst data structure is exposed to user code. This will
be used to allocate lists statically, instead of malloc/free them like
crazy.
Diffstat (limited to 'usr.bin/make/lst.lib/lstFindFrom.c')
-rw-r--r-- | usr.bin/make/lst.lib/lstFindFrom.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index dc416e89340..e54c46ae6ce 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstFindFrom.c,v 1.7 2000/06/10 01:41:07 espie Exp $ */ +/* $OpenBSD: lstFindFrom.c,v 1.8 2000/06/17 14:34:07 espie Exp $ */ /* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.7 2000/06/10 01:41:07 espie Exp $"; +static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.8 2000/06/17 14:34:07 espie Exp $"; #endif #endif /* not lint */ @@ -72,10 +72,10 @@ Lst_FindFrom(ln, cProc, d) FindProc cProc; void *d; { - ListNode tln; + LstNode tln; - for (tln = (ListNode)ln; tln != NULL; tln = tln->nextPtr) + for (tln = ln; tln != NULL; tln = tln->nextPtr) if ((*cProc)(tln->datum, d) == 0) - return (LstNode)tln; + return tln; return NULL; } |