summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.lib/lstDupl.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-06-17 14:38:23 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-06-17 14:38:23 +0000
commitecbebb6e3cb3428095eb28e7e03e6872e5d24a68 (patch)
tree25a3cb92a8ac766285ba464991f3a7d4d6f10cf4 /usr.bin/make/lst.lib/lstDupl.c
parent93fa2e228c8792a5468e8d398b5bb6c290eecb73 (diff)
This patch introduces a distinction between
Lst_Init (constructor) and Lst_New (allocation + construction) Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction), and uses that to turn most dynamic allocation of lists (Lst pointers) into static structures (LIST). Most of this is mundane, except for allGNs in targ.c, where the code must be checked to verify that Targ_Init is called soon enough. Lst_New is a temporary addition. All lists will soon be static. Reviewed by millert@, like the previous patch.
Diffstat (limited to 'usr.bin/make/lst.lib/lstDupl.c')
-rw-r--r--usr.bin/make/lst.lib/lstDupl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c
index 30a1e135d89..349c8657226 100644
--- a/usr.bin/make/lst.lib/lstDupl.c
+++ b/usr.bin/make/lst.lib/lstDupl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstDupl.c,v 1.10 2000/06/17 14:34:07 espie Exp $ */
+/* $OpenBSD: lstDupl.c,v 1.11 2000/06/17 14:38:22 espie Exp $ */
/* $NetBSD: lstDupl.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.10 2000/06/17 14:34:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.11 2000/06/17 14:38:22 espie Exp $";
#endif
#endif /* not lint */
@@ -74,11 +74,10 @@ Lst_Duplicate(l, copyProc)
Lst nl;
LstNode ln;
- if (!LstValid (l)) {
- return (NULL);
- }
+ if (!LstValid(l))
+ return NULL;
- nl = Lst_Init();
+ nl = Lst_New();
if (nl == NULL)
return NULL;
@@ -89,5 +88,5 @@ Lst_Duplicate(l, copyProc)
Lst_AtEnd(nl, ln->datum);
}
- return (nl);
+ return nl;
}