From ecbebb6e3cb3428095eb28e7e03e6872e5d24a68 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 17 Jun 2000 14:38:23 +0000 Subject: 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. --- usr.bin/make/lst.lib/lstDupl.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'usr.bin/make/lst.lib/lstDupl.c') 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; } -- cgit v1.2.3