Sat Aug 29 10:41:13 2020 UTC ()
make(1): rename LstNode functions to match their type
(rillig)
diff -r1.122 -r1.123 src/usr.bin/make/dir.c
diff -r1.222 -r1.223 src/usr.bin/make/job.c
diff -r1.55 -r1.56 src/usr.bin/make/lst.c
diff -r1.56 -r1.57 src/usr.bin/make/lst.h
diff -r1.326 -r1.327 src/usr.bin/make/main.c
diff -r1.109 -r1.110 src/usr.bin/make/meta.c
diff -r1.130 -r1.131 src/usr.bin/make/suff.c
--- src/usr.bin/make/dir.c 2020/08/29 10:12:06 1.122
+++ src/usr.bin/make/dir.c 2020/08/29 10:41:12 1.123
@@ -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 @@
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;
--- src/usr.bin/make/job.c 2020/08/29 10:35:03 1.222
+++ src/usr.bin/make/job.c 2020/08/29 10:41:12 1.223
@@ -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 @@
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;
--- src/usr.bin/make/lst.c 2020/08/29 10:12:06 1.55
+++ src/usr.bin/make/lst.c 2020/08/29 10:41:12 1.56
@@ -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 @@
/* 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 @@
/* 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 @@
* 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)
{
--- src/usr.bin/make/lst.h 2020/08/29 10:12:06 1.56
+++ src/usr.bin/make/lst.h 2020/08/29 10:41:12 1.57
@@ -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 @@
/* 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);
--- src/usr.bin/make/main.c 2020/08/29 10:12:06 1.326
+++ src/usr.bin/make/main.c 2020/08/29 10:41:12 1.327
@@ -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 @@
#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 @@
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 @@
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);
}
--- src/usr.bin/make/meta.c 2020/08/29 10:12:06 1.109
+++ src/usr.bin/make/meta.c 2020/08/29 10:41:12 1.110
--- src/usr.bin/make/suff.c 2020/08/29 10:12:06 1.130
+++ src/usr.bin/make/suff.c 2020/08/29 10:41:12 1.131
@@ -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 @@
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 @@
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 @@
/*
* 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 @@
* 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 @@
/*
* Search from this suffix's successor...
*/
- ln = Lst_Succ(ln);
+ ln = LstNode_Next(ln);
}
}
@@ -2138,7 +2138,7 @@
* 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);
}