make(1): migrate Lst_Succ to Lst_SuccS

This commit is contained in:
rillig 2020-08-27 07:00:29 +00:00
parent 6c196ebe9c
commit b855b10134
7 changed files with 28 additions and 41 deletions

View File

@ -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 <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.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;

View File

@ -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 <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.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;

View File

@ -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 <sys/cdefs.h>
#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)

View File

@ -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);

View File

@ -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 <sys/cdefs.h>
#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);
}

View File

@ -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) {
/*

View File

@ -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 <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.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);
}