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): extract PretendAllChildrenAreMade from...



details:   https://anonhg.NetBSD.org/src/rev/10b1cc129ab0
branches:  trunk
changeset: 942452:10b1cc129ab0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 10:40:07 2020 +0000

description:
make(1): extract PretendAllChildrenAreMade from Make_ExpandUse

diffstat:

 usr.bin/make/make.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 885ca470832d -r 10b1cc129ab0 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sun Nov 08 10:33:47 2020 +0000
+++ b/usr.bin/make/make.c       Sun Nov 08 10:40:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.197 2020/11/08 10:33:47 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.198 2020/11/08 10:40:07 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -108,7 +108,7 @@
 #include "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.197 2020/11/08 10:33:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.198 2020/11/08 10:40:07 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -377,6 +377,12 @@
     return 0;
 }
 
+static void
+PretendAllChildrenAreMade(GNode *gn)
+{
+    Lst_ForEachUntil(gn->children, MakeFindChild, gn);
+}
+
 /* Called by Make_Run and SuffApplyTransform on the downward pass to handle
  * .USE and transformation nodes, by copying the child node's commands, type
  * flags and children to the parent node.
@@ -1177,8 +1183,7 @@
        if (!(gn->type & OP_MADE))
            Suff_FindDeps(gn);
        else {
-           /* Pretend we made all this node's children */
-           Lst_ForEachUntil(gn->children, MakeFindChild, gn);
+           PretendAllChildrenAreMade(gn);
            if (gn->unmade != 0)
                    printf("Warning: %s%s still has %d unmade children\n",
                            gn->name, gn->cohort_num, gn->unmade);



Home | Main Index | Thread Index | Old Index