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): clean up Make_ExpandUse



details:   https://anonhg.NetBSD.org/src/rev/908f406ecd54
branches:  trunk
changeset: 1016096:908f406ecd54
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 11:37:46 2020 +0000

description:
make(1): clean up Make_ExpandUse

The targets need to be copied to the 'examine' queue, not because the
targets list would be modified but because the queue is modified and the
targets list should not be affected by that.

diffstat:

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

diffs (38 lines):

diff -r 5a3c1f77da0e -r 908f406ecd54 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sun Nov 08 11:28:44 2020 +0000
+++ b/usr.bin/make/make.c       Sun Nov 08 11:37:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.202 2020/11/08 11:28:44 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.203 2020/11/08 11:37:46 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.202 2020/11/08 11:28:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.203 2020/11/08 11:37:46 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -1116,17 +1116,8 @@
 void
 Make_ExpandUse(GNodeList *targs)
 {
-    GNodeList *examine;                /* List of targets to examine */
-
-    {
-       /* XXX: Why is it necessary to copy the list? There shouldn't be
-        * any modifications to the list, at least the function name
-        * ExpandUse doesn't suggest that. */
-       GNodeListNode *ln;
-       examine = Lst_New();
-       for (ln = targs->first; ln != NULL; ln = ln->next)
-           Lst_Append(examine, ln->datum);
-    }
+    GNodeList *examine = Lst_New();    /* Queue of targets to examine */
+    Lst_AppendAll(examine, targs);
 
     /*
      * Make an initial downward pass over the graph, marking nodes to be made



Home | Main Index | Thread Index | Old Index