Thu Aug 27 19:15:35 2020 UTC ()
make(1): migrate Lst_IsEmpty to Lst_IsEmptyS
(rillig)
diff -r1.98 -r1.99 src/usr.bin/make/arch.c
diff -r1.130 -r1.131 src/usr.bin/make/compat.c
diff -r1.100 -r1.101 src/usr.bin/make/cond.c
diff -r1.114 -r1.115 src/usr.bin/make/dir.c
diff -r1.218 -r1.219 src/usr.bin/make/job.c
diff -r1.46 -r1.47 src/usr.bin/make/lst.c
diff -r1.48 -r1.49 src/usr.bin/make/lst.h
diff -r1.316 -r1.317 src/usr.bin/make/main.c
diff -r1.126 -r1.127 src/usr.bin/make/make.c
diff -r1.102 -r1.103 src/usr.bin/make/meta.c
diff -r1.266 -r1.267 src/usr.bin/make/parse.c
diff -r1.120 -r1.121 src/usr.bin/make/suff.c
diff -r1.74 -r1.75 src/usr.bin/make/targ.c
--- src/usr.bin/make/arch.c 2020/08/27 06:13:53 1.98
+++ src/usr.bin/make/arch.c 2020/08/27 19:15:35 1.99
@@ -1,4 +1,4 @@
-/* $NetBSD: arch.c,v 1.98 2020/08/27 06:13:53 rillig Exp $ */
+/* $NetBSD: arch.c,v 1.99 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.98 2020/08/27 06:13:53 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.99 2020/08/27 19:15:35 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.98 2020/08/27 06:13:53 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.99 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -396,7 +396,7 @@
Buf_Init(&nameBuf, 0);
Dir_Expand(memName, dirSearchPath, members);
- while (!Lst_IsEmpty(members)) {
+ while (!Lst_IsEmptyS(members)) {
char *member = Lst_DequeueS(members);
Buf_Empty(&nameBuf);
@@ -1252,9 +1252,9 @@
if (gn->type & OP_PHONY) {
oodate = TRUE;
- } else if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) {
+ } else if (OP_NOP(gn->type) && Lst_IsEmptyS(gn->children)) {
oodate = FALSE;
- } else if ((!Lst_IsEmpty(gn->children) && gn->cmgn == NULL) ||
+ } else if ((!Lst_IsEmptyS(gn->children) && gn->cmgn == NULL) ||
(gn->mtime > now) ||
(gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime)) {
oodate = TRUE;
--- src/usr.bin/make/compat.c 2020/08/27 06:53:57 1.130
+++ src/usr.bin/make/compat.c 2020/08/27 19:15:35 1.131
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.130 2020/08/27 06:53:57 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.131 2020/08/27 19:15:35 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: compat.c,v 1.130 2020/08/27 06:53:57 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.131 2020/08/27 19:15:35 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.130 2020/08/27 06:53:57 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.131 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -747,7 +747,7 @@
* could not be made due to errors.
*/
errors = 0;
- while (!Lst_IsEmpty(targs)) {
+ while (!Lst_IsEmptyS(targs)) {
gn = Lst_DequeueS(targs);
Compat_Make(gn, gn);
--- src/usr.bin/make/cond.c 2020/08/23 16:58:02 1.100
+++ src/usr.bin/make/cond.c 2020/08/27 19:15:35 1.101
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.100 2020/08/23 16:58:02 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.101 2020/08/27 19:15:35 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: cond.c,v 1.100 2020/08/23 16:58:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.101 2020/08/27 19:15:35 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.100 2020/08/23 16:58:02 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.101 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -326,7 +326,7 @@
GNode *gn;
gn = Targ_FindNode(arg, TARG_NOCREATE);
- return gn != NULL && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands);
+ return gn != NULL && !OP_NOP(gn->type) && !Lst_IsEmptyS(gn->commands);
}
/*-
--- src/usr.bin/make/dir.c 2020/08/27 07:00:29 1.114
+++ src/usr.bin/make/dir.c 2020/08/27 19:15:35 1.115
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.114 2020/08/27 07:00:29 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.115 2020/08/27 19:15:35 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.114 2020/08/27 07:00:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.115 2020/08/27 19:15:35 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.114 2020/08/27 07:00:29 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.115 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1478,7 +1478,7 @@
else {
fullName = Dir_FindFile(gn->name, Suff_FindPath(gn));
if (fullName == NULL && gn->flags & FROM_DEPEND &&
- !Lst_IsEmpty(gn->iParents)) {
+ !Lst_IsEmptyS(gn->iParents)) {
char *cp;
cp = strrchr(gn->name, '/');
@@ -1733,7 +1733,7 @@
void
Dir_ClearPath(Lst path)
{
- while (!Lst_IsEmpty(path)) {
+ while (!Lst_IsEmptyS(path)) {
Path *p = Lst_DequeueS(path);
Dir_Destroy(p);
}
--- src/usr.bin/make/job.c 2020/08/27 07:00:29 1.218
+++ src/usr.bin/make/job.c 2020/08/27 19:15:35 1.219
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.218 2020/08/27 07:00:29 rillig Exp $ */
+/* $NetBSD: job.c,v 1.219 2020/08/27 19:15:35 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.218 2020/08/27 07:00:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.219 2020/08/27 19:15:35 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.218 2020/08/27 07:00:29 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.219 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1234,13 +1234,13 @@
Boolean
Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
{
- if (OP_NOP(gn->type) && Lst_IsEmpty(gn->commands) &&
- ((gn->type & OP_LIB) == 0 || Lst_IsEmpty(gn->children))) {
+ if (OP_NOP(gn->type) && Lst_IsEmptyS(gn->commands) &&
+ ((gn->type & OP_LIB) == 0 || Lst_IsEmptyS(gn->children))) {
/*
* No commands. Look for .DEFAULT rule from which we might infer
* commands
*/
- if ((DEFAULT != NULL) && !Lst_IsEmpty(DEFAULT->commands) &&
+ if ((DEFAULT != NULL) && !Lst_IsEmptyS(DEFAULT->commands) &&
(gn->type & OP_SPECIAL) == 0) {
char *p1;
/*
@@ -2671,8 +2671,8 @@
Job_Finish(void)
{
if (postCommands != NULL &&
- (!Lst_IsEmpty(postCommands->commands) ||
- !Lst_IsEmpty(postCommands->children))) {
+ (!Lst_IsEmptyS(postCommands->commands) ||
+ !Lst_IsEmptyS(postCommands->children))) {
if (errors) {
Error("Errors reported so .END ignored");
} else {
--- src/usr.bin/make/lst.c 2020/08/27 07:03:48 1.46
+++ src/usr.bin/make/lst.c 2020/08/27 19:15:35 1.47
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.46 2020/08/27 07:03:48 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.47 2020/08/27 19:15:35 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.46 2020/08/27 07:03:48 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.47 2020/08/27 19:15:35 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.46 2020/08/27 07:03:48 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.47 2020/08/27 19:15:35 rillig Exp $");
#endif /* not lint */
#endif
@@ -389,13 +389,6 @@
/*
* Functions for entire lists
*/
-
-/* Return TRUE if the given list is empty or invalid. */
-Boolean
-Lst_IsEmpty(Lst list)
-{
- return !LstIsValid(list) || LstIsEmpty(list);
-}
/* Return TRUE if the given list is empty. */
Boolean
--- src/usr.bin/make/lst.h 2020/08/27 07:00:29 1.48
+++ src/usr.bin/make/lst.h 2020/08/27 19:15:35 1.49
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.48 2020/08/27 07:00:29 rillig Exp $ */
+/* $NetBSD: lst.h,v 1.49 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -106,7 +106,6 @@
void Lst_FreeS(Lst);
void Lst_DestroyS(Lst, LstFreeProc);
/* True if list is empty */
-Boolean Lst_IsEmpty(Lst);
Boolean Lst_IsEmptyS(Lst);
/*
--- src/usr.bin/make/main.c 2020/08/27 07:00:29 1.316
+++ src/usr.bin/make/main.c 2020/08/27 19:15:35 1.317
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.316 2020/08/27 07:00:29 rillig Exp $ */
+/* $NetBSD: main.c,v 1.317 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.316 2020/08/27 07:00:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.317 2020/08/27 19:15:35 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.316 2020/08/27 07:00:29 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.317 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1275,7 +1275,7 @@
* created. If none specified, make the variable empty -- the parser
* will fill the thing in with the default or .MAIN target.
*/
- if (!Lst_IsEmpty(create)) {
+ if (!Lst_IsEmptyS(create)) {
LstNode ln;
for (ln = Lst_First(create); ln != NULL; ln = Lst_SuccS(ln)) {
@@ -1325,9 +1325,9 @@
sysMkPath = Lst_Init();
Dir_Expand(_PATH_DEFSYSMK,
- Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath,
+ Lst_IsEmptyS(sysIncPath) ? defIncPath : sysIncPath,
sysMkPath);
- if (Lst_IsEmpty(sysMkPath))
+ if (Lst_IsEmptyS(sysMkPath))
Fatal("%s: no system rules (%s).", progname,
_PATH_DEFSYSMK);
ln = Lst_Find(sysMkPath, ReadMakefile, NULL);
@@ -1336,7 +1336,7 @@
(char *)Lst_DatumS(ln));
}
- if (!Lst_IsEmpty(makefiles)) {
+ if (!Lst_IsEmptyS(makefiles)) {
LstNode ln;
ln = Lst_Find(makefiles, ReadAllMakefiles, NULL);
@@ -1544,7 +1544,7 @@
name = Dir_FindFile(fname, parseIncPath);
if (!name)
name = Dir_FindFile(fname,
- Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath);
+ Lst_IsEmptyS(sysIncPath) ? defIncPath : sysIncPath);
if (!name || (fd = open(name, O_RDONLY)) == -1) {
free(name);
free(path);
--- src/usr.bin/make/make.c 2020/08/27 06:53:57 1.126
+++ src/usr.bin/make/make.c 2020/08/27 19:15:35 1.127
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.126 2020/08/27 06:53:57 rillig Exp $ */
+/* $NetBSD: make.c,v 1.127 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.126 2020/08/27 06:53:57 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.127 2020/08/27 19:15:35 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.126 2020/08/27 06:53:57 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.127 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -474,7 +474,7 @@
}
#endif
- if ((cgn->type & (OP_USE|OP_USEBEFORE)) || Lst_IsEmpty(pgn->commands)) {
+ if ((cgn->type & (OP_USE|OP_USEBEFORE)) || Lst_IsEmptyS(pgn->commands)) {
if (cgn->type & OP_USEBEFORE) {
/* .USEBEFORE */
Lst_PrependAllS(pgn->commands, cgn->commands);
@@ -614,7 +614,7 @@
* To force things that depend on FRC to be made, so we have to
* check for gn->children being empty as well...
*/
- if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) {
+ if (!Lst_IsEmptyS(gn->commands) || Lst_IsEmptyS(gn->children)) {
gn->mtime = now;
}
#else
@@ -724,7 +724,7 @@
* which is where all parents are linked.
*/
if ((centurion = cgn->centurion) != NULL) {
- if (!Lst_IsEmpty(cgn->parents))
+ if (!Lst_IsEmptyS(cgn->parents))
Punt("%s%s: cohort has parents", cgn->name, cgn->cohort_num);
centurion->unmade_cohorts -= 1;
if (centurion->unmade_cohorts < 0)
@@ -1087,7 +1087,7 @@
GNode *gn;
int have_token = 0;
- while (!Lst_IsEmpty(toBeMade)) {
+ while (!Lst_IsEmptyS(toBeMade)) {
/* Get token now to avoid cycling job-list when we only have 1 token */
if (!have_token && !Job_TokenWithdraw())
break;
@@ -1438,7 +1438,7 @@
examine = Lst_Init();
Lst_AppendS(examine, pgn);
- while (!Lst_IsEmpty(examine)) {
+ while (!Lst_IsEmptyS(examine)) {
pgn = Lst_DequeueS(examine);
/* We only want to process each child-list once */
@@ -1536,7 +1536,7 @@
* Note that the Job module will exit if there were any errors unless the
* keepgoing flag was given.
*/
- while (!Lst_IsEmpty(toBeMade) || jobTokensRunning > 0) {
+ while (!Lst_IsEmptyS(toBeMade) || jobTokensRunning > 0) {
Job_CatchOutput();
(void)MakeStartJobs();
}
--- src/usr.bin/make/meta.c 2020/08/27 07:00:29 1.102
+++ src/usr.bin/make/meta.c 2020/08/27 19:15:35 1.103
--- src/usr.bin/make/parse.c 2020/08/27 07:03:48 1.266
+++ src/usr.bin/make/parse.c 2020/08/27 19:15:35 1.267
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.266 2020/08/27 07:03:48 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.267 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.266 2020/08/27 07:03:48 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.267 2020/08/27 19:15:35 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.266 2020/08/27 07:03:48 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.267 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -852,7 +852,7 @@
GNode *pgn = (GNode *)pgnp;
GNode *cgn = (GNode *)cgnp;
- if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(pgn->cohorts))
+ if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmptyS(pgn->cohorts))
pgn = Lst_DatumS(Lst_LastS(pgn->cohorts));
Lst_AppendS(pgn->children, cgn);
if (specType == Not)
@@ -1360,7 +1360,7 @@
Lst_AppendS(paths, dirSearchPath);
break;
case Main:
- if (!Lst_IsEmpty(create)) {
+ if (!Lst_IsEmptyS(create)) {
specType = Not;
}
break;
@@ -1447,7 +1447,7 @@
/* Apply the targets. */
- while(!Lst_IsEmpty(curTargs)) {
+ while(!Lst_IsEmptyS(curTargs)) {
char *targName = Lst_DequeueS(curTargs);
if (!Suff_IsTransform (targName)) {
@@ -1500,7 +1500,7 @@
Lst_FreeS(curTargs);
curTargs = NULL;
- if (!Lst_IsEmpty(targets)) {
+ if (targets != NULL && !Lst_IsEmptyS(targets)) {
switch(specType) {
default:
Parse_Error(PARSE_WARNING, "Special and mundane targets don't mix. Mundane ones ignored");
@@ -1725,7 +1725,7 @@
goto out;
}
- while (!Lst_IsEmpty(sources)) {
+ while (!Lst_IsEmptyS(sources)) {
gn = Lst_DequeueS(sources);
ParseDoSrc(tOp, gn->name);
}
@@ -2087,7 +2087,7 @@
GNode *gn = (GNode *)gnp;
/* Add to last (ie current) cohort for :: targets */
- if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(gn->cohorts))
+ if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmptyS(gn->cohorts))
gn = Lst_DatumS(Lst_LastS(gn->cohorts));
/* if target already supplied, ignore commands */
@@ -2139,7 +2139,7 @@
ParseHasCommands(void *gnp)
{
GNode *gn = (GNode *)gnp;
- if (!Lst_IsEmpty(gn->commands)) {
+ if (!Lst_IsEmptyS(gn->commands)) {
gn->type |= OP_HAS_COMMANDS;
}
}
@@ -2262,7 +2262,7 @@
* Look for it on the system path
*/
fullname = Dir_FindFile(file,
- Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath);
+ Lst_IsEmptyS(sysIncPath) ? defIncPath : sysIncPath);
}
if (fullname == NULL) {
@@ -2749,7 +2749,7 @@
free(curFile->P_str);
free(curFile);
- if (Lst_IsEmpty(includes)) {
+ if (Lst_IsEmptyS(includes)) {
curFile = NULL;
/* We've run out of input */
Var_Delete(".PARSEDIR", VAR_GLOBAL);
--- src/usr.bin/make/suff.c 2020/08/27 07:03:48 1.120
+++ src/usr.bin/make/suff.c 2020/08/27 19:15:35 1.121
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.120 2020/08/27 07:03:48 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.121 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.120 2020/08/27 07:03:48 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.121 2020/08/27 19:15:35 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.120 2020/08/27 07:03:48 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.121 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -229,7 +229,6 @@
static int SuffAddSrc(void *, void *);
static int SuffRemoveSrc(Lst);
static void SuffAddLevel(Lst, Src *);
-static Src *SuffFindThem(Lst, Lst);
static Src *SuffFindCmds(Src *, Lst);
static void SuffExpandChildren(LstNode, GNode *);
static void SuffExpandWildcards(LstNode, GNode *);
@@ -775,10 +774,10 @@
{
GNode *gn = (GNode *)gnp;
- if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(gn->cohorts))
+ if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmptyS(gn->cohorts))
gn = Lst_DatumS(Lst_LastS(gn->cohorts));
- if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) &&
- Lst_IsEmpty(gn->children))
+ if ((gn->type & OP_TRANSFORM) && Lst_IsEmptyS(gn->commands) &&
+ Lst_IsEmptyS(gn->children))
{
Suff *s, *t;
@@ -1071,7 +1070,7 @@
Lst_OpenS(sufflist);
while ((ln = Lst_NextS(sufflist)) != NULL) {
s = Lst_DatumS(ln);
- if (!Lst_IsEmpty (s->searchPath)) {
+ if (!Lst_IsEmptyS(s->searchPath)) {
#ifdef INCLUDES
if (s->flags & SUFF_INCLUDE) {
Dir_Concat(inIncludes, s->searchPath);
@@ -1354,7 +1353,7 @@
rs = NULL;
- while (!Lst_IsEmpty (srcs)) {
+ while (!Lst_IsEmptyS(srcs)) {
s = Lst_DequeueS(srcs);
if (DEBUG(SUFF)) {
@@ -1437,7 +1436,7 @@
}
s = Lst_DatumS(ln);
- if (s->type & OP_OPTIONAL && Lst_IsEmpty(t->commands)) {
+ if (s->type & OP_OPTIONAL && Lst_IsEmptyS(t->commands)) {
/*
* We haven't looked to see if .OPTIONAL files exist yet, so
* don't use one as the implicit source.
@@ -1531,7 +1530,7 @@
GNode *gn; /* New source 8) */
char *cp; /* Expanded value */
- if (!Lst_IsEmpty(cgn->order_pred) || !Lst_IsEmpty(cgn->order_succ))
+ if (!Lst_IsEmptyS(cgn->order_pred) || !Lst_IsEmptyS(cgn->order_succ))
/* It is all too hard to process the result of .ORDER */
return;
@@ -1638,7 +1637,7 @@
/*
* Add all elements of the members list to the parent node.
*/
- while(!Lst_IsEmpty(members)) {
+ while(!Lst_IsEmptyS(members)) {
gn = Lst_DequeueS(members);
if (DEBUG(SUFF)) {
@@ -1688,7 +1687,7 @@
explist = Lst_Init();
Dir_Expand(cgn->name, Suff_FindPath(cgn), explist);
- while (!Lst_IsEmpty(explist)) {
+ while (!Lst_IsEmptyS(explist)) {
/*
* Fetch next expansion off the list and find its GNode
*/
@@ -2139,7 +2138,7 @@
/*
* Handle target of unknown suffix...
*/
- if (Lst_IsEmpty(targs) && suffNull != NULL) {
+ if (Lst_IsEmptyS(targs) && suffNull != NULL) {
if (DEBUG(SUFF)) {
fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name);
}
@@ -2162,7 +2161,7 @@
* not define suffix rules if the gnode had children but we
* don't do this anymore.
*/
- if (Lst_IsEmpty(gn->commands))
+ if (Lst_IsEmptyS(gn->commands))
SuffAddLevel(srcs, targ);
else {
if (DEBUG(SUFF))
@@ -2186,7 +2185,7 @@
* No known transformations -- use the first suffix found
* for setting the local variables.
*/
- if (!Lst_IsEmpty(targs)) {
+ if (!Lst_IsEmptyS(targs)) {
targ = Lst_DatumS(Lst_First(targs));
} else {
targ = NULL;
@@ -2293,7 +2292,7 @@
/*
* Check for overriding transformation rule implied by sources
*/
- if (!Lst_IsEmpty(gn->children)) {
+ if (!Lst_IsEmptyS(gn->children)) {
src = SuffFindCmds(targ, slst);
if (src != NULL) {
--- src/usr.bin/make/targ.c 2020/08/27 06:53:57 1.74
+++ src/usr.bin/make/targ.c 2020/08/27 19:15:35 1.75
@@ -1,4 +1,4 @@
-/* $NetBSD: targ.c,v 1.74 2020/08/27 06:53:57 rillig Exp $ */
+/* $NetBSD: targ.c,v 1.75 2020/08/27 19:15:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.74 2020/08/27 06:53:57 rillig Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.75 2020/08/27 19:15:35 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.74 2020/08/27 06:53:57 rillig Exp $");
+__RCSID("$NetBSD: targ.c,v 1.75 2020/08/27 19:15:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -660,7 +660,7 @@
fprintf(debug_file, "# unmade\n");
}
}
- if (!Lst_IsEmpty (gn->iParents)) {
+ if (!Lst_IsEmptyS(gn->iParents)) {
fprintf(debug_file, "# implicit parents: ");
Lst_ForEachS(gn->iParents, TargPrintName, NULL);
fprintf(debug_file, "\n");
@@ -669,17 +669,17 @@
if (gn->unmade)
fprintf(debug_file, "# %d unmade children\n", gn->unmade);
}
- if (!Lst_IsEmpty (gn->parents)) {
+ if (!Lst_IsEmptyS(gn->parents)) {
fprintf(debug_file, "# parents: ");
Lst_ForEachS(gn->parents, TargPrintName, NULL);
fprintf(debug_file, "\n");
}
- if (!Lst_IsEmpty (gn->order_pred)) {
+ if (!Lst_IsEmptyS(gn->order_pred)) {
fprintf(debug_file, "# order_pred: ");
Lst_ForEachS(gn->order_pred, TargPrintName, NULL);
fprintf(debug_file, "\n");
}
- if (!Lst_IsEmpty (gn->order_succ)) {
+ if (!Lst_IsEmptyS(gn->order_succ)) {
fprintf(debug_file, "# order_succ: ");
Lst_ForEachS(gn->order_succ, TargPrintName, NULL);
fprintf(debug_file, "\n");