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: replace Global_AppendExpand with Global_A...



details:   https://anonhg.NetBSD.org/src/rev/f039b6081fbd
branches:  trunk
changeset: 959178:f039b6081fbd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Feb 03 13:53:12 2021 +0000

description:
make: replace Global_AppendExpand with Global_Append

All callers with a variable name that is guaranteed to not contain a
dollar sign have been converted to call Global_Append instead of the
previous Global_AppendExpand.  After that, Global_AppendExpand was
unused, therefore it was effectively just renamed.

diffstat:

 usr.bin/make/dir.c     |  16 +++++-----
 usr.bin/make/job.c     |   8 ++--
 usr.bin/make/main.c    |  72 +++++++++++++++++++++++++-------------------------
 usr.bin/make/meta.c    |  10 +++---
 usr.bin/make/nonints.h |   4 +-
 usr.bin/make/parse.c   |  10 +++---
 usr.bin/make/targ.c    |   6 ++--
 usr.bin/make/var.c     |  12 ++++----
 8 files changed, 69 insertions(+), 69 deletions(-)

diffs (truncated from 484 to 300 lines):

diff -r c8d31d455645 -r f039b6081fbd usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Wed Feb 03 13:44:39 2021 +0000
+++ b/usr.bin/make/dir.c        Wed Feb 03 13:53:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.267 2021/02/03 13:53:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.267 2021/02/03 13:53:12 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -555,15 +555,15 @@
                CachedDir *dir = ln->datum;
                if (dir == dotLast) {
                        seenDotLast = TRUE;
-                       Global_AppendExpand(".PATH", dotLast->name);
+                       Global_Append(".PATH", dotLast->name);
                }
        }
 
        if (!seenDotLast) {
                if (dot != NULL)
-                       Global_AppendExpand(".PATH", dot->name);
+                       Global_Append(".PATH", dot->name);
                if (cur != NULL)
-                       Global_AppendExpand(".PATH", cur->name);
+                       Global_Append(".PATH", cur->name);
        }
 
        for (ln = dirSearchPath.dirs.first; ln != NULL; ln = ln->next) {
@@ -572,14 +572,14 @@
                        continue;
                if (dir == dot && seenDotLast)
                        continue;
-               Global_AppendExpand(".PATH", dir->name);
+               Global_Append(".PATH", dir->name);
        }
 
        if (seenDotLast) {
                if (dot != NULL)
-                       Global_AppendExpand(".PATH", dot->name);
+                       Global_Append(".PATH", dot->name);
                if (cur != NULL)
-                       Global_AppendExpand(".PATH", cur->name);
+                       Global_Append(".PATH", cur->name);
        }
 }
 
diff -r c8d31d455645 -r f039b6081fbd usr.bin/make/job.c
--- a/usr.bin/make/job.c        Wed Feb 03 13:44:39 2021 +0000
+++ b/usr.bin/make/job.c        Wed Feb 03 13:53:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.415 2021/02/03 13:53:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.415 2021/02/03 13:53:12 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2791,8 +2791,8 @@
        snprintf(jobarg, sizeof jobarg, "%d,%d",
            tokenWaitJob.inPipe, tokenWaitJob.outPipe);
 
-       Global_AppendExpand(MAKEFLAGS, "-J");
-       Global_AppendExpand(MAKEFLAGS, jobarg);
+       Global_Append(MAKEFLAGS, "-J");
+       Global_Append(MAKEFLAGS, jobarg);
 
        /*
         * Preload the job pipe with one token per job, save the one
diff -r c8d31d455645 -r f039b6081fbd usr.bin/make/main.c
--- a/usr.bin/make/main.c       Wed Feb 03 13:44:39 2021 +0000
+++ b/usr.bin/make/main.c       Wed Feb 03 13:53:12 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.529 2021/02/03 13:53:12 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.529 2021/02/03 13:53:12 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -409,8 +409,8 @@
                jp_1 = -1;
                opts.compatMake = TRUE;
        } else {
-               Global_AppendExpand(MAKEFLAGS, "-J");
-               Global_AppendExpand(MAKEFLAGS, argvalue);
+               Global_Append(MAKEFLAGS, "-J");
+               Global_Append(MAKEFLAGS, argvalue);
        }
 }
 
@@ -427,8 +427,8 @@
                    progname);
                exit(2);        /* Not 1 so -q can distinguish error */
        }
-       Global_AppendExpand(MAKEFLAGS, "-j");
-       Global_AppendExpand(MAKEFLAGS, argvalue);
+       Global_Append(MAKEFLAGS, "-j");
+       Global_Append(MAKEFLAGS, argvalue);
        Global_Set(".MAKE.JOBS", argvalue);
        maxJobTokens = opts.maxJobs;
 }
@@ -446,8 +446,8 @@
        } else {
                (void)SearchPath_Add(sysIncPath, argvalue);
        }
-       Global_AppendExpand(MAKEFLAGS, "-m");
-       Global_AppendExpand(MAKEFLAGS, argvalue);
+       Global_Append(MAKEFLAGS, "-m");
+       Global_Append(MAKEFLAGS, argvalue);
 }
 
 static Boolean
@@ -458,7 +458,7 @@
                break;
        case 'B':
                opts.compatMake = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-B");
+               Global_Append(MAKEFLAGS, "-B");
                Global_Set(MAKE_MODE, "compat");
                break;
        case 'C':
@@ -467,13 +467,13 @@
        case 'D':
                if (argvalue[0] == '\0') return FALSE;
                Global_SetExpand(argvalue, "1");
-               Global_AppendExpand(MAKEFLAGS, "-D");
-               Global_AppendExpand(MAKEFLAGS, argvalue);
+               Global_Append(MAKEFLAGS, "-D");
+               Global_Append(MAKEFLAGS, argvalue);
                break;
        case 'I':
                Parse_AddIncludeDir(argvalue);
-               Global_AppendExpand(MAKEFLAGS, "-I");
-               Global_AppendExpand(MAKEFLAGS, argvalue);
+               Global_Append(MAKEFLAGS, "-I");
+               Global_Append(MAKEFLAGS, argvalue);
                break;
        case 'J':
                MainParseArgJobsInternal(argvalue);
@@ -481,24 +481,24 @@
        case 'N':
                opts.noExecute = TRUE;
                opts.noRecursiveExecute = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-N");
+               Global_Append(MAKEFLAGS, "-N");
                break;
        case 'S':
                opts.keepgoing = FALSE;
-               Global_AppendExpand(MAKEFLAGS, "-S");
+               Global_Append(MAKEFLAGS, "-S");
                break;
        case 'T':
                tracefile = bmake_strdup(argvalue);
-               Global_AppendExpand(MAKEFLAGS, "-T");
-               Global_AppendExpand(MAKEFLAGS, argvalue);
+               Global_Append(MAKEFLAGS, "-T");
+               Global_Append(MAKEFLAGS, argvalue);
                break;
        case 'V':
        case 'v':
                opts.printVars = c == 'v' ? PVM_EXPANDED : PVM_UNEXPANDED;
                Lst_Append(&opts.variables, bmake_strdup(argvalue));
                /* XXX: Why always -V? */
-               Global_AppendExpand(MAKEFLAGS, "-V");
-               Global_AppendExpand(MAKEFLAGS, argvalue);
+               Global_Append(MAKEFLAGS, "-V");
+               Global_Append(MAKEFLAGS, argvalue);
                break;
        case 'W':
                opts.parseWarnFatal = TRUE;
@@ -506,35 +506,35 @@
                break;
        case 'X':
                opts.varNoExportEnv = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-X");
+               Global_Append(MAKEFLAGS, "-X");
                break;
        case 'd':
                /* If '-d-opts' don't pass to children */
                if (argvalue[0] == '-')
                        argvalue++;
                else {
-                       Global_AppendExpand(MAKEFLAGS, "-d");
-                       Global_AppendExpand(MAKEFLAGS, argvalue);
+                       Global_Append(MAKEFLAGS, "-d");
+                       Global_Append(MAKEFLAGS, argvalue);
                }
                MainParseArgDebug(argvalue);
                break;
        case 'e':
                opts.checkEnvFirst = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-e");
+               Global_Append(MAKEFLAGS, "-e");
                break;
        case 'f':
                Lst_Append(&opts.makefiles, bmake_strdup(argvalue));
                break;
        case 'i':
                opts.ignoreErrors = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-i");
+               Global_Append(MAKEFLAGS, "-i");
                break;
        case 'j':
                MainParseArgJobs(argvalue);
                break;
        case 'k':
                opts.keepgoing = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-k");
+               Global_Append(MAKEFLAGS, "-k");
                break;
        case 'm':
                MainParseArgSysInc(argvalue);
@@ -542,28 +542,28 @@
                break;
        case 'n':
                opts.noExecute = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-n");
+               Global_Append(MAKEFLAGS, "-n");
                break;
        case 'q':
                opts.queryFlag = TRUE;
                /* Kind of nonsensical, wot? */
-               Global_AppendExpand(MAKEFLAGS, "-q");
+               Global_Append(MAKEFLAGS, "-q");
                break;
        case 'r':
                opts.noBuiltins = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-r");
+               Global_Append(MAKEFLAGS, "-r");
                break;
        case 's':
                opts.beSilent = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-s");
+               Global_Append(MAKEFLAGS, "-s");
                break;
        case 't':
                opts.touchFlag = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-t");
+               Global_Append(MAKEFLAGS, "-t");
                break;
        case 'w':
                opts.enterFlag = TRUE;
-               Global_AppendExpand(MAKEFLAGS, "-w");
+               Global_Append(MAKEFLAGS, "-w");
                break;
        default:
        case '?':
@@ -963,7 +963,7 @@
 
        for (ln = opts.create.first; ln != NULL; ln = ln->next) {
                const char *name = ln->datum;
-               Global_AppendExpand(".TARGETS", name);
+               Global_Append(".TARGETS", name);
        }
 }
 
@@ -1253,8 +1253,8 @@
        }
 
        if (n != opts.maxJobs) {
-               Global_AppendExpand(MAKEFLAGS, "-j");
-               Global_AppendExpand(MAKEFLAGS, value);
+               Global_Append(MAKEFLAGS, "-j");
+               Global_Append(MAKEFLAGS, value);
        }
 
        opts.maxJobs = n;
@@ -1561,7 +1561,7 @@
 
        {
                FStr makeflags = Var_Value(MAKEFLAGS, VAR_GLOBAL);
-               Global_AppendExpand("MFLAGS", makeflags.str);
+               Global_Append("MFLAGS", makeflags.str);
                FStr_Done(&makeflags);
        }
 
@@ -2112,7 +2112,7 @@



Home | Main Index | Thread Index | Old Index