Module Name:    src
Committed By:   rillig
Date:           Thu Aug 27 19:15:35 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c compat.c cond.c dir.c job.c lst.c lst.h main.c
            make.c meta.c parse.c suff.c targ.c

Log Message:
make(1): migrate Lst_IsEmpty to Lst_IsEmptyS


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/make/arch.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/make/compat.c
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/make/cond.c
cvs rdiff -u -r1.114 -r1.115 src/usr.bin/make/dir.c
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/job.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/make/lst.c
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/make/lst.h
cvs rdiff -u -r1.316 -r1.317 src/usr.bin/make/main.c
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/make/make.c
cvs rdiff -u -r1.102 -r1.103 src/usr.bin/make/meta.c
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/make/parse.c
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/make/suff.c
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/targ.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/arch.c
diff -u src/usr.bin/make/arch.c:1.98 src/usr.bin/make/arch.c:1.99
--- src/usr.bin/make/arch.c:1.98	Thu Aug 27 06:13:53 2020
+++ src/usr.bin/make/arch.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Arch_ParseArchive(char **linePtr, Lst no
 
 	    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 @@ Arch_LibOODate(GNode *gn)
 
     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;

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.130 src/usr.bin/make/compat.c:1.131
--- src/usr.bin/make/compat.c:1.130	Thu Aug 27 06:53:57 2020
+++ src/usr.bin/make/compat.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Compat_Run(Lst targs)
      *	    	  	    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);
 

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.100 src/usr.bin/make/cond.c:1.101
--- src/usr.bin/make/cond.c:1.100	Sun Aug 23 16:58:02 2020
+++ src/usr.bin/make/cond.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ CondDoCommands(int argLen MAKE_ATTR_UNUS
     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);
 }
 
 /*-

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.114 src/usr.bin/make/dir.c:1.115
--- src/usr.bin/make/dir.c:1.114	Thu Aug 27 07:00:29 2020
+++ src/usr.bin/make/dir.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Dir_MTime(GNode *gn, Boolean recheck)
 	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 @@ Dir_Destroy(void *pp)
 void
 Dir_ClearPath(Lst path)
 {
-    while (!Lst_IsEmpty(path)) {
+    while (!Lst_IsEmptyS(path)) {
 	Path *p = Lst_DequeueS(path);
 	Dir_Destroy(p);
     }

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.218 src/usr.bin/make/job.c:1.219
--- src/usr.bin/make/job.c:1.218	Thu Aug 27 07:00:29 2020
+++ src/usr.bin/make/job.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Job_Touch(GNode *gn, Boolean silent)
 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 @@ int
 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 {

Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.46 src/usr.bin/make/lst.c:1.47
--- src/usr.bin/make/lst.c:1.46	Thu Aug 27 07:03:48 2020
+++ src/usr.bin/make/lst.c	Thu Aug 27 19:15:35 2020
@@ -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
 
@@ -390,13 +390,6 @@ Lst_DatumS(LstNode node)
  * 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
 Lst_IsEmptyS(Lst list)

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.48 src/usr.bin/make/lst.h:1.49
--- src/usr.bin/make/lst.h:1.48	Thu Aug 27 07:00:29 2020
+++ src/usr.bin/make/lst.h	Thu Aug 27 19:15:35 2020
@@ -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 @@ Lst		Lst_CopyS(Lst, LstCopyProc);
 void		Lst_FreeS(Lst);
 void		Lst_DestroyS(Lst, LstFreeProc);
 /* True if list is empty */
-Boolean		Lst_IsEmpty(Lst);
 Boolean		Lst_IsEmptyS(Lst);
 
 /*

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.316 src/usr.bin/make/main.c:1.317
--- src/usr.bin/make/main.c:1.316	Thu Aug 27 07:00:29 2020
+++ src/usr.bin/make/main.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ __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.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 @@ main(int argc, char **argv)
 	 * 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 @@ main(int argc, char **argv)
 
 		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 @@ main(int argc, char **argv)
 			    (char *)Lst_DatumS(ln));
 	}
 
-	if (!Lst_IsEmpty(makefiles)) {
+	if (!Lst_IsEmptyS(makefiles)) {
 		LstNode ln;
 
 		ln = Lst_Find(makefiles, ReadAllMakefiles, NULL);
@@ -1544,7 +1544,7 @@ ReadMakefile(const void *p, const void *
 		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);

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.126 src/usr.bin/make/make.c:1.127
--- src/usr.bin/make/make.c:1.126	Thu Aug 27 06:53:57 2020
+++ src/usr.bin/make/make.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
     }
 #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 @@ Make_Recheck(GNode *gn)
      * 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 @@ Make_Update(GNode *cgn)
      * 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 @@ MakeStartJobs(void)
     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 @@ Make_ProcessWait(Lst targs)
     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 @@ Make_Run(Lst targs)
      * 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();
     }

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.102 src/usr.bin/make/meta.c:1.103
--- src/usr.bin/make/meta.c:1.102	Thu Aug 27 07:00:29 2020
+++ src/usr.bin/make/meta.c	Thu Aug 27 19:15:35 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.102 2020/08/27 07:00:29 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.103 2020/08/27 19:15:35 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -416,7 +416,7 @@ meta_needed(GNode *gn, const char *dname
     }
 
     /* Check if there are no commands to execute. */
-    if (Lst_IsEmpty(gn->commands)) {
+    if (Lst_IsEmptyS(gn->commands)) {
 	if (verbose)
 	    fprintf(debug_file, "Skipping meta for %s: no commands\n",
 		    gn->name);
@@ -1332,7 +1332,7 @@ meta_oodate(GNode *gn, Boolean oodate)
 		    DEQUOTE(move_target);
 		    /* FALLTHROUGH */
 		case 'D':		/* unlink */
-		    if (*p == '/' && !Lst_IsEmpty(missingFiles)) {
+		    if (*p == '/' && !Lst_IsEmptyS(missingFiles)) {
 			/* remove any missingFiles entries that match p */
 			ln = Lst_Find(missingFiles, path_match, p);
 			if (ln != NULL) {
@@ -1390,7 +1390,7 @@ meta_oodate(GNode *gn, Boolean oodate)
 		    if (*p != '/')
 			break;
 
-		    if (Lst_IsEmpty(metaBailiwick))
+		    if (Lst_IsEmptyS(metaBailiwick))
 			break;
 
 		    /* ignore cwd - normal dependencies handle those */
@@ -1595,7 +1595,7 @@ meta_oodate(GNode *gn, Boolean oodate)
 	}
 
 	fclose(fp);
-	if (!Lst_IsEmpty(missingFiles)) {
+	if (!Lst_IsEmptyS(missingFiles)) {
 	    if (DEBUG(META))
 		fprintf(debug_file, "%s: missing files: %s...\n",
 			fname, (char *)Lst_DatumS(Lst_First(missingFiles)));

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.266 src/usr.bin/make/parse.c:1.267
--- src/usr.bin/make/parse.c:1.266	Thu Aug 27 07:03:48 2020
+++ src/usr.bin/make/parse.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ ParseLinkSrc(void *pgnp, void *cgnp)
     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 @@ ParseDoDependency(char *line)
 		    Lst_AppendS(paths, dirSearchPath);
 		    break;
 		case Main:
-		    if (!Lst_IsEmpty(create)) {
+		    if (!Lst_IsEmptyS(create)) {
 			specType = Not;
 		    }
 		    break;
@@ -1447,7 +1447,7 @@ ParseDoDependency(char *line)
 
 	    /* Apply the targets. */
 
-	    while(!Lst_IsEmpty(curTargs)) {
+	    while(!Lst_IsEmptyS(curTargs)) {
 		char *targName = Lst_DequeueS(curTargs);
 
 		if (!Suff_IsTransform (targName)) {
@@ -1500,7 +1500,7 @@ ParseDoDependency(char *line)
     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 @@ ParseDoDependency(char *line)
 		    goto out;
 		}
 
-		while (!Lst_IsEmpty(sources)) {
+		while (!Lst_IsEmptyS(sources)) {
 		    gn = Lst_DequeueS(sources);
 		    ParseDoSrc(tOp, gn->name);
 		}
@@ -2087,7 +2087,7 @@ ParseAddCmd(void *gnp, void *cmd)
     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 @@ static void
 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 @@ Parse_include_file(char *file, Boolean i
 	 * 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 @@ ParseEOF(void)
     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);

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.120 src/usr.bin/make/suff.c:1.121
--- src/usr.bin/make/suff.c:1.120	Thu Aug 27 07:03:48 2020
+++ src/usr.bin/make/suff.c	Thu Aug 27 19:15:35 2020
@@ -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 SuffScanTargets(void *, void 
 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 @@ Suff_EndTransform(void *gnp, void *dummy
 {
     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 @@ Suff_DoPaths(void)
     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 @@ SuffFindThem(Lst srcs, Lst slst)
 
     rs = NULL;
 
-    while (!Lst_IsEmpty (srcs)) {
+    while (!Lst_IsEmptyS(srcs)) {
 	s = Lst_DequeueS(srcs);
 
 	if (DEBUG(SUFF)) {
@@ -1437,7 +1436,7 @@ SuffFindCmds(Src *targ, Lst slst)
 	}
 	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 @@ SuffExpandChildren(LstNode cln, GNode *p
     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 @@ SuffExpandChildren(LstNode cln, GNode *p
 	/*
 	 * 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 @@ SuffExpandWildcards(LstNode cln, GNode *
     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 @@ SuffFindNormalDeps(GNode *gn, Lst slst)
 	/*
 	 * 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 @@ SuffFindNormalDeps(GNode *gn, Lst slst)
 	     * 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 @@ SuffFindNormalDeps(GNode *gn, Lst slst)
 	     * 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 @@ sfnd_abort:
     /*
      * 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) {

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.74 src/usr.bin/make/targ.c:1.75
--- src/usr.bin/make/targ.c:1.74	Thu Aug 27 06:53:57 2020
+++ src/usr.bin/make/targ.c	Thu Aug 27 19:15:35 2020
@@ -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 @@ Targ_PrintNode(void *gnp, void *passp)
 		    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 @@ Targ_PrintNode(void *gnp, void *passp)
 	    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");

Reply via email to