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 comments and names in parse.c



details:   https://anonhg.NetBSD.org/src/rev/6e737092ecba
branches:  trunk
changeset: 359480:6e737092ecba
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jan 07 14:03:55 2022 +0000

description:
make: clean up comments and names in parse.c

No binary change except for assertion line numbers.

diffstat:

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

diffs (108 lines):

diff -r 26cd92931326 -r 6e737092ecba usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Jan 07 13:56:09 2022 +0000
+++ b/usr.bin/make/parse.c      Fri Jan 07 14:03:55 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.627 2022/01/07 13:56:09 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.628 2022/01/07 14:03:55 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.627 2022/01/07 13:56:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.628 2022/01/07 14:03:55 rillig Exp $");
 
 /*
  * A file being read.
@@ -137,9 +137,7 @@
        struct ForLoop *forLoop;
 } IncludedFile;
 
-/*
- * Tokens for target attributes
- */
+/* Special attributes for target nodes. */
 typedef enum ParseSpecial {
        SP_ATTRIBUTE,   /* Generic attribute */
        SP_BEGIN,       /* .BEGIN */
@@ -207,11 +205,10 @@
 
 /*
  * Predecessor node for handling .ORDER. Initialized to NULL when .ORDER
- * seen, then set to each successive source on the line.
+ * is seen, then set to each successive source on the line.
  */
 static GNode *order_pred;
 
-/* number of fatal errors */
 static int parseErrors = 0;
 
 /*
@@ -384,10 +381,10 @@
 static bool
 IsEscaped(const char *line, const char *p)
 {
-       bool active = false;
+       bool escaped = false;
        while (p > line && *--p == '\\')
-               active = !active;
-       return active;
+               escaped = !escaped;
+       return escaped;
 }
 
 /*
@@ -991,9 +988,7 @@
        return true;
 }
 
-/*
- * See if it's a special target and if so set inout_special to match it.
- */
+/* See if it's a special target and if so set inout_special to match it. */
 static bool
 HandleDependencyTarget(const char *targetName,
                       ParseSpecial *inout_special,
@@ -1059,23 +1054,23 @@
 SkipExtraTargets(char **pp, const char *lstart)
 {
        bool warning = false;
-       const char *cp = *pp;
-
-       while (*cp != '\0') {
-               if (!IsEscaped(lstart, cp) && (*cp == '!' || *cp == ':'))
+       const char *p = *pp;
+
+       while (*p != '\0') {
+               if (!IsEscaped(lstart, p) && (*p == '!' || *p == ':'))
                        break;
-               if (IsEscaped(lstart, cp) || (*cp != ' ' && *cp != '\t'))
+               if (IsEscaped(lstart, p) || (*p != ' ' && *p != '\t'))
                        warning = true;
-               cp++;
+               p++;
        }
        if (warning)
                Parse_Error(PARSE_WARNING, "Extra target ignored");
 
-       *pp += cp - *pp;
+       *pp += p - *pp;
 }
 
 static void
-ParseDependencyCheckSpecial(ParseSpecial special)
+CheckSpecialMundaneMixture(ParseSpecial special)
 {
        switch (special) {
        case SP_DEFAULT:
@@ -1449,7 +1444,7 @@
                goto out;
 
        if (!Lst_IsEmpty(targets))
-               ParseDependencyCheckSpecial(special);
+               CheckSpecialMundaneMixture(special);
 
        ApplyDependencyOperator(ParseDependencyOp(&p));
 



Home | Main Index | Thread Index | Old Index