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): improve variable names in EvalNotEmpty



details:   https://anonhg.NetBSD.org/src/rev/7c32c67b7c9d
branches:  trunk
changeset: 956877:7c32c67b7c9d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 22:41:40 2020 +0000

description:
make(1): improve variable names in EvalNotEmpty

In a unary expression, there is no left-hand side.

diffstat:

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

diffs (52 lines):

diff -r a3e74a9d69ec -r 7c32c67b7c9d usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sun Nov 08 22:38:28 2020 +0000
+++ b/usr.bin/make/cond.c       Sun Nov 08 22:41:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.190 2020/11/08 22:37:52 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.191 2020/11/08 22:41:40 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.190 2020/11/08 22:37:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.191 2020/11/08 22:41:40 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -532,24 +532,24 @@
 /* Evaluate a "comparison without operator", such as in ".if ${VAR}" or
  * ".if 0". */
 static Boolean
-EvalNotEmpty(CondParser *par, const char *lhs, Boolean lhsQuoted)
+EvalNotEmpty(CondParser *par, const char *value, Boolean quoted)
 {
     double left;
 
-    /* For .ifxxx "..." check for non-empty string. */
-    if (lhsQuoted)
-       return lhs[0] != '\0';
+    /* For .ifxxx "...", check for non-empty string. */
+    if (quoted)
+       return value[0] != '\0';
 
-    /* For .ifxxx <number> compare against zero */
-    if (TryParseNumber(lhs, &left))
+    /* For .ifxxx <number>, compare against zero */
+    if (TryParseNumber(value, &left))
        return left != 0.0;
 
-    /* For .if ${...} check for non-empty string (defProc is ifdef). */
+    /* For .if ${...}, check for non-empty string (defProc is ifdef). */
     if (par->if_info->form[0] == '\0')
-       return lhs[0] != '\0';
+       return value[0] != '\0';
 
     /* Otherwise action default test ... */
-    return If_Eval(par->if_info, lhs, strlen(lhs));
+    return If_Eval(par->if_info, value, strlen(value));
 }
 
 /* Evaluate a numerical comparison, such as in ".if ${VAR} >= 9". */



Home | Main Index | Thread Index | Old Index