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 variable names



details:   https://anonhg.NetBSD.org/src/rev/015d1a8b8cc5
branches:  trunk
changeset: 361103:015d1a8b8cc5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Feb 09 21:03:13 2022 +0000

description:
make: clean up variable names

No binary change.

diffstat:

 usr.bin/make/cond.c  |  10 +++++-----
 usr.bin/make/parse.c |  24 ++++++++++++------------
 usr.bin/make/var.c   |  10 +++++-----
 3 files changed, 22 insertions(+), 22 deletions(-)

diffs (163 lines):

diff -r e9ae7013368b -r 015d1a8b8cc5 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Wed Feb 09 20:52:06 2022 +0000
+++ b/usr.bin/make/cond.c       Wed Feb 09 21:03:13 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.327 2022/01/29 01:12:36 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.328 2022/02/09 21:03:13 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.327 2022/01/29 01:12:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.328 2022/02/09 21:03:13 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -293,14 +293,14 @@
        return Var_Exists(SCOPE_CMDLINE, var);
 }
 
-/* See if the given target is requested to be made. */
+/* See if a target matching targetPattern is requested to be made. */
 static bool
-FuncMake(const char *target)
+FuncMake(const char *targetPattern)
 {
        StringListNode *ln;
 
        for (ln = opts.create.first; ln != NULL; ln = ln->next)
-               if (Str_Match(ln->datum, target))
+               if (Str_Match(ln->datum, targetPattern))
                        return true;
        return false;
 }
diff -r e9ae7013368b -r 015d1a8b8cc5 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Wed Feb 09 20:52:06 2022 +0000
+++ b/usr.bin/make/parse.c      Wed Feb 09 21:03:13 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.663 2022/02/07 23:24:26 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.664 2022/02/09 21:03:13 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.663 2022/02/07 23:24:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.664 2022/02/09 21:03:13 rillig Exp $");
 
 /*
  * A file being read.
@@ -464,7 +464,7 @@
 
 static void MAKE_ATTR_PRINTFLIKE(6, 0)
 ParseVErrorInternal(FILE *f, bool useVars, const char *fname, unsigned lineno,
-                   ParseErrorLevel type, const char *fmt, va_list ap)
+                   ParseErrorLevel level, const char *fmt, va_list ap)
 {
        static bool fatal_warning_error_printed = false;
 
@@ -472,15 +472,15 @@
 
        if (fname != NULL)
                PrintLocation(f, useVars, fname, lineno);
-       if (type == PARSE_WARNING)
+       if (level == PARSE_WARNING)
                (void)fprintf(f, "warning: ");
        (void)vfprintf(f, fmt, ap);
        (void)fprintf(f, "\n");
        (void)fflush(f);
 
-       if (type == PARSE_FATAL)
+       if (level == PARSE_FATAL)
                parseErrors++;
-       if (type == PARSE_WARNING && opts.parseWarnFatal) {
+       if (level == PARSE_WARNING && opts.parseWarnFatal) {
                if (!fatal_warning_error_printed) {
                        Error("parsing warnings being treated as errors");
                        fatal_warning_error_printed = true;
@@ -494,19 +494,19 @@
 
 static void MAKE_ATTR_PRINTFLIKE(4, 5)
 ParseErrorInternal(const char *fname, unsigned lineno,
-                  ParseErrorLevel type, const char *fmt, ...)
+                  ParseErrorLevel level, const char *fmt, ...)
 {
        va_list ap;
 
        (void)fflush(stdout);
        va_start(ap, fmt);
-       ParseVErrorInternal(stderr, false, fname, lineno, type, fmt, ap);
+       ParseVErrorInternal(stderr, false, fname, lineno, level, fmt, ap);
        va_end(ap);
 
        if (opts.debug_file != stdout && opts.debug_file != stderr) {
                va_start(ap, fmt);
                ParseVErrorInternal(opts.debug_file, false, fname, lineno,
-                   type, fmt, ap);
+                   level, fmt, ap);
                va_end(ap);
        }
 }
@@ -520,7 +520,7 @@
  * Fmt is given without a trailing newline.
  */
 void
-Parse_Error(ParseErrorLevel type, const char *fmt, ...)
+Parse_Error(ParseErrorLevel level, const char *fmt, ...)
 {
        va_list ap;
        const char *fname;
@@ -537,13 +537,13 @@
 
        (void)fflush(stdout);
        va_start(ap, fmt);
-       ParseVErrorInternal(stderr, true, fname, lineno, type, fmt, ap);
+       ParseVErrorInternal(stderr, true, fname, lineno, level, fmt, ap);
        va_end(ap);
 
        if (opts.debug_file != stdout && opts.debug_file != stderr) {
                va_start(ap, fmt);
                ParseVErrorInternal(opts.debug_file, true, fname, lineno,
-                   type, fmt, ap);
+                   level, fmt, ap);
                va_end(ap);
        }
 }
diff -r e9ae7013368b -r 015d1a8b8cc5 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Wed Feb 09 20:52:06 2022 +0000
+++ b/usr.bin/make/var.c        Wed Feb 09 21:03:13 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.1009 2022/02/04 23:43:10 rillig Exp $        */
+/*     $NetBSD: var.c,v 1.1010 2022/02/09 21:03:13 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1009 2022/02/04 23:43:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1010 2022/02/09 21:03:13 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -3480,11 +3480,11 @@
 
        scope = expr->scope;    /* scope where v belongs */
        if (expr->defined == DEF_REGULAR && expr->scope != SCOPE_GLOBAL) {
-               Var *gv = VarFind(expr->name, expr->scope, false);
-               if (gv == NULL)
+               Var *v = VarFind(expr->name, expr->scope, false);
+               if (v == NULL)
                        scope = SCOPE_GLOBAL;
                else
-                       VarFreeShortLived(gv);
+                       VarFreeShortLived(v);
        }
 
        if (op[0] == '+')



Home | Main Index | Thread Index | Old Index