Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): migrate Lst_IsEmpty to Lst_IsEmptyS



details:   https://anonhg.NetBSD.org/src/rev/679a964e067d
branches:  trunk
changeset: 943147:679a964e067d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 27 19:15:35 2020 +0000

description:
make(1): migrate Lst_IsEmpty to Lst_IsEmptyS

diffstat:

 usr.bin/make/arch.c   |  12 ++++++------
 usr.bin/make/compat.c |   8 ++++----
 usr.bin/make/cond.c   |   8 ++++----
 usr.bin/make/dir.c    |  10 +++++-----
 usr.bin/make/job.c    |  16 ++++++++--------
 usr.bin/make/lst.c    |  13 +++----------
 usr.bin/make/lst.h    |   3 +--
 usr.bin/make/main.c   |  16 ++++++++--------
 usr.bin/make/make.c   |  18 +++++++++---------
 usr.bin/make/meta.c   |  10 +++++-----
 usr.bin/make/parse.c  |  24 ++++++++++++------------
 usr.bin/make/suff.c   |  33 ++++++++++++++++-----------------
 usr.bin/make/targ.c   |  14 +++++++-------
 13 files changed, 88 insertions(+), 97 deletions(-)

diffs (truncated from 761 to 300 lines):

diff -r e35cd051742c -r 679a964e067d usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/arch.c       Thu Aug 27 19:15:35 2020 +0000
@@ -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;
diff -r e35cd051742c -r 679a964e067d usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/compat.c     Thu Aug 27 19:15:35 2020 +0000
@@ -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);
 
diff -r e35cd051742c -r 679a964e067d usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/cond.c       Thu Aug 27 19:15:35 2020 +0000
@@ -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);
 }
 
 /*-
diff -r e35cd051742c -r 679a964e067d usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/dir.c        Thu Aug 27 19:15:35 2020 +0000
@@ -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);
     }
diff -r e35cd051742c -r 679a964e067d usr.bin/make/job.c
--- a/usr.bin/make/job.c        Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/job.c        Thu Aug 27 19:15:35 2020 +0000
@@ -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 {
diff -r e35cd051742c -r 679a964e067d usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/lst.c        Thu Aug 27 19:15:35 2020 +0000
@@ -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 @@
  * 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)
diff -r e35cd051742c -r 679a964e067d usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/lst.h        Thu Aug 27 19:15:35 2020 +0000
@@ -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);
 
 /*
diff -r e35cd051742c -r 679a964e067d usr.bin/make/main.c
--- a/usr.bin/make/main.c       Thu Aug 27 19:09:37 2020 +0000
+++ b/usr.bin/make/main.c       Thu Aug 27 19:15:35 2020 +0000
@@ -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.
         */



Home | Main Index | Thread Index | Old Index