diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 09eebbc0f0dd..666eeeea3182 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.113 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.114 2020/08/27 07:00:29 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.113 2020/08/27 06:53:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.114 2020/08/27 07:00:29 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.113 2020/08/27 06:53:57 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.114 2020/08/27 07:00:29 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -1764,7 +1764,7 @@ Dir_Concat(Lst path1, Lst path2) LstNode ln; Path *p; - for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { + for (ln = Lst_First(path2); ln != NULL; ln = Lst_SuccS(ln)) { p = Lst_DatumS(ln); if (Lst_MemberS(path1, p) == NULL) { p->refCount += 1; diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 6310dbd1db20..f624049942ec 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.217 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: job.c,v 1.218 2020/08/27 07:00:29 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.217 2020/08/27 06:53:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.218 2020/08/27 07:00:29 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.217 2020/08/27 06:53:57 rillig Exp $"); +__RCSID("$NetBSD: job.c,v 1.218 2020/08/27 07:00:29 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -711,7 +711,7 @@ JobPrintCommand(void *cmdp, void *jobp) job->node->type |= OP_SAVE_CMDS; if ((job->flags & JOB_IGNDOTS) == 0) { LstNode dotsNode = Lst_MemberS(job->node->commands, cmd); - job->tailCmds = Lst_Succ(dotsNode); + job->tailCmds = dotsNode != NULL ? Lst_SuccS(dotsNode) : NULL; return 1; } return 0; diff --git a/usr.bin/make/lst.c b/usr.bin/make/lst.c index 5253dc58074b..31b957a0750d 100644 --- a/usr.bin/make/lst.c +++ b/usr.bin/make/lst.c @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.44 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -37,11 +37,11 @@ #include "make.h" #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lst.c,v 1.44 2020/08/27 06:53:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $"; #else #include #ifndef lint -__RCSID("$NetBSD: lst.c,v 1.44 2020/08/27 06:53:57 rillig Exp $"); +__RCSID("$NetBSD: lst.c,v 1.45 2020/08/27 07:00:29 rillig Exp $"); #endif /* not lint */ #endif @@ -372,17 +372,6 @@ Lst_LastS(Lst list) return list->last; } -/* Return the successor to the given node on its list, or NULL. */ -LstNode -Lst_Succ(LstNode node) -{ - if (node == NULL) { - return NULL; - } else { - return node->next; - } -} - /* Return the successor to the given node on its list, or NULL. */ LstNode Lst_SuccS(LstNode node) diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index fbd965282576..e2d4eeeb72f2 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,4 +1,4 @@ -/* $NetBSD: lst.h,v 1.47 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: lst.h,v 1.48 2020/08/27 07:00:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -138,7 +138,6 @@ LstNode Lst_FirstS(Lst); LstNode Lst_Last(Lst); LstNode Lst_LastS(Lst); /* Return successor to given element */ -LstNode Lst_Succ(LstNode); LstNode Lst_SuccS(LstNode); /* Return predecessor to given element */ LstNode Lst_PrevS(LstNode); diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index dcb8c7f902b9..f870c2c3f982 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.315 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: main.c,v 1.316 2020/08/27 07:00:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.315 2020/08/27 06:53:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.316 2020/08/27 07:00:29 rillig Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.315 2020/08/27 06:53:57 rillig Exp $"); +__RCSID("$NetBSD: main.c,v 1.316 2020/08/27 07:00:29 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -869,8 +869,7 @@ doPrintVars(void) else expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); - for (ln = Lst_First(variables); ln != NULL; - ln = Lst_Succ(ln)) { + for (ln = Lst_First(variables); ln != NULL; ln = Lst_SuccS(ln)) { char *var = Lst_DatumS(ln); const char *value; char *p1; @@ -1279,7 +1278,7 @@ main(int argc, char **argv) if (!Lst_IsEmpty(create)) { LstNode ln; - for (ln = Lst_First(create); ln != NULL; ln = Lst_Succ(ln)) { + for (ln = Lst_First(create); ln != NULL; ln = Lst_SuccS(ln)) { char *name = Lst_DatumS(ln); Var_Append(".TARGETS", name, VAR_GLOBAL); } diff --git a/usr.bin/make/meta.c b/usr.bin/make/meta.c index 1fa9983c002b..c4421647e43f 100644 --- a/usr.bin/make/meta.c +++ b/usr.bin/make/meta.c @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.101 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.102 2020/08/27 07:00:29 rillig Exp $ */ /* * Implement 'meta' mode. @@ -1340,7 +1340,7 @@ meta_oodate(GNode *gn, Boolean oodate) char *tp; do { - nln = Lst_FindFrom(missingFiles, Lst_Succ(ln), + nln = Lst_FindFrom(missingFiles, Lst_SuccS(ln), path_match, p); tp = Lst_DatumS(ln); Lst_RemoveS(missingFiles, ln); @@ -1573,7 +1573,7 @@ meta_oodate(GNode *gn, Boolean oodate) oodate = TRUE; } free(cmd); - ln = Lst_Succ(ln); + ln = Lst_SuccS(ln); } } else if (strcmp(buf, "CWD") == 0) { /* diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 302b8e74ccc3..ae345fe037cd 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.118 2020/08/27 06:53:57 rillig Exp $ */ +/* $NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.118 2020/08/27 06:53:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.118 2020/08/27 06:53:57 rillig Exp $"); +__RCSID("$NetBSD: suff.c,v 1.119 2020/08/27 07:00:29 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -621,7 +621,7 @@ SuffParseTransform(char *str, Suff **srcPtr, Suff **targPtr) if (srcLn == NULL) { srcLn = Lst_FindS(sufflist, SuffSuffIsPrefix, str); } else { - srcLn = Lst_FindFrom(sufflist, Lst_Succ(srcLn), + srcLn = Lst_FindFrom(sufflist, Lst_SuccS(srcLn), SuffSuffIsPrefix, str); } if (srcLn == NULL) { @@ -1846,8 +1846,8 @@ SuffApplyTransform(GNode *tGn, GNode *sGn, Suff *t, Suff *s) /* * Deal with wildcards and variables in any acquired sources */ - for (ln = Lst_Succ(ln); ln != NULL; ln = nln) { - nln = Lst_Succ(ln); + for (ln = ln != NULL ? Lst_SuccS(ln) : NULL; ln != NULL; ln = nln) { + nln = Lst_SuccS(ln); SuffExpandChildren(ln, tGn); } @@ -2132,7 +2132,7 @@ SuffFindNormalDeps(GNode *gn, Lst slst) /* * Search from this suffix's successor... */ - ln = Lst_Succ(ln); + ln = Lst_SuccS(ln); } } @@ -2211,7 +2211,7 @@ SuffFindNormalDeps(GNode *gn, Lst slst) * that still contain variables or wildcards in their names. */ for (ln = Lst_First(gn->children); ln != NULL; ln = nln) { - nln = Lst_Succ(ln); + nln = Lst_SuccS(ln); SuffExpandChildren(ln, gn); }