Module Name: src Committed By: rillig Date: Fri Sep 11 04:40:26 UTC 2020
Modified Files: src/usr.bin/make: cond.c src/usr.bin/make/unit-tests: cond-op.mk Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/usr.bin/make/cond.c cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/cond-op.mk 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.123 src/usr.bin/make/cond.c:1.124 --- src/usr.bin/make/cond.c:1.123 Fri Sep 11 04:22:22 2020 +++ src/usr.bin/make/cond.c Fri Sep 11 04:40:26 2020 @@ -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 @@ CondCvtArg(const char *str, double *valu /*- * 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 @@ CondCvtArg(const char *str, double *valu */ /* 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 @@ compare_expression(CondParser *par, Bool * 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 @@ compare_expression(CondParser *par, Bool goto done; } - rhs = CondGetString(par, doEval, &rhsQuoted, &rhsFree, FALSE); + rhs = CondParser_String(par, doEval, FALSE, &rhsQuoted, &rhsFree); if (!rhs) goto done; Index: src/usr.bin/make/unit-tests/cond-op.mk diff -u src/usr.bin/make/unit-tests/cond-op.mk:1.4 src/usr.bin/make/unit-tests/cond-op.mk:1.5 --- src/usr.bin/make/unit-tests/cond-op.mk:1.4 Fri Aug 28 14:07:51 2020 +++ src/usr.bin/make/unit-tests/cond-op.mk Fri Sep 11 04:40:26 2020 @@ -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