Module Name: src
Committed By: rillig
Date: Sat Aug 29 10:41:13 UTC 2020
Modified Files:
src/usr.bin/make: dir.c job.c lst.c lst.h main.c meta.c suff.c
Log Message:
make(1): rename LstNode functions to match their type
To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/make/dir.c
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/job.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/make/lst.c
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/make/lst.h
cvs rdiff -u -r1.326 -r1.327 src/usr.bin/make/main.c
cvs rdiff -u -r1.109 -r1.110 src/usr.bin/make/meta.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/make/suff.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/dir.c
diff -u src/usr.bin/make/dir.c:1.122 src/usr.bin/make/dir.c:1.123
--- src/usr.bin/make/dir.c:1.122 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/dir.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.122 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.123 2020/08/29 10:41:12 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.122 2020/08/29 10:12:06 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.123 2020/08/29 10:41:12 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.122 2020/08/29 10:12:06 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.123 2020/08/29 10:41:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1747,7 +1747,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 = LstNode_Next(ln)) {
p = Lst_Datum(ln);
if (Lst_Member(path1, p) == NULL) {
p->refCount += 1;
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.222 src/usr.bin/make/job.c:1.223
--- src/usr.bin/make/job.c:1.222 Sat Aug 29 10:35:03 2020
+++ src/usr.bin/make/job.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.222 2020/08/29 10:35:03 rillig Exp $ */
+/* $NetBSD: job.c,v 1.223 2020/08/29 10:41:12 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.222 2020/08/29 10:35:03 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.223 2020/08/29 10:41:12 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.222 2020/08/29 10:35:03 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.223 2020/08/29 10:41:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -709,7 +709,7 @@ JobPrintCommand(void *cmdp, void *jobp)
job->node->type |= OP_SAVE_CMDS;
if ((job->flags & JOB_IGNDOTS) == 0) {
LstNode dotsNode = Lst_Member(job->node->commands, cmd);
- job->tailCmds = dotsNode != NULL ? Lst_Succ(dotsNode) : NULL;
+ job->tailCmds = dotsNode != NULL ? LstNode_Next(dotsNode) : NULL;
return 1;
}
return 0;
Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.55 src/usr.bin/make/lst.c:1.56
--- src/usr.bin/make/lst.c:1.55 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/lst.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.55 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 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.55 2020/08/29 10:12:06 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.55 2020/08/29 10:12:06 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 rillig Exp $");
#endif /* not lint */
#endif
@@ -338,7 +338,7 @@ Lst_Last(Lst list)
/* Return the successor to the given node on its list, or NULL. */
LstNode
-Lst_Succ(LstNode node)
+LstNode_Next(LstNode node)
{
assert(node != NULL);
@@ -347,7 +347,7 @@ Lst_Succ(LstNode node)
/* Return the predecessor to the given node on its list, or NULL. */
LstNode
-Lst_Prev(LstNode node)
+LstNode_Prev(LstNode node)
{
assert(node != NULL);
return node->prev;
@@ -387,7 +387,7 @@ Lst_Find(Lst list, LstFindProc match, co
* the match function returns TRUE, or NULL if none of the nodes matches.
*
* The start node may be NULL, in which case nothing is found. This allows
- * for passing Lst_First or Lst_Succ as the start node. */
+ * for passing Lst_First or LstNode_Next as the start node. */
LstNode
Lst_FindFrom(Lst list, LstNode node, LstFindProc match, const void *matchArgs)
{
Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.56 src/usr.bin/make/lst.h:1.57
--- src/usr.bin/make/lst.h:1.56 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/lst.h Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.56 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: lst.h,v 1.57 2020/08/29 10:41:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,9 +135,9 @@ LstNode Lst_First(Lst);
/* Return last element in list */
LstNode Lst_Last(Lst);
/* Return successor to given element */
-LstNode Lst_Succ(LstNode);
+LstNode LstNode_Next(LstNode);
/* Return predecessor to given element */
-LstNode Lst_Prev(LstNode);
+LstNode LstNode_Prev(LstNode);
/* Get datum from LstNode */
void *Lst_Datum(LstNode);
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.326 src/usr.bin/make/main.c:1.327
--- src/usr.bin/make/main.c:1.326 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/main.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.326 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: main.c,v 1.327 2020/08/29 10:41:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.326 2020/08/29 10:12:06 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.327 2020/08/29 10:41:12 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.326 2020/08/29 10:12:06 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.327 2020/08/29 10:41:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -873,7 +873,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 = LstNode_Next(ln)) {
char *var = Lst_Datum(ln);
const char *value;
char *p1;
@@ -1282,7 +1282,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 = LstNode_Next(ln)) {
char *name = Lst_Datum(ln);
Var_Append(".TARGETS", name, VAR_GLOBAL);
}
Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.109 src/usr.bin/make/meta.c:1.110
--- src/usr.bin/make/meta.c:1.109 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/meta.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.109 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: meta.c,v 1.110 2020/08/29 10:41:12 rillig Exp $ */
/*
* Implement 'meta' mode.
@@ -1324,8 +1324,9 @@ meta_oodate(GNode *gn, Boolean oodate)
char *tp;
do {
- nln = Lst_FindFrom(missingFiles, Lst_Succ(ln),
- path_match, p);
+ nln = Lst_FindFrom(missingFiles,
+ LstNode_Next(ln),
+ path_match, p);
tp = Lst_Datum(ln);
Lst_Remove(missingFiles, ln);
free(tp);
@@ -1557,7 +1558,7 @@ meta_oodate(GNode *gn, Boolean oodate)
oodate = TRUE;
}
free(cmd);
- ln = Lst_Succ(ln);
+ ln = LstNode_Next(ln);
}
} else if (strcmp(buf, "CWD") == 0) {
/*
Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.130 src/usr.bin/make/suff.c:1.131
--- src/usr.bin/make/suff.c:1.130 Sat Aug 29 10:12:06 2020
+++ src/usr.bin/make/suff.c Sat Aug 29 10:41:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.130 2020/08/29 10:12:06 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.131 2020/08/29 10:41:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.130 2020/08/29 10:12:06 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.131 2020/08/29 10:41:12 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.130 2020/08/29 10:12:06 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.131 2020/08/29 10:41:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -548,7 +548,7 @@ SuffParseTransform(char *str, Suff **src
if (srcLn == NULL) {
srcLn = Lst_Find(sufflist, SuffSuffIsPrefix, str);
} else {
- srcLn = Lst_FindFrom(sufflist, Lst_Succ(srcLn),
+ srcLn = Lst_FindFrom(sufflist, LstNode_Next(srcLn),
SuffSuffIsPrefix, str);
}
if (srcLn == NULL) {
@@ -1576,7 +1576,7 @@ SuffExpandChildren(LstNode cln, GNode *p
Lst_Append(gn->parents, pgn);
pgn->unmade++;
/* Expand wildcards on new node */
- SuffExpandWildcards(Lst_Prev(cln), pgn);
+ SuffExpandWildcards(LstNode_Prev(cln), pgn);
}
Lst_Free(members);
@@ -1773,8 +1773,8 @@ SuffApplyTransform(GNode *tGn, GNode *sG
/*
* Deal with wildcards and variables in any acquired sources
*/
- for (ln = ln != NULL ? Lst_Succ(ln) : NULL; ln != NULL; ln = nln) {
- nln = Lst_Succ(ln);
+ for (ln = ln != NULL ? LstNode_Next(ln) : NULL; ln != NULL; ln = nln) {
+ nln = LstNode_Next(ln);
SuffExpandChildren(ln, tGn);
}
@@ -1889,7 +1889,7 @@ SuffFindArchiveDeps(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 = LstNode_Next(ln);
SuffExpandChildren(ln, gn);
}
@@ -2059,7 +2059,7 @@ SuffFindNormalDeps(GNode *gn, Lst slst)
/*
* Search from this suffix's successor...
*/
- ln = Lst_Succ(ln);
+ ln = LstNode_Next(ln);
}
}
@@ -2138,7 +2138,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 = LstNode_Next(ln);
SuffExpandChildren(ln, gn);
}