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: clean up ParseDependency



details:   https://anonhg.NetBSD.org/src/rev/fa6cb64af143
branches:  trunk
changeset: 1029261:fa6cb64af143
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 28 19:01:36 2021 +0000

description:
make: clean up ParseDependency

No functional change.

diffstat:

 usr.bin/make/parse.c |  38 ++++++++++++++++----------------------
 1 files changed, 16 insertions(+), 22 deletions(-)

diffs (70 lines):

diff -r e4fd2066e507 -r fa6cb64af143 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Tue Dec 28 17:58:41 2021 +0000
+++ b/usr.bin/make/parse.c      Tue Dec 28 19:01:36 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.599 2021/12/28 17:58:41 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.600 2021/12/28 19:01:36 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.599 2021/12/28 17:58:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.600 2021/12/28 19:01:36 rillig Exp $");
 
 /* types and constants */
 
@@ -1608,37 +1608,31 @@
 static void
 ParseDependency(char *line)
 {
-       char *cp;               /* our current position */
-       GNodeType op;           /* the dependency operator on the line */
+       char *p;
        SearchPathList *paths;  /* search paths to alter when parsing a list
                                 * of .PATH targets */
        GNodeType targetAttr;   /* from special sources */
-
-       /*
-        * In special targets, the children are linked as children of the
-        * parent but not vice versa.
-        */
-       ParseSpecial special = SP_NOT;
+       ParseSpecial special;   /* in special targets, the children are
+                                * linked as children of the parent but not
+                                * vice versa */
 
        DEBUG1(PARSE, "ParseDependency(%s)\n", line);
-       targetAttr = OP_NONE;
-
+       p = line;
        paths = NULL;
-
-       cp = line;
-       if (!ParseDependencyTargets(&cp, line, &special,
-           &targetAttr, &paths))
+       targetAttr = OP_NONE;
+       special = SP_NOT;
+
+       if (!ParseDependencyTargets(&p, line, &special, &targetAttr, &paths))
                goto out;
 
        if (!Lst_IsEmpty(targets))
                ParseDependencyCheckSpecial(special);
 
-       op = ParseDependencyOp(&cp);
-       ApplyDependencyOperator(op);
-
-       pp_skip_whitespace(&cp);
-
-       ParseDependencySources(cp, targetAttr, special, &paths);
+       ApplyDependencyOperator(ParseDependencyOp(&p));
+
+       pp_skip_whitespace(&p);
+
+       ParseDependencySources(p, targetAttr, special, &paths);
 
 out:
        if (paths != NULL)



Home | Main Index | Thread Index | Old Index