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): fix type mismatch between int and VarS...



details:   https://anonhg.NetBSD.org/src/rev/c084a45a4d7d
branches:  trunk
changeset: 978013:c084a45a4d7d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 07 21:31:07 2020 +0000

description:
make(1): fix type mismatch between int and VarSetFlags

diffstat:

 usr.bin/make/nonints.h |   8 +++++---
 usr.bin/make/var.c     |  12 ++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)

diffs (77 lines):

diff -r e9d6410b4c30 -r c084a45a4d7d usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Sat Nov 07 21:26:43 2020 +0000
+++ b/usr.bin/make/nonints.h    Sat Nov 07 21:31:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.155 2020/11/07 13:13:19 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.156 2020/11/07 21:31:07 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -227,9 +227,11 @@
     VARE_ASSIGN                = 1 << 2
 } VarEvalFlags;
 
-typedef enum VarSet_Flags {
+typedef enum VarSetFlags {
+    VAR_SET_NONE       = 0,
+
     /* do not export */
-    VAR_NO_EXPORT      = 1 << 0,
+    VAR_SET_NO_EXPORT  = 1 << 0,
 
     /* Make the variable read-only. No further modification is possible,
      * except for another call to Var_Set with the same flag. */
diff -r e9d6410b4c30 -r c084a45a4d7d usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Nov 07 21:26:43 2020 +0000
+++ b/usr.bin/make/var.c        Sat Nov 07 21:31:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.673 2020/11/07 14:11:58 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.674 2020/11/07 21:31:07 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.673 2020/11/07 14:11:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.674 2020/11/07 21:31:07 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -808,7 +808,7 @@
      */
     v = VarFind(name, ctxt, FALSE);
     if (v == NULL) {
-       if (ctxt == VAR_CMDLINE && !(flags & VAR_NO_EXPORT)) {
+       if (ctxt == VAR_CMDLINE && !(flags & VAR_SET_NO_EXPORT)) {
            /*
             * This var would normally prevent the same name being added
             * to VAR_GLOBAL, so delete it from there if needed.
@@ -837,7 +837,7 @@
      * to the environment (as per POSIX standard)
      * Other than internals.
      */
-    if (ctxt == VAR_CMDLINE && !(flags & VAR_NO_EXPORT) && name[0] != '.') {
+    if (ctxt == VAR_CMDLINE && !(flags & VAR_SET_NO_EXPORT) && name[0] != '.') {
        if (v == NULL)
            v = VarFind(name, ctxt, FALSE); /* we just added it */
        v->flags |= VAR_FROM_CMD;
@@ -889,7 +889,7 @@
 void
 Var_Set(const char *name, const char *val, GNode *ctxt)
 {
-    Var_SetWithFlags(name, val, ctxt, 0);
+    Var_SetWithFlags(name, val, ctxt, VAR_SET_NONE);
 }
 
 /*-
@@ -1457,7 +1457,7 @@
        return;
 
     args = data;
-    Var_SetWithFlags(args->tvar, word, args->ctx, VAR_NO_EXPORT);
+    Var_SetWithFlags(args->tvar, word, args->ctx, VAR_SET_NO_EXPORT);
     (void)Var_Subst(args->str, args->ctx, args->eflags, &s);
     /* TODO: handle errors */
 



Home | Main Index | Thread Index | Old Index