Module Name:    src
Committed By:   rillig
Date:           Sun Nov  8 10:40:07 UTC 2020

Modified Files:
        src/usr.bin/make: make.c

Log Message:
make(1): extract PretendAllChildrenAreMade from Make_ExpandUse


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/usr.bin/make/make.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/make.c
diff -u src/usr.bin/make/make.c:1.197 src/usr.bin/make/make.c:1.198
--- src/usr.bin/make/make.c:1.197	Sun Nov  8 10:33:47 2020
+++ src/usr.bin/make/make.c	Sun Nov  8 10:40:07 2020
@@ -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 @@ MakeFindChild(void *gnp, void *pgnp)
     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 @@ Make_ExpandUse(GNodeList *targs)
 	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);

Reply via email to