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(1): rename Varf_Flags to VarEvalFlags



details:   https://anonhg.NetBSD.org/src/rev/dd3bc1a89128
branches:  trunk
changeset: 1011991:dd3bc1a89128
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 19 12:26:17 2020 +0000

description:
make(1): rename Varf_Flags to VarEvalFlags

In var.c there are lots of different flag types.  To make any accidental
mixture obvious, each flag group gets its own prefix.

The only flag group that is visible outside of var.c is concerned with
evaluating variables, therefore the "e", which replaces the former "f"
that probably just meant "flag".

diffstat:

 usr.bin/make/arch.c    |  14 ++++----
 usr.bin/make/compat.c  |   8 ++--
 usr.bin/make/cond.c    |  16 ++++----
 usr.bin/make/for.c     |   8 ++--
 usr.bin/make/job.c     |  12 +++---
 usr.bin/make/main.c    |  30 ++++++++--------
 usr.bin/make/make.c    |   8 ++--
 usr.bin/make/meta.c    |  20 +++++-----
 usr.bin/make/nonints.h |  14 ++++----
 usr.bin/make/parse.c   |  22 ++++++------
 usr.bin/make/suff.c    |  10 ++--
 usr.bin/make/var.c     |  86 +++++++++++++++++++++++++-------------------------
 12 files changed, 124 insertions(+), 124 deletions(-)

diffs (truncated from 1027 to 300 lines):

diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/arch.c       Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $ */
+/*     $NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -259,7 +259,7 @@
            void        *freeIt;
            char        *result;
 
-           result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+           result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
                               &length, &freeIt);
            free(freeIt);
 
@@ -275,7 +275,7 @@
 
     *cp++ = '\0';
     if (subLibName) {
-       libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES);
+       libName = Var_Subst(NULL, libName, ctxt, VARE_UNDEFERR|VARE_WANTRES);
     }
 
 
@@ -301,7 +301,7 @@
                void    *freeIt;
                char    *result;
 
-               result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+               result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
                                   &length, &freeIt);
                free(freeIt);
 
@@ -356,7 +356,7 @@
            size_t   sz;
 
            memName = Var_Subst(NULL, memName, ctxt,
-                               VARF_UNDEFERR|VARF_WANTRES);
+                               VARE_UNDEFERR|VARE_WANTRES);
 
            /*
             * Now form an archive spec and recurse to deal with nested
diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/compat.c     Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c   8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -235,7 +235,7 @@
     doIt = FALSE;
 
     cmdNode = Lst_Member(gn->commands, cmd);
-    cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
+    cmdStart = Var_Subst(NULL, cmd, gn, VARE_WANTRES);
 
     /*
      * brk_string will return an argv with a NULL in av[0], thus causing
diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/cond.c       Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $    */
+/*     $NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -287,8 +287,8 @@
            int         len;
            void        *freeIt;
 
-           cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|
-                           (doEval ? VARF_WANTRES : 0),
+           cp2 = Var_Parse(cp, VAR_CMD, VARE_UNDEFERR|
+                           (doEval ? VARE_WANTRES : 0),
                            &len, &freeIt);
            Buf_AddBytes(&buf, strlen(cp2), cp2);
            free(freeIt);
@@ -574,8 +574,8 @@
        case '$':
            /* if we are in quotes, then an undefined variable is ok */
            str = Var_Parse(condExpr, VAR_CMD,
-                           ((!qt && doEval) ? VARF_UNDEFERR : 0) |
-                           (doEval ? VARF_WANTRES : 0), &len, freeIt);
+                           ((!qt && doEval) ? VARE_UNDEFERR : 0) |
+                           (doEval ? VARE_WANTRES : 0), &len, freeIt);
            if (str == var_Error) {
                if (*freeIt) {
                    free(*freeIt);
@@ -830,7 +830,7 @@
     /* We do all the work here and return the result as the length */
     *argPtr = NULL;
 
-    val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARF_WANTRES : 0, &length, &freeIt);
+    val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARE_WANTRES : 0, &length, &freeIt);
     /*
      * Advance *linePtr to beyond the closing ). Note that
      * we subtract one because 'length' is calculated from 'cp - 1'.
diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/for.c        Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $  */
+/*     $NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $  */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -216,7 +216,7 @@
      * We can't do the escapes here - because we don't know whether
      * we are substuting into ${...} or $(...).
      */
-    sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARF_WANTRES);
+    sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARE_WANTRES);
 
     /*
      * Split into words allowing for quoted strings.
diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/job.c        Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -729,7 +729,7 @@
 
     numCommands += 1;
 
-    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARF_WANTRES);
+    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARE_WANTRES);
 
     cmdTemplate = "%s\n";
 
@@ -917,7 +917,7 @@
 static int
 JobSaveCommand(void *cmd, void *gn)
 {
-    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARF_WANTRES);
+    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARE_WANTRES);
     (void)Lst_AtEnd(postCommands->commands, cmd);
     return 0;
 }
@@ -2249,7 +2249,7 @@
     }
 
     targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}",
-                          VAR_GLOBAL, VARF_WANTRES);
+                          VAR_GLOBAL, VARE_WANTRES);
 }
 
 /*-
diff -r 9cb19e19cc7b -r dd3bc1a89128 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Jul 19 11:47:47 2020 +0000
+++ b/usr.bin/make/main.c       Sun Jul 19 12:26:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -772,7 +772,7 @@
 
        /* expand variable substitutions */
        if (strchr(path, '$') != 0)
-               xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARF_WANTRES);
+               xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARE_WANTRES);
        else
                xpath = path;
 
@@ -839,7 +839,7 @@
 
     if (!mode)
        mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}",
-                             VAR_GLOBAL, VARF_WANTRES);
+                             VAR_GLOBAL, VARE_WANTRES);
 
     if (mode && *mode) {
        if (strstr(mode, "compat")) {
@@ -876,7 +876,7 @@
 
                if (strchr(var, '$')) {
                        value = p1 = Var_Subst(NULL, var, VAR_GLOBAL,
-                           VARF_WANTRES);
+                           VARE_WANTRES);
                } else if (expandVars) {
                        char tmp[128];
                        int len = snprintf(tmp, sizeof(tmp), "${%s}", var);
@@ -885,7 +885,7 @@
                                Fatal("%s: variable name too big: %s",
                                    progname, var);
                        value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL,



Home | Main Index | Thread Index | Old Index