Module Name: src
Committed By: rillig
Date: Fri Jan 14 18:25:22 UTC 2022
Modified Files:
src/usr.bin/make: cond.c
Log Message:
make: inline EvalBare
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/cond.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/cond.c
diff -u src/usr.bin/make/cond.c:1.324 src/usr.bin/make/cond.c:1.325
--- src/usr.bin/make/cond.c:1.324 Fri Jan 7 09:19:43 2022
+++ src/usr.bin/make/cond.c Fri Jan 14 18:25:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.324 2022/01/07 09:19:43 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.325 2022/01/14 18:25:22 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
#include "dir.h"
/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: cond.c,v 1.324 2022/01/07 09:19:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.325 2022/01/14 18:25:22 rillig Exp $");
/*
* Conditional expressions conform to this grammar:
@@ -524,13 +524,6 @@ cleanup:
*out_str = str;
}
-static bool
-EvalBare(const CondParser *par, const char *arg)
-{
- bool res = par->evalBare(arg);
- return par->negateEvalBare ? !res : res;
-}
-
/*
* Evaluate a "comparison without operator", such as in ".if ${VAR}" or
* ".if 0".
@@ -560,7 +553,7 @@ EvalNotEmpty(CondParser *par, const char
if (par->plain)
return value[0] != '\0';
- return EvalBare(par, value);
+ return par->evalBare(value) != par->negateEvalBare;
}
/* Evaluate a numerical comparison, such as in ".if ${VAR} >= 9". */
@@ -805,7 +798,7 @@ CondParser_ComparisonOrLeaf(CondParser *
* after .if must have been taken literally, so the argument cannot
* be empty - even if it contained a variable expansion.
*/
- t = ToToken(doEval && EvalBare(par, arg));
+ t = ToToken(doEval && par->evalBare(arg) != par->negateEvalBare);
free(arg);
return t;
}