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): inline Lst_ForEach in MakeUnmark



details:   https://anonhg.NetBSD.org/src/rev/117b538da114
branches:  trunk
changeset: 939095:117b538da114
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 25 14:00:17 2020 +0000

description:
make(1): inline Lst_ForEach in MakeUnmark

By the way, the additional argument to Lst_ForEach was not used at all.

diffstat:

 usr.bin/make/make.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (64 lines):

diff -r e27f20d8c281 -r 117b538da114 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Fri Sep 25 13:08:00 2020 +0000
+++ b/usr.bin/make/make.c       Fri Sep 25 14:00:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.143 2020/09/24 07:37:42 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.144 2020/09/25 14:00:17 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.143 2020/09/24 07:37:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.144 2020/09/25 14:00:17 rillig Exp $");
 
 static unsigned int checked = 1;/* Sequence # to detect recursion */
 static GNodeList *toBeMade;    /* The current fringe of the graph. These
@@ -836,11 +836,14 @@
 }
 
 static void
-MakeUnmark(void *cgnp, void *pgnp MAKE_ATTR_UNUSED)
+UnmarkChildren(GNode *gn)
 {
-    GNode      *cgn = (GNode *)cgnp;
+    GNodeListNode *ln;
 
-    cgn->type &= ~OP_MARK;
+    for (ln = gn->children->first; ln != NULL; ln = ln->next) {
+       GNode *child = ln->datum;
+       child->type &= ~OP_MARK;
+    }
 }
 
 /*-
@@ -950,7 +953,7 @@
     if (gn->flags & DONE_ALLSRC)
        return;
 
-    Lst_ForEach(gn->children, MakeUnmark, gn);
+    UnmarkChildren(gn);
     Lst_ForEach(gn->children, MakeAddAllSrc, gn);
 
     if (!Var_Exists (OODATE, gn)) {
@@ -1145,9 +1148,6 @@
  *
  * Input:
  *     gnp             Node to examine
- *     cyclep          True if gn->unmade being non-zero implies a
- *                     cycle in the graph, not an error in an
- *                     inferior.
  *
  * Results:
  *     Always returns 0.
@@ -1315,7 +1315,7 @@
 
        (void)Dir_MTime(gn, 0);
        Var_Set(TARGET, gn->path ? gn->path : gn->name, gn);
-       Lst_ForEach(gn->children, MakeUnmark, gn);
+       UnmarkChildren(gn);
        Lst_ForEachUntil(gn->children, MakeHandleUse, gn);
 
        if ((gn->type & OP_MADE) == 0)



Home | Main Index | Thread Index | Old Index