Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Collapse the 3 boolean parameter to 1 flags par...



details:   https://anonhg.NetBSD.org/src/rev/2f9471cb0ce0
branches:  trunk
changeset: 343644:2f9471cb0ce0
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Feb 18 18:29:14 2016 +0000

description:
Collapse the 3 boolean parameter to 1 flags parameter. No functional change.

diffstat:

 usr.bin/make/arch.c    |   17 ++-
 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    |   28 +++---
 usr.bin/make/make.c    |    8 +-
 usr.bin/make/make.h    |    6 +-
 usr.bin/make/nonints.h |    7 +-
 usr.bin/make/parse.c   |   23 +++---
 usr.bin/make/suff.c    |   11 +-
 usr.bin/make/var.c     |  177 ++++++++++++++++++++++++------------------------
 12 files changed, 165 insertions(+), 156 deletions(-)

diffs (truncated from 1198 to 300 lines):

diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/arch.c       Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $       */
+/*     $NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos 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.67 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: arch.c,v 1.68 2016/02/18 18:29:14 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -259,7 +259,8 @@
            void        *freeIt;
            char        *result;
 
-           result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, &length, &freeIt);
+           result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+                              &length, &freeIt);
            free(freeIt);
 
            if (result == var_Error) {
@@ -274,7 +275,7 @@
 
     *cp++ = '\0';
     if (subLibName) {
-       libName = Var_Subst(NULL, libName, ctxt, TRUE, TRUE, FALSE);
+       libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES);
     }
 
 
@@ -300,7 +301,8 @@
                void    *freeIt;
                char    *result;
 
-               result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, &length, &freeIt);
+               result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+                                  &length, &freeIt);
                free(freeIt);
 
                if (result == var_Error) {
@@ -353,7 +355,8 @@
            char    *oldMemName = memName;
            size_t   sz;
 
-           memName = Var_Subst(NULL, memName, ctxt, TRUE, TRUE, FALSE);
+           memName = Var_Subst(NULL, memName, ctxt,
+                               VARF_UNDEFERR|VARF_WANTRES);
 
            /*
             * Now form an archive spec and recurse to deal with nested
diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/compat.c     Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $    */
+/*     $NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos 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.103 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos 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.103 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.104 2016/02/18 18:29:14 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -210,7 +210,7 @@
     doIt = FALSE;
     
     cmdNode = Lst_Member(gn->commands, cmd);
-    cmdStart = Var_Subst(NULL, cmd, gn, FALSE, TRUE, FALSE);
+    cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
 
     /*
      * brk_string will return an argv with a NULL in av[0], thus causing
diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/cond.c       Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.73 2016/01/17 17:45:21 christos Exp $       */
+/*     $NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos 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.73 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos 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.73 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -289,7 +289,8 @@
            int         len;
            void        *freeIt;
 
-           cp2 = Var_Parse(cp, VAR_CMD, TRUE, TRUE, FALSE, &len, &freeIt);
+           cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+                           &len, &freeIt);
            Buf_AddBytes(&buf, strlen(cp2), cp2);
            free(freeIt);
            cp += len;
@@ -573,8 +574,9 @@
            break;
        case '$':
            /* if we are in quotes, then an undefined variable is ok */
-           str = Var_Parse(condExpr, VAR_CMD, (qt ? 0 : doEval),
-                           TRUE, FALSE, &len, freeIt);
+           str = Var_Parse(condExpr, VAR_CMD,
+                           ((!qt && doEval) ? VARF_UNDEFERR : 0) |
+                           VARF_WANTRES, &len, freeIt);
            if (str == var_Error) {
                if (*freeIt) {
                    free(*freeIt);
@@ -824,7 +826,7 @@
     /* We do all the work here and return the result as the length */
     *argPtr = NULL;
 
-    val = Var_Parse(cp - 1, VAR_CMD, FALSE, TRUE, FALSE, &length, &freeIt);
+    val = Var_Parse(cp - 1, VAR_CMD, VARF_WANTRES, &length, &freeIt);
     /*
      * Advance *linePtr to beyond the closing ). Note that
      * we subtract one because 'length' is calculated from 'cp - 1'.
diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/for.c        Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.51 2016/01/09 00:55:17 christos Exp $        */
+/*     $NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos 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.51 2016/01/09 00:55:17 christos Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos 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.51 2016/01/09 00:55:17 christos Exp $");
+__RCSID("$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos 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, FALSE, TRUE, FALSE);
+    sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARF_WANTRES);
 
     /*
      * Split into words allowing for quoted strings.
diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/job.c        Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.185 2016/01/17 17:45:21 christos Exp $       */
+/*     $NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos 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.185 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos 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.185 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.186 2016/02/18 18:29:14 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -701,7 +701,7 @@
 
     numCommands += 1;
 
-    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, FALSE, TRUE, FALSE);
+    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARF_WANTRES);
 
     cmdTemplate = "%s\n";
 
@@ -888,7 +888,7 @@
 static int
 JobSaveCommand(void *cmd, void *gn)
 {
-    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, FALSE, TRUE, FALSE);
+    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARF_WANTRES);
     (void)Lst_AtEnd(postCommands->commands, cmd);
     return(0);
 }
@@ -2176,7 +2176,7 @@
     }
 
     targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}",
-                          VAR_GLOBAL, FALSE, TRUE, FALSE);
+                          VAR_GLOBAL, VARF_WANTRES);
 }
 
 /*-
diff -r bcd06b01719a -r 2f9471cb0ce0 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Thu Feb 18 15:42:44 2016 +0000
+++ b/usr.bin/make/main.c       Thu Feb 18 18:29:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.238 2016/01/17 17:45:21 christos Exp $      */
+/*     $NetBSD: main.c,v 1.239 2016/02/18 18:29:14 christos Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.238 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.239 2016/02/18 18:29:14 christos 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.238 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.239 2016/02/18 18:29:14 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -690,7 +690,7 @@
        /* expand variable substitutions */
        if (strchr(path, '$') != 0) {
                snprintf(buf, MAXPATHLEN, "%s", path);
-               path = p = Var_Subst(NULL, buf, VAR_GLOBAL, FALSE, TRUE, FALSE);
+               path = p = Var_Subst(NULL, buf, VAR_GLOBAL, VARF_WANTRES);
        }
 
        if (path[0] != '/') {
@@ -773,7 +773,7 @@
 
     if (!mode)
        mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}",
-                             VAR_GLOBAL, FALSE, TRUE, FALSE);
+                             VAR_GLOBAL, VARF_WANTRES);
 
     if (mode && *mode) {
        if (strstr(mode, "compat")) {
@@ -1215,7 +1215,7 @@
                            (char *)Lst_Datum(ln));
        } else {
            p1 = Var_Subst(NULL, "${" MAKEFILE_PREFERENCE "}",
-               VAR_CMD, FALSE, TRUE, FALSE);
+               VAR_CMD, VARF_WANTRES);
            if (p1) {
                (void)str2Lst_Append(makefiles, p1, NULL);
                (void)Lst_Find(makefiles, NULL, ReadMakefile);
@@ -1226,7 +1226,7 @@



Home | Main Index | Thread Index | Old Index