Module Name: src Committed By: rillig Date: Fri Aug 21 02:20:48 UTC 2020
Modified Files: src/usr.bin/make: arch.c dir.c job.c lst.c lst.h main.c make.c meta.c parse.c suff.c targ.c Log Message: make(1): remove unused code for circular lists The list library had probably been imported from a general-purpose library that also supported circular lists. These are not used by make though. After replacing Lst_Init(FALSE) with Lst_Init(), only a single call to Lst_Init remained with a non-constant argument, and that was in Lst_Concat, which was to be expected. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/usr.bin/make/arch.c cvs rdiff -u -r1.92 -r1.93 src/usr.bin/make/dir.c src/usr.bin/make/meta.c cvs rdiff -u -r1.206 -r1.207 src/usr.bin/make/job.c cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/lst.c cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/lst.h cvs rdiff -u -r1.304 -r1.305 src/usr.bin/make/main.c cvs rdiff -u -r1.103 -r1.104 src/usr.bin/make/make.c cvs rdiff -u -r1.251 -r1.252 src/usr.bin/make/parse.c cvs rdiff -u -r1.96 -r1.97 src/usr.bin/make/suff.c cvs rdiff -u -r1.64 -r1.65 src/usr.bin/make/targ.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.83 src/usr.bin/make/arch.c:1.84 --- src/usr.bin/make/arch.c:1.83 Wed Aug 12 19:36:14 2020 +++ src/usr.bin/make/arch.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.83 2020/08/12 19:36:14 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.84 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.83 2020/08/12 19:36:14 rillig Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.84 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.83 2020/08/12 19:36:14 rillig Exp $"); +__RCSID("$NetBSD: arch.c,v 1.84 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -392,7 +392,7 @@ Arch_ParseArchive(char **linePtr, Lst no */ free(buf); } else if (Dir_HasWildcards(memName)) { - Lst members = Lst_Init(FALSE); + Lst members = Lst_Init(); char *member; size_t sz = MAXPATHLEN, nsz; nameBuf = bmake_malloc(sz); @@ -1305,7 +1305,7 @@ Arch_LibOODate(GNode *gn) void Arch_Init(void) { - archives = Lst_Init(FALSE); + archives = Lst_Init(); } Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.92 src/usr.bin/make/dir.c:1.93 --- src/usr.bin/make/dir.c:1.92 Thu Aug 13 03:33:56 2020 +++ src/usr.bin/make/dir.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.92 2020/08/13 03:33:56 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.93 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.92 2020/08/13 03:33:56 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.93 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.92 2020/08/13 03:33:56 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.93 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -367,8 +367,8 @@ void Dir_Init(const char *cdname) { if (!cdname) { - dirSearchPath = Lst_Init(FALSE); - openDirectories = Lst_Init(FALSE); + dirSearchPath = Lst_Init(); + openDirectories = Lst_Init(); Hash_InitTable(&mtimes, 0); Hash_InitTable(&lmtimes, 0); return; @@ -909,7 +909,7 @@ Dir_Expand(const char *word, Lst path, L char *dp = &dirpath[strlen(dirpath) - 1]; if (*dp == '/') *dp = '\0'; - path = Lst_Init(FALSE); + path = Lst_Init(); (void)Dir_AddDir(path, dirpath); DirExpandInt(cp + 1, path, expansions); Lst_Destroy(path, NULL); Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.92 src/usr.bin/make/meta.c:1.93 --- src/usr.bin/make/meta.c:1.92 Mon Aug 3 20:26:09 2020 +++ src/usr.bin/make/meta.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.92 2020/08/03 20:26:09 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.93 2020/08/21 02:20:47 rillig Exp $ */ /* * Implement 'meta' mode. @@ -625,7 +625,7 @@ meta_mode_init(const char *make_mode) /* * We consider ourselves master of all within ${.MAKE.META.BAILIWICK} */ - metaBailiwick = Lst_Init(FALSE); + metaBailiwick = Lst_Init(); metaBailiwickStr = Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}", VAR_GLOBAL, VARE_WANTRES); if (metaBailiwickStr) { @@ -634,7 +634,7 @@ meta_mode_init(const char *make_mode) /* * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS} */ - metaIgnorePaths = Lst_Init(FALSE); + metaIgnorePaths = Lst_Init(); Var_Append(MAKE_META_IGNORE_PATHS, "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL); metaIgnorePathsStr = Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}", @@ -1117,7 +1117,7 @@ meta_oodate(GNode *gn, Boolean oodate) goto oodate_out; dname = fname3; - missingFiles = Lst_Init(FALSE); + missingFiles = Lst_Init(); /* * We need to check if the target is out-of-date. This includes Index: src/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.206 src/usr.bin/make/job.c:1.207 --- src/usr.bin/make/job.c:1.206 Mon Aug 10 19:53:19 2020 +++ src/usr.bin/make/job.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.206 2020/08/10 19:53:19 rillig Exp $ */ +/* $NetBSD: job.c,v 1.207 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.206 2020/08/10 19:53:19 rillig Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.207 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.206 2020/08/10 19:53:19 rillig Exp $"); +__RCSID("$NetBSD: job.c,v 1.207 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -1971,7 +1971,7 @@ JobRun(GNode *targ) * and .INTERRUPT job in the parallel job module. This has * the nice side effect that it avoids a lot of other problems. */ - Lst lst = Lst_Init(FALSE); + Lst lst = Lst_Init(); Lst_AtEnd(lst, targ); (void)Make_Run(lst); Lst_Destroy(lst, NULL); Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.4 src/usr.bin/make/lst.c:1.5 --- src/usr.bin/make/lst.c:1.4 Sun Aug 9 20:49:15 2020 +++ src/usr.bin/make/lst.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.4 2020/08/09 20:49:15 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.5 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -36,11 +36,11 @@ #include "make_malloc.h" #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lst.c,v 1.4 2020/08/09 20:49:15 rillig Exp $"; +static char rcsid[] = "$NetBSD: lst.c,v 1.5 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: lst.c,v 1.4 2020/08/09 20:49:15 rillig Exp $"); +__RCSID("$NetBSD: lst.c,v 1.5 2020/08/21 02:20:47 rillig Exp $"); #endif /* not lint */ #endif @@ -65,8 +65,6 @@ typedef enum { typedef struct List { ListNode firstPtr; /* first node in list */ ListNode lastPtr; /* last node in list */ - Boolean isCirc; /* true if the list should be considered - * circular */ /* * fields for sequential access */ @@ -115,24 +113,9 @@ LstIsEmpty(Lst l) return l->firstPtr == NULL; } -/*- - *----------------------------------------------------------------------- - * Lst_Init -- - * Create and initialize a new list. - * - * Input: - * circ TRUE if the list should be made circular - * - * Results: - * The created list. - * - * Side Effects: - * A list is created, what else? - * - *----------------------------------------------------------------------- - */ +/* Create and initialize a new, empty list. */ Lst -Lst_Init(Boolean circ) +Lst_Init(void) { List nList; @@ -141,7 +124,6 @@ Lst_Init(Boolean circ) nList->firstPtr = NULL; nList->lastPtr = NULL; nList->isOpen = FALSE; - nList->isCirc = circ; nList->atEnd = Unknown; return nList; @@ -175,7 +157,7 @@ Lst_Duplicate(Lst l, DuplicateProc *copy return NULL; } - nl = Lst_Init(list->isCirc); + nl = Lst_Init(); if (nl == NULL) { return NULL; } @@ -190,11 +172,7 @@ Lst_Duplicate(Lst l, DuplicateProc *copy return NULL; } - if (list->isCirc && ln == list->lastPtr) { - ln = NULL; - } else { - ln = ln->nextPtr; - } + ln = ln->nextPtr; } return nl; @@ -297,11 +275,7 @@ Lst_InsertBefore(Lst l, LstNode ln, void nLNode->useCount = nLNode->flags = 0; if (ln == NULL) { - if (list->isCirc) { - nLNode->prevPtr = nLNode->nextPtr = nLNode; - } else { - nLNode->prevPtr = nLNode->nextPtr = NULL; - } + nLNode->prevPtr = nLNode->nextPtr = NULL; list->firstPtr = list->lastPtr = nLNode; } else { nLNode->prevPtr = lNode->prevPtr; @@ -365,11 +339,7 @@ Lst_InsertAfter(Lst l, LstNode ln, void nLNode->useCount = nLNode->flags = 0; if (lNode == NULL) { - if (list->isCirc) { - nLNode->nextPtr = nLNode->prevPtr = nLNode; - } else { - nLNode->nextPtr = nLNode->prevPtr = NULL; - } + nLNode->nextPtr = nLNode->prevPtr = NULL; list->firstPtr = list->lastPtr = nLNode; } else { nLNode->prevPtr = lNode; @@ -936,15 +906,6 @@ Lst_Concat(Lst l1, Lst l2, int flags) } list1->lastPtr = list2->lastPtr; } - if (list1->isCirc && list1->firstPtr != NULL) { - /* - * If the first list is supposed to be circular and it is (now) - * non-empty, we must make sure it's circular by linking the - * first element to the last and vice versa - */ - list1->firstPtr->prevPtr = list1->lastPtr; - list1->lastPtr->nextPtr = list1->firstPtr; - } free(l2); } else if (list2->firstPtr != NULL) { /* @@ -981,23 +942,7 @@ Lst_Concat(Lst l1, Lst l2, int flags) * of list one. */ list1->lastPtr = last; - - /* - * The circularity of both list one and list two must be corrected - * for -- list one because of the new nodes added to it; list two - * because of the alteration of list2->lastPtr's nextPtr to ease the - * above for loop. - */ - if (list1->isCirc) { - list1->lastPtr->nextPtr = list1->firstPtr; - list1->firstPtr->prevPtr = list1->lastPtr; - } else { - last->nextPtr = NULL; - } - - if (list2->isCirc) { - list2->lastPtr->nextPtr = list2->firstPtr; - } + last->nextPtr = NULL; } return SUCCESS; @@ -1109,34 +1054,6 @@ Lst_Next(Lst l) /*- *----------------------------------------------------------------------- - * Lst_IsAtEnd -- - * Return true if have reached the end of the given list. - * - * Results: - * TRUE if at the end of the list (this includes the list not being - * open or being invalid) or FALSE if not. We return TRUE if the list - * is invalid or unopend so as to cause the caller to exit its loop - * asap, the assumption being that the loop is of the form - * while (!Lst_IsAtEnd (l)) { - * ... - * } - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -Boolean -Lst_IsAtEnd(Lst l) -{ - List list = l; - - return !LstValid(l) || !list->isOpen || - list->atEnd == Head || list->atEnd == Tail; -} - -/*- - *----------------------------------------------------------------------- * Lst_Close -- * Close a list which was opened for sequential access. * Index: src/usr.bin/make/lst.h diff -u src/usr.bin/make/lst.h:1.21 src/usr.bin/make/lst.h:1.22 --- src/usr.bin/make/lst.h:1.21 Thu Aug 13 03:54:57 2020 +++ src/usr.bin/make/lst.h Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.h,v 1.21 2020/08/13 03:54:57 rillig Exp $ */ +/* $NetBSD: lst.h,v 1.22 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -102,7 +102,7 @@ typedef void FreeProc(void *); * Creation/destruction functions */ /* Create a new list */ -Lst Lst_Init(Boolean); +Lst Lst_Init(void); /* Duplicate an existing list */ Lst Lst_Duplicate(Lst, DuplicateProc *); /* Destroy an old one */ @@ -171,10 +171,8 @@ int Lst_ForEachFrom(Lst, LstNode, int ( */ /* Open the list */ ReturnStatus Lst_Open(Lst); -/* Next element please */ +/* Next element please, or NULL */ LstNode Lst_Next(Lst); -/* Done yet? */ -Boolean Lst_IsAtEnd(Lst); /* Finish table access */ void Lst_Close(Lst); Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.304 src/usr.bin/make/main.c:1.305 --- src/usr.bin/make/main.c:1.304 Tue Aug 11 18:52:03 2020 +++ src/usr.bin/make/main.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $ */ +/* $NetBSD: main.c,v 1.305 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.305 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $"); +__RCSID("$NetBSD: main.c,v 1.305 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -1082,11 +1082,11 @@ main(int argc, char **argv) VAR_GLOBAL); Var_Set(MAKE_DEPENDFILE, ".depend", VAR_GLOBAL); - create = Lst_Init(FALSE); - makefiles = Lst_Init(FALSE); + create = Lst_Init(); + makefiles = Lst_Init(); printVars = 0; debugVflag = FALSE; - variables = Lst_Init(FALSE); + variables = Lst_Init(); beSilent = FALSE; /* Print commands as executed */ ignoreErrors = FALSE; /* Pay attention to non-zero returns */ noExecute = FALSE; /* Execute all commands */ @@ -1328,7 +1328,7 @@ main(int argc, char **argv) if (!noBuiltins) { LstNode ln; - sysMkPath = Lst_Init(FALSE); + sysMkPath = Lst_Init(); Dir_Expand(_PATH_DEFSYSMK, Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath, sysMkPath); Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.103 src/usr.bin/make/make.c:1.104 --- src/usr.bin/make/make.c:1.103 Sat Aug 1 09:55:00 2020 +++ src/usr.bin/make/make.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.103 2020/08/01 09:55:00 rillig Exp $ */ +/* $NetBSD: make.c,v 1.104 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: make.c,v 1.103 2020/08/01 09:55:00 rillig Exp $"; +static char rcsid[] = "$NetBSD: make.c,v 1.104 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: make.c,v 1.103 2020/08/01 09:55:00 rillig Exp $"); +__RCSID("$NetBSD: make.c,v 1.104 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -1424,7 +1424,7 @@ Make_ProcessWait(Lst targs) /* Start building with the 'dummy' .MAIN' node */ MakeBuildChild(pgn, NULL); - examine = Lst_Init(FALSE); + examine = Lst_Init(); Lst_AtEnd(examine, pgn); while (!Lst_IsEmpty (examine)) { @@ -1493,7 +1493,7 @@ Make_Run(Lst targs) int errors; /* Number of errors the Job module reports */ /* Start trying to make the current targets... */ - toBeMade = Lst_Init(FALSE); + toBeMade = Lst_Init(); Make_ExpandUse(targs); Make_ProcessWait(targs); Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.251 src/usr.bin/make/parse.c:1.252 --- src/usr.bin/make/parse.c:1.251 Mon Aug 10 19:53:19 2020 +++ src/usr.bin/make/parse.c Fri Aug 21 02:20:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.251 2020/08/10 19:53:19 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.252 2020/08/21 02:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.251 2020/08/10 19:53:19 rillig Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.252 2020/08/21 02:20:47 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.251 2020/08/10 19:53:19 rillig Exp $"); +__RCSID("$NetBSD: parse.c,v 1.252 2020/08/21 02:20:47 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -1206,7 +1206,7 @@ ParseDoDependency(char *line) specType = Not; paths = NULL; - curTargs = Lst_Init(FALSE); + curTargs = Lst_Init(); /* * First, grind through the targets. @@ -1354,7 +1354,7 @@ ParseDoDependency(char *line) switch (specType) { case ExPath: if (paths == NULL) { - paths = Lst_Init(FALSE); + paths = Lst_Init(); } (void)Lst_AtEnd(paths, dirSearchPath); break; @@ -1412,7 +1412,7 @@ ParseDoDependency(char *line) goto out; } else { if (paths == NULL) { - paths = Lst_Init(FALSE); + paths = Lst_Init(); } (void)Lst_AtEnd(paths, path); } @@ -1431,7 +1431,7 @@ ParseDoDependency(char *line) * use Dir_Destroy in the destruction of the path as the * Dir module could have added a directory to the path... */ - Lst emptyPath = Lst_Init(FALSE); + Lst emptyPath = Lst_Init(); Dir_Expand(line, emptyPath, curTargs); @@ -1714,7 +1714,7 @@ ParseDoDependency(char *line) } if (*cp == LPAREN) { - sources = Lst_Init(FALSE); + sources = Lst_Init(); if (Arch_ParseArchive(&line, sources, VAR_CMD) != SUCCESS) { Parse_Error(PARSE_FATAL, "Error in source archive spec \"%s\"", line); @@ -3242,7 +3242,7 @@ Parse_File(const char *name, int fd) if (targets) Lst_Destroy(targets, NULL); - targets = Lst_Init(FALSE); + targets = Lst_Init(); inLine = TRUE; ParseDoDependency(line); @@ -3284,12 +3284,12 @@ void Parse_Init(void) { mainNode = NULL; - parseIncPath = Lst_Init(FALSE); - sysIncPath = Lst_Init(FALSE); - defIncPath = Lst_Init(FALSE); - includes = Lst_Init(FALSE); + parseIncPath = Lst_Init(); + sysIncPath = Lst_Init(); + defIncPath = Lst_Init(); + includes = Lst_Init(); #ifdef CLEANUP - targCmds = Lst_Init(FALSE); + targCmds = Lst_Init(); #endif } @@ -3327,7 +3327,7 @@ Parse_MainName(void) { Lst mainList; /* result list */ - mainList = Lst_Init(FALSE); + mainList = Lst_Init(); if (mainNode == NULL) { Punt("no target to make."); Index: src/usr.bin/make/suff.c diff -u src/usr.bin/make/suff.c:1.96 src/usr.bin/make/suff.c:1.97 --- src/usr.bin/make/suff.c:1.96 Tue Aug 11 18:44:52 2020 +++ src/usr.bin/make/suff.c Fri Aug 21 02:20:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $ */ +/* $NetBSD: suff.c,v 1.97 2020/08/21 02:20:48 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.97 2020/08/21 02:20:48 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $"); +__RCSID("$NetBSD: suff.c,v 1.97 2020/08/21 02:20:48 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -555,7 +555,7 @@ Suff_ClearSuffixes(void) #ifdef CLEANUP Lst_Concat(suffClean, sufflist, LST_CONCLINK); #endif - sufflist = Lst_Init(FALSE); + sufflist = Lst_Init(); sNum = 0; if (suffNull) SuffFree(suffNull); @@ -563,11 +563,11 @@ Suff_ClearSuffixes(void) suffNull->name = bmake_strdup(""); suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); + suffNull->searchPath = Lst_Init(); Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); + suffNull->children = Lst_Init(); + suffNull->parents = Lst_Init(); + suffNull->ref = Lst_Init(); suffNull->sNum = sNum++; suffNull->flags = SUFF_NULL; suffNull->refCount = 1; @@ -723,8 +723,8 @@ Suff_AddTransform(char *line) gn = (GNode *)Lst_Datum(ln); Lst_Destroy(gn->commands, NULL); Lst_Destroy(gn->children, NULL); - gn->commands = Lst_Init(FALSE); - gn->children = Lst_Init(FALSE); + gn->commands = Lst_Init(); + gn->children = Lst_Init(); } gn->type = OP_TRANSFORM; @@ -940,7 +940,7 @@ SuffScanTargets(void *targetp, void *gsp Targ_SetMain(NULL); } Lst_Destroy(target->children, NULL); - target->children = Lst_Init(FALSE); + target->children = Lst_Init(); target->type = OP_TRANSFORM; /* * link the two together in the proper relationship and order @@ -987,10 +987,10 @@ Suff_AddSuffix(char *str, GNode **gn) s->name = bmake_strdup(str); s->nameLen = strlen(s->name); - s->searchPath = Lst_Init(FALSE); - s->children = Lst_Init(FALSE); - s->parents = Lst_Init(FALSE); - s->ref = Lst_Init(FALSE); + s->searchPath = Lst_Init(); + s->children = Lst_Init(); + s->parents = Lst_Init(); + s->ref = Lst_Init(); s->sNum = sNum++; s->flags = 0; s->refCount = 1; @@ -1073,8 +1073,8 @@ Suff_DoPaths(void) return; } - inIncludes = Lst_Init(FALSE); - inLibs = Lst_Init(FALSE); + inIncludes = Lst_Init(); + inLibs = Lst_Init(); while ((ln = Lst_Next(sufflist)) != NULL) { s = (Suff *)Lst_Datum(ln); @@ -1217,7 +1217,7 @@ SuffAddSrc(void *sp, void *lsp) targ->children += 1; (void)Lst_AtEnd(ls->l, s2); #ifdef DEBUG_SRC - s2->cp = Lst_Init(FALSE); + s2->cp = Lst_Init(); Lst_AtEnd(targ->cp, s2); fprintf(debug_file, "1 add %p %p to %p:", targ, s2, ls->l); Lst_ForEach(ls->l, PrintAddr, NULL); @@ -1235,7 +1235,7 @@ SuffAddSrc(void *sp, void *lsp) targ->children += 1; (void)Lst_AtEnd(ls->l, s2); #ifdef DEBUG_SRC - s2->cp = Lst_Init(FALSE); + s2->cp = Lst_Init(); Lst_AtEnd(targ->cp, s2); fprintf(debug_file, "2 add %p %p to %p:", targ, s2, ls->l); Lst_ForEach(ls->l, PrintAddr, NULL); @@ -1500,7 +1500,7 @@ SuffFindCmds(Src *targ, Lst slst) ret->children = 0; targ->children += 1; #ifdef DEBUG_SRC - ret->cp = Lst_Init(FALSE); + ret->cp = Lst_Init(); fprintf(debug_file, "3 add %p %p\n", targ, ret); Lst_AtEnd(targ->cp, ret); #endif @@ -1563,7 +1563,7 @@ SuffExpandChildren(LstNode cln, GNode *p cp = Var_Subst(cgn->name, pgn, VARE_UNDEFERR|VARE_WANTRES); if (cp != NULL) { - Lst members = Lst_Init(FALSE); + Lst members = Lst_Init(); if (cgn->type & OP_ARCHV) { /* @@ -1692,7 +1692,7 @@ SuffExpandWildcards(LstNode cln, GNode * /* * Expand the word along the chosen path */ - explist = Lst_Init(FALSE); + explist = Lst_Init(); Dir_Expand(cgn->name, Suff_FindPath(cgn), explist); while (!Lst_IsEmpty(explist)) { @@ -2075,8 +2075,8 @@ SuffFindNormalDeps(GNode *gn, Lst slst) * Begin at the beginning... */ ln = Lst_First(sufflist); - srcs = Lst_Init(FALSE); - targs = Lst_Init(FALSE); + srcs = Lst_Init(); + targs = Lst_Init(); /* * We're caught in a catch-22 here. On the one hand, we want to use any @@ -2121,7 +2121,7 @@ SuffFindNormalDeps(GNode *gn, Lst slst) targ->parent = NULL; targ->children = 0; #ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); + targ->cp = Lst_Init(); #endif /* @@ -2168,7 +2168,7 @@ SuffFindNormalDeps(GNode *gn, Lst slst) targ->children = 0; targ->pref = bmake_strdup(sopref); #ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); + targ->cp = Lst_Init(); #endif /* @@ -2563,10 +2563,10 @@ void Suff_Init(void) { #ifdef CLEANUP - suffClean = Lst_Init(FALSE); + suffClean = Lst_Init(); #endif - srclist = Lst_Init(FALSE); - transforms = Lst_Init(FALSE); + srclist = Lst_Init(); + transforms = Lst_Init(); /* * Create null suffix for single-suffix rules (POSIX). The thing doesn't Index: src/usr.bin/make/targ.c diff -u src/usr.bin/make/targ.c:1.64 src/usr.bin/make/targ.c:1.65 --- src/usr.bin/make/targ.c:1.64 Mon Jul 20 18:12:48 2020 +++ src/usr.bin/make/targ.c Fri Aug 21 02:20:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.64 2020/07/20 18:12:48 sjg Exp $ */ +/* $NetBSD: targ.c,v 1.65 2020/08/21 02:20:48 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: targ.c,v 1.64 2020/07/20 18:12:48 sjg Exp $"; +static char rcsid[] = "$NetBSD: targ.c,v 1.65 2020/08/21 02:20:48 rillig Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: targ.c,v 1.64 2020/07/20 18:12:48 sjg Exp $"); +__RCSID("$NetBSD: targ.c,v 1.65 2020/08/21 02:20:48 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -167,7 +167,7 @@ static int TargPropagateNode(void *, voi void Targ_Init(void) { - allTargets = Lst_Init(FALSE); + allTargets = Lst_Init(); Hash_InitTable(&targets, HTSIZE); } @@ -258,21 +258,21 @@ Targ_NewGN(const char *name) gn->checked = 0; gn->mtime = 0; gn->cmgn = NULL; - gn->iParents = Lst_Init(FALSE); - gn->cohorts = Lst_Init(FALSE); - gn->parents = Lst_Init(FALSE); - gn->children = Lst_Init(FALSE); - gn->order_pred = Lst_Init(FALSE); - gn->order_succ = Lst_Init(FALSE); + gn->iParents = Lst_Init(); + gn->cohorts = Lst_Init(); + gn->parents = Lst_Init(); + gn->children = Lst_Init(); + gn->order_pred = Lst_Init(); + gn->order_succ = Lst_Init(); Hash_InitTable(&gn->context, 0); - gn->commands = Lst_Init(FALSE); + gn->commands = Lst_Init(); gn->suffix = NULL; gn->lineno = 0; gn->fname = NULL; #ifdef CLEANUP if (allGNs == NULL) - allGNs = Lst_Init(FALSE); + allGNs = Lst_Init(); Lst_AtEnd(allGNs, gn); #endif @@ -393,7 +393,7 @@ Targ_FindList(Lst names, int flags) GNode *gn; /* node in tLn */ char *name; - nodes = Lst_Init(FALSE); + nodes = Lst_Init(); if (Lst_Open(names) == FAILURE) { return nodes;