Module Name:    src
Committed By:   rillig
Date:           Sat Aug  1 07:10:37 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make(1): use consistent pattern for testing flags


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.370 src/usr.bin/make/var.c:1.371
--- src/usr.bin/make/var.c:1.370	Sat Aug  1 07:03:50 2020
+++ src/usr.bin/make/var.c	Sat Aug  1 07:10:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.370 2020/08/01 07:03:50 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.371 2020/08/01 07:10:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.370 2020/08/01 07:03:50 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.371 2020/08/01 07:10:37 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.370 2020/08/01 07:03:50 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.371 2020/08/01 07:10:37 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -529,7 +529,7 @@ Var_Export1(const char *name, VarExportF
 	return 0;			/* nothing to do */
     }
     val = Buf_GetAll(&v->val, NULL);
-    if ((flags & VAR_EXPORT_LITERAL) == 0 && strchr(val, '$')) {
+    if (!(flags & VAR_EXPORT_LITERAL) && strchr(val, '$')) {
 	if (parent) {
 	    /*
 	     * Flag this as something we need to re-export.
@@ -805,7 +805,7 @@ Var_Set_with_flags(const char *name, con
     if (ctxt == VAR_GLOBAL) {
 	v = VarFind(name, VAR_CMD, 0);
 	if (v != NULL) {
-	    if ((v->flags & VAR_FROM_CMD)) {
+	    if (v->flags & VAR_FROM_CMD) {
 		if (DEBUG(VAR)) {
 		    fprintf(debug_file, "%s:%s = %s ignored!\n", ctxt->name, name, val);
 		}
@@ -816,7 +816,7 @@ Var_Set_with_flags(const char *name, con
     }
     v = VarFind(name, ctxt, 0);
     if (v == NULL) {
-	if (ctxt == VAR_CMD && (flags & VAR_NO_EXPORT) == 0) {
+	if (ctxt == VAR_CMD && !(flags & VAR_NO_EXPORT)) {
 	    /*
 	     * This var would normally prevent the same name being added
 	     * to VAR_GLOBAL, so delete it from there if needed.
@@ -833,7 +833,7 @@ Var_Set_with_flags(const char *name, con
 	if (DEBUG(VAR)) {
 	    fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val);
 	}
-	if ((v->flags & VAR_EXPORTED)) {
+	if (v->flags & VAR_EXPORTED) {
 	    Var_Export1(name, VAR_EXPORT_PARENT);
 	}
     }
@@ -841,7 +841,7 @@ Var_Set_with_flags(const char *name, con
      * Any variables given on the command line are automatically exported
      * to the environment (as per POSIX standard)
      */
-    if (ctxt == VAR_CMD && (flags & VAR_NO_EXPORT) == 0) {
+    if (ctxt == VAR_CMD && !(flags & VAR_NO_EXPORT)) {
 	if (v == NULL) {
 	    /* we just added it */
 	    v = VarFind(name, ctxt, 0);
@@ -3109,7 +3109,7 @@ ApplyModifiers(
 		st.val = ApplyModifiers(&rval_pp, st.val, 0, 0, v,
 					ctxt, eflags, freePtr);
 		if (st.val == var_Error
-		    || (st.val == varNoError && (st.eflags & VARE_UNDEFERR) == 0)
+		    || (st.val == varNoError && !(st.eflags & VARE_UNDEFERR))
 		    || *rval_pp != '\0') {
 		    free(freeIt);
 		    goto out;	/* error already reported */

Reply via email to