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_First to Lst_FirstS



details:   https://anonhg.NetBSD.org/src/rev/d7bd0f1ac7fe
branches:  trunk
changeset: 1013401:d7bd0f1ac7fe
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 28 04:14:31 2020 +0000

description:
make(1): migrate Lst_First to Lst_FirstS

diffstat:

 usr.bin/make/dir.c  |  12 ++++++------
 usr.bin/make/lst.c  |  10 +++++-----
 usr.bin/make/lst.h  |   3 +--
 usr.bin/make/main.c |  10 +++++-----
 usr.bin/make/make.c |  12 ++++++------
 usr.bin/make/meta.c |   6 +++---
 usr.bin/make/suff.c |  12 ++++++------
 7 files changed, 32 insertions(+), 33 deletions(-)

diffs (289 lines):

diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/dir.c        Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.115 2020/08/27 19:15:35 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.116 2020/08/28 04:14:31 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.115 2020/08/27 19:15:35 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.116 2020/08/28 04:14:31 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.115 2020/08/27 19:15:35 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.116 2020/08/28 04:14:31 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -483,7 +483,7 @@
     Var_Delete(".PATH", VAR_GLOBAL);
 
     Lst_OpenS(dirSearchPath);
-    if ((ln = Lst_First(dirSearchPath)) != NULL) {
+    if ((ln = Lst_FirstS(dirSearchPath)) != NULL) {
        p = Lst_DatumS(ln);
        if (p == dotLast) {
            hasLastDot = TRUE;
@@ -1137,7 +1137,7 @@
     }
 
     Lst_OpenS(path);
-    if ((ln = Lst_First(path)) != NULL) {
+    if ((ln = Lst_FirstS(path)) != NULL) {
        p = Lst_DatumS(ln);
        if (p == dotLast) {
            hasLastDot = TRUE;
@@ -1764,7 +1764,7 @@
     LstNode ln;
     Path *p;
 
-    for (ln = Lst_First(path2); ln != NULL; ln = Lst_SuccS(ln)) {
+    for (ln = Lst_FirstS(path2); ln != NULL; ln = Lst_SuccS(ln)) {
        p = Lst_DatumS(ln);
        if (Lst_MemberS(path1, p) == NULL) {
            p->refCount += 1;
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/lst.c        Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.47 2020/08/27 19:15:35 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.48 2020/08/28 04:14:31 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.47 2020/08/27 19:15:35 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.48 2020/08/28 04:14:31 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.47 2020/08/27 19:15:35 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.48 2020/08/28 04:14:31 rillig Exp $");
 #endif /* not lint */
 #endif
 
@@ -332,7 +332,7 @@
 
 /* Return the first node from the given list, or NULL if the list is empty or
  * invalid. */
-LstNode
+static LstNode
 Lst_First(Lst list)
 {
     if (!LstIsValid(list) || LstIsEmpty(list)) {
@@ -476,7 +476,7 @@
 {
     if (LstIsEmpty(list))
        return 0;               /* XXX: Document what this value means. */
-    return Lst_ForEachFromS(list, Lst_First(list), proc, procData);
+    return Lst_ForEachFromS(list, Lst_FirstS(list), proc, procData);
 }
 
 /* Apply the given function to each element of the given list, starting from
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/lst.h        Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.49 2020/08/27 19:15:35 rillig Exp $  */
+/*     $NetBSD: lst.h,v 1.50 2020/08/28 04:14:31 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -131,7 +131,6 @@
  * Node-specific functions
  */
 /* Return first element in list */
-LstNode                Lst_First(Lst);
 LstNode                Lst_FirstS(Lst);
 /* Return last element in list */
 LstNode                Lst_Last(Lst);
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/main.c       Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.317 2020/08/27 19:15:35 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.318 2020/08/28 04:14:31 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.317 2020/08/27 19:15:35 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.318 2020/08/28 04:14:31 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.317 2020/08/27 19:15:35 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.318 2020/08/28 04:14:31 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -869,7 +869,7 @@
        else
                expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE);
 
-       for (ln = Lst_First(variables); ln != NULL; ln = Lst_SuccS(ln)) {
+       for (ln = Lst_FirstS(variables); ln != NULL; ln = Lst_SuccS(ln)) {
                char *var = Lst_DatumS(ln);
                const char *value;
                char *p1;
@@ -1278,7 +1278,7 @@
        if (!Lst_IsEmptyS(create)) {
                LstNode ln;
 
-               for (ln = Lst_First(create); ln != NULL; ln = Lst_SuccS(ln)) {
+               for (ln = Lst_FirstS(create); ln != NULL; ln = Lst_SuccS(ln)) {
                        char *name = Lst_DatumS(ln);
                        Var_Append(".TARGETS", name, VAR_GLOBAL);
                }
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/make.c
--- a/usr.bin/make/make.c       Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/make.c       Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.127 2020/08/27 19:15:35 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.128 2020/08/28 04:14:31 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.127 2020/08/27 19:15:35 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.128 2020/08/28 04:14:31 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.127 2020/08/27 19:15:35 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.128 2020/08/28 04:14:31 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -735,7 +735,7 @@
     parents = centurion->parents;
 
     /* If this was a .ORDER node, schedule the RHS */
-    Lst_ForEachS(centurion->order_succ, MakeBuildParent, Lst_First(toBeMade));
+    Lst_ForEachS(centurion->order_succ, MakeBuildParent, Lst_FirstS(toBeMade));
 
     /* Now mark all the parents as having one less unmade child */
     Lst_OpenS(parents);
@@ -1121,7 +1121,7 @@
             * just before the current first element.
             */
            gn->made = DEFERRED;
-           Lst_ForEachS(gn->children, MakeBuildChild, Lst_First(toBeMade));
+           Lst_ForEachS(gn->children, MakeBuildChild, Lst_FirstS(toBeMade));
            /* and drop this node on the floor */
            if (DEBUG(MAKE))
                fprintf(debug_file, "dropped %s%s\n", gn->name, gn->cohort_num);
@@ -1451,7 +1451,7 @@
        if (pgn->type & OP_DOUBLEDEP)
            Lst_PrependAllS(examine, pgn->cohorts);
 
-       owln = Lst_First(pgn->children);
+       owln = Lst_FirstS(pgn->children);
        Lst_OpenS(pgn->children);
        for (; (ln = Lst_NextS(pgn->children)) != NULL; ) {
            cgn = Lst_DatumS(ln);
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/meta.c       Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.103 2020/08/27 19:15:35 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.104 2020/08/28 04:14:31 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1167,7 +1167,7 @@
        /* we want to track all the .meta we read */
        Var_Append(".MAKE.META.FILES", fname, VAR_GLOBAL);
 
-       ln = Lst_First(gn->commands);
+       ln = Lst_FirstS(gn->commands);
        while (!oodate && (x = fgetLine(&buf, &bufsz, 0, fp)) > 0) {
            lineno++;
            if (buf[x - 1] == '\n')
@@ -1598,7 +1598,7 @@
        if (!Lst_IsEmptyS(missingFiles)) {
            if (DEBUG(META))
                fprintf(debug_file, "%s: missing files: %s...\n",
-                       fname, (char *)Lst_DatumS(Lst_First(missingFiles)));
+                       fname, (char *)Lst_DatumS(Lst_FirstS(missingFiles)));
            oodate = TRUE;
        }
        if (!oodate && !have_filemon && filemonMissing) {
diff -r 070d644f2744 -r d7bd0f1ac7fe usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Fri Aug 28 04:05:35 2020 +0000
+++ b/usr.bin/make/suff.c       Fri Aug 28 04:14:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.122 2020/08/28 03:35:45 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.123 2020/08/28 04:14:31 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.122 2020/08/28 03:35:45 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.123 2020/08/28 04:14:31 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.122 2020/08/28 03:35:45 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.123 2020/08/28 04:14:31 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2062,7 +2062,7 @@
     /*
      * Begin at the beginning...
      */
-    ln = Lst_First(sufflist);
+    ln = Lst_FirstS(sufflist);
     srcs = Lst_Init();
     targs = Lst_Init();
 
@@ -2190,7 +2190,7 @@
             * for setting the local variables.
             */
            if (!Lst_IsEmptyS(targs)) {
-               targ = Lst_DatumS(Lst_First(targs));
+               targ = Lst_DatumS(Lst_FirstS(targs));
            } else {
                targ = NULL;
            }
@@ -2213,7 +2213,7 @@
      * Now we've got the important local variables set, expand any sources
      * that still contain variables or wildcards in their names.
      */
-    for (ln = Lst_First(gn->children); ln != NULL; ln = nln) {
+    for (ln = Lst_FirstS(gn->children); ln != NULL; ln = nln) {
        nln = Lst_SuccS(ln);
        SuffExpandChildren(ln, gn);
     }



Home | Main Index | Thread Index | Old Index