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): rename CondGetString to CondParser_String



details:   https://anonhg.NetBSD.org/src/rev/a66a142fe63e
branches:  trunk
changeset: 943802:a66a142fe63e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 11 04:40:26 2020 +0000

description:
make(1): rename CondGetString to CondParser_String

This describes the function's effect more accurately.  The verb "get" is
not commonly associated to having side effects.

diffstat:

 usr.bin/make/cond.c                |  16 ++++++++--------
 usr.bin/make/unit-tests/cond-op.mk |   4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (82 lines):

diff -r 5f366a1e3492 -r a66a142fe63e usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Fri Sep 11 04:36:12 2020 +0000
+++ b/usr.bin/make/cond.c       Fri Sep 11 04:40:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.123 2020/09/11 04:22:22 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.124 2020/09/11 04:40:26 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.123 2020/09/11 04:22:22 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.124 2020/09/11 04:40:26 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.123 2020/09/11 04:22:22 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.124 2020/09/11 04:40:26 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -393,7 +393,7 @@
 
 /*-
  * Parse a string from a variable reference or an optionally quoted
- * string.  This is called for the lhs and rhs of string compares.
+ * string.  This is called for the lhs and rhs of string comparisons.
  *
  * Results:
  *     Returns the string, absent any quotes, or NULL on error.
@@ -402,8 +402,8 @@
  */
 /* coverity:[+alloc : arg-*3] */
 static const char *
-CondGetString(CondParser *par, Boolean doEval, Boolean *quoted, void **freeIt,
-             Boolean strictLHS)
+CondParser_String(CondParser *par, Boolean doEval, Boolean strictLHS,
+                 Boolean *quoted, void **freeIt)
 {
     Buffer buf;
     const char *str;
@@ -545,7 +545,7 @@
      * Parse the variable spec and skip over it, saving its
      * value in lhs.
      */
-    lhs = CondGetString(par, doEval, &lhsQuoted, &lhsFree, lhsStrict);
+    lhs = CondParser_String(par, doEval, lhsStrict, &lhsQuoted, &lhsFree);
     if (!lhs)
        goto done;
 
@@ -601,7 +601,7 @@
        goto done;
     }
 
-    rhs = CondGetString(par, doEval, &rhsQuoted, &rhsFree, FALSE);
+    rhs = CondParser_String(par, doEval, FALSE, &rhsQuoted, &rhsFree);
     if (!rhs)
        goto done;
 
diff -r 5f366a1e3492 -r a66a142fe63e usr.bin/make/unit-tests/cond-op.mk
--- a/usr.bin/make/unit-tests/cond-op.mk        Fri Sep 11 04:36:12 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-op.mk        Fri Sep 11 04:40:26 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-op.mk,v 1.4 2020/08/28 14:07:51 rillig Exp $
+# $NetBSD: cond-op.mk,v 1.5 2020/09/11 04:40:26 rillig Exp $
 #
 # Tests for operators like &&, ||, ! in .if conditions.
 #
@@ -48,7 +48,7 @@
 
 # Surprisingly, the ampersand and pipe are allowed in bare strings.
 # That's another opportunity for writing confusing code.
-# See CondGetString, which only has '!' in the list of stop characters.
+# See CondParser_String, which only has '!' in the list of stop characters.
 .if "a&&b||c" != a&&b||c
 .error
 .endif



Home | Main Index | Thread Index | Old Index