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: merge SetVar into Var_SetWithFlags



details:   https://anonhg.NetBSD.org/src/rev/eb3b464fc8b8
branches:  trunk
changeset: 951499:eb3b464fc8b8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Feb 04 19:43:00 2021 +0000

description:
make: merge SetVar into Var_SetWithFlags

No functional change.

diffstat:

 usr.bin/make/var.c |  24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diffs (80 lines):

diff -r 52639c20cb3e -r eb3b464fc8b8 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Thu Feb 04 19:15:13 2021 +0000
+++ b/usr.bin/make/var.c        Thu Feb 04 19:43:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.799 2021/02/04 19:15:13 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.800 2021/02/04 19:43:00 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.799 2021/02/04 19:15:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.800 2021/02/04 19:43:00 rillig Exp $");
 
 typedef enum VarFlags {
        VAR_NONE        = 0,
@@ -919,8 +919,9 @@
 }
 
 /* Set the variable to the value; the name is not expanded. */
-static void
-SetVar(const char *name, const char *val, GNode *ctxt, VarSetFlags flags)
+void
+Var_SetWithFlags(const char *name, const char *val, GNode *ctxt,
+                VarSetFlags flags)
 {
        Var *v;
 
@@ -1001,13 +1002,6 @@
                VarFreeEnv(v, TRUE);
 }
 
-void
-Var_SetWithFlags(const char *name, const char *val, GNode *ctxt,
-                VarSetFlags flags)
-{
-       SetVar(name, val, ctxt, flags);
-}
-
 /* See Var_Set for documentation. */
 void
 Var_SetExpandWithFlags(const char *name, const char *val, GNode *ctxt,
@@ -1030,7 +1024,7 @@
                            "name expands to empty string - ignored\n",
                    unexpanded_name, val);
        } else
-               SetVar(varname.str, val, ctxt, flags);
+               Var_SetWithFlags(varname.str, val, ctxt, flags);
 
        FStr_Done(&varname);
 }
@@ -1038,7 +1032,7 @@
 void
 Var_Set(const char *name, const char *val, GNode *ctxt)
 {
-       SetVar(name, val, ctxt, VAR_SET_NONE);
+       Var_SetWithFlags(name, val, ctxt, VAR_SET_NONE);
 }
 
 /*
@@ -1061,7 +1055,7 @@
 void
 Global_Set(const char *name, const char *value)
 {
-       SetVar(name, value, VAR_GLOBAL, VAR_SET_NONE);
+       Var_Set(name, value, VAR_GLOBAL);
 }
 
 void
@@ -1084,7 +1078,7 @@
        v = VarFind(name, ctxt, ctxt == VAR_GLOBAL);
 
        if (v == NULL) {
-               SetVar(name, val, ctxt, VAR_SET_NONE);
+               Var_SetWithFlags(name, val, ctxt, VAR_SET_NONE);
        } else if (v->flags & VAR_READONLY) {
                DEBUG1(VAR, "Ignoring append to %s since it is read-only\n",
                    name);



Home | Main Index | Thread Index | Old Index