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: inline EvalBare



details:   https://anonhg.NetBSD.org/src/rev/40581197c579
branches:  trunk
changeset: 359613:40581197c579
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jan 14 18:25:22 2022 +0000

description:
make: inline EvalBare

No functional change.

diffstat:

 usr.bin/make/cond.c |  15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r 6f6ad9f4bea6 -r 40581197c579 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Fri Jan 14 15:48:50 2022 +0000
+++ b/usr.bin/make/cond.c       Fri Jan 14 18:25:22 2022 +0000
@@ -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 @@
        *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 @@
        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 @@
         * 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;
 }



Home | Main Index | Thread Index | Old Index