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): merge duplicate code in Parse_MainName



details:   https://anonhg.NetBSD.org/src/rev/89f71b3d7f1b
branches:  trunk
changeset: 950221:89f71b3d7f1b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jan 21 14:30:01 2021 +0000

description:
make(1): merge duplicate code in Parse_MainName

diffstat:

 usr.bin/make/make.h  |   7 +++++--
 usr.bin/make/parse.c |  10 ++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diffs (53 lines):

diff -r 3a85db6f1346 -r 89f71b3d7f1b usr.bin/make/make.h
--- a/usr.bin/make/make.h       Thu Jan 21 14:24:25 2021 +0000
+++ b/usr.bin/make/make.h       Thu Jan 21 14:30:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.244 2021/01/19 20:51:46 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.245 2021/01/21 14:30:01 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -413,7 +413,10 @@
         * this node, in the normal sense. */
        GNodeList order_succ;
 
-       /* Other nodes of the same name, for the '::' dependency operator. */
+       /*
+        * Other nodes of the same name, for targets that were defined using
+        * the '::' dependency operator (OP_DOUBLEDEP).
+        */
        GNodeList cohorts;
        /* The "#n" suffix for this cohort, or "" for other nodes */
        char cohort_num[8];
diff -r 3a85db6f1346 -r 89f71b3d7f1b usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Thu Jan 21 14:24:25 2021 +0000
+++ b/usr.bin/make/parse.c      Thu Jan 21 14:30:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.526 2021/01/10 21:20:46 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.527 2021/01/21 14:30:01 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.526 2021/01/10 21:20:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.527 2021/01/21 14:30:01 rillig Exp $");
 
 /* types and constants */
 
@@ -3259,11 +3259,9 @@
        if (mainNode == NULL)
                Punt("no target to make.");
 
-       if (mainNode->type & OP_DOUBLEDEP) {
-               Lst_Append(mainList, mainNode);
+       Lst_Append(mainList, mainNode);
+       if (mainNode->type & OP_DOUBLEDEP)
                Lst_AppendAll(mainList, &mainNode->cohorts);
-       } else
-               Lst_Append(mainList, mainNode);
 
        Var_Append(".TARGETS", mainNode->name, VAR_GLOBAL);
 }



Home | Main Index | Thread Index | Old Index