Module Name: src
Committed By: rillig
Date: Wed Feb 9 21:03:13 UTC 2022
Modified Files:
src/usr.bin/make: cond.c parse.c var.c
Log Message:
make: clean up variable names
No binary change.
To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/cond.c
cvs rdiff -u -r1.663 -r1.664 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1009 -r1.1010 src/usr.bin/make/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.327 src/usr.bin/make/cond.c:1.328
--- src/usr.bin/make/cond.c:1.327 Sat Jan 29 01:12:36 2022
+++ src/usr.bin/make/cond.c Wed Feb 9 21:03:13 2022
@@ -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 @@ FuncDefined(const char *var)
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;
}
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.663 src/usr.bin/make/parse.c:1.664
--- src/usr.bin/make/parse.c:1.663 Mon Feb 7 23:24:26 2022
+++ src/usr.bin/make/parse.c Wed Feb 9 21:03:13 2022
@@ -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 @@ PrintLocation(FILE *f, bool useVars, con
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 @@ ParseVErrorInternal(FILE *f, bool useVar
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 @@ ParseVErrorInternal(FILE *f, bool useVar
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 @@ ParseErrorInternal(const char *fname, un
* 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 @@ Parse_Error(ParseErrorLevel type, const
(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);
}
}
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1009 src/usr.bin/make/var.c:1.1010
--- src/usr.bin/make/var.c:1.1009 Fri Feb 4 23:43:10 2022
+++ src/usr.bin/make/var.c Wed Feb 9 21:03:13 2022
@@ -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 @@ found_op:
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] == '+')