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: extract HandleSingleDependencyTargetMundane



details:   https://anonhg.NetBSD.org/src/rev/125cfa888aad
branches:  trunk
changeset: 366741:125cfa888aad
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jun 11 16:47:24 2022 +0000

description:
make: extract HandleSingleDependencyTargetMundane

No functional change.

diffstat:

 usr.bin/make/parse.c |  24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diffs (52 lines):

diff -r e416dc71e38a -r 125cfa888aad usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Jun 11 16:43:16 2022 +0000
+++ b/usr.bin/make/parse.c      Sat Jun 11 16:47:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $");
 
 /*
  * A file being read.
@@ -1021,6 +1021,18 @@
 }
 
 static void
+HandleSingleDependencyTargetMundane(const char *name)
+{
+       GNode *gn = Suff_IsTransform(name)
+           ? Suff_AddTransform(name)
+           : Targ_GetNode(name);
+       if (doing_depend)
+               RememberLocation(gn);
+
+       Lst_Append(targets, gn);
+}
+
+static void
 HandleDependencyTargetMundane(char *targetName)
 {
        StringList targetNames = LST_INIT;
@@ -1034,13 +1046,7 @@
 
        while (!Lst_IsEmpty(&targetNames)) {
                char *targName = Lst_Dequeue(&targetNames);
-               GNode *gn = Suff_IsTransform(targName)
-                   ? Suff_AddTransform(targName)
-                   : Targ_GetNode(targName);
-               if (doing_depend)
-                       RememberLocation(gn);
-
-               Lst_Append(targets, gn);
+               HandleSingleDependencyTargetMundane(targName);
        }
 }
 



Home | Main Index | Thread Index | Old Index