Module Name: src
Committed By: rillig
Date: Wed Dec 29 05:05:21 UTC 2021
Modified Files:
src/usr.bin/make: cond.c make.h nonints.h var.c
Log Message:
make: merge duplicate types CondEvalResult and CondResult
No binary change.
To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/usr.bin/make/cond.c
cvs rdiff -u -r1.283 -r1.284 src/usr.bin/make/make.h
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.990 -r1.991 src/usr.bin/make/var.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.311 src/usr.bin/make/cond.c:1.312
--- src/usr.bin/make/cond.c:1.311 Wed Dec 29 05:01:35 2021
+++ src/usr.bin/make/cond.c Wed Dec 29 05:05:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.311 2021/12/29 05:01:35 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.312 2021/12/29 05:05:21 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.311 2021/12/29 05:01:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.312 2021/12/29 05:05:21 rillig Exp $");
/*
* The parsing of conditional expressions is based on this grammar:
@@ -981,7 +981,7 @@ CondParser_Or(CondParser *par, bool doEv
return res;
}
-static CondEvalResult
+static CondResult
CondParser_Eval(CondParser *par)
{
CondResult res;
@@ -1009,13 +1009,13 @@ CondParser_Eval(CondParser *par)
*
* *out_value is set to the boolean value of the condition
*/
-static CondEvalResult
+static CondResult
CondEvalExpression(const char *cond, bool plain,
bool (*evalBare)(const char *), bool negate,
bool eprint, bool leftUnquotedOK)
{
CondParser par;
- CondEvalResult rval;
+ CondResult rval;
cpp_skip_hspace(&cond);
@@ -1039,7 +1039,7 @@ CondEvalExpression(const char *cond, boo
* Evaluate a condition in a :? modifier, such as
* ${"${VAR}" == value:?yes:no}.
*/
-CondEvalResult
+CondResult
Cond_EvalCondition(const char *cond)
{
return CondEvalExpression(cond, true,
@@ -1120,7 +1120,7 @@ DetermineKindOfConditional(const char **
* a syntax error or because some variable was undefined
* or because the condition could not be evaluated
*/
-CondEvalResult
+CondResult
Cond_EvalLine(const char *line)
{
typedef enum IfState {
Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.283 src/usr.bin/make/make.h:1.284
--- src/usr.bin/make/make.h:1.283 Wed Dec 29 05:01:35 2021
+++ src/usr.bin/make/make.h Wed Dec 29 05:05:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.283 2021/12/29 05:01:35 rillig Exp $ */
+/* $NetBSD: make.h,v 1.284 2021/12/29 05:05:21 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -518,11 +518,11 @@ typedef enum ParseErrorLevel {
/*
* Values returned by Cond_EvalLine and Cond_EvalCondition.
*/
-typedef enum CondEvalResult {
+typedef enum CondResult {
CR_TRUE, /* Parse the next lines */
CR_FALSE, /* Skip the next lines */
CR_ERROR /* Unknown directive or parse error */
-} CondEvalResult, CondResult;
+} CondResult;
/* Names of the variables that are "local" to a specific target. */
#define TARGET "@" /* Target of dependency */
Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.224 src/usr.bin/make/nonints.h:1.225
--- src/usr.bin/make/nonints.h:1.224 Wed Dec 29 04:50:56 2021
+++ src/usr.bin/make/nonints.h Wed Dec 29 05:05:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.224 2021/12/29 04:50:56 rillig Exp $ */
+/* $NetBSD: nonints.h,v 1.225 2021/12/29 05:05:21 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -91,8 +91,8 @@ void Compat_Run(GNodeList *);
void Compat_Make(GNode *, GNode *);
/* cond.c */
-CondEvalResult Cond_EvalCondition(const char *) MAKE_ATTR_USE;
-CondEvalResult Cond_EvalLine(const char *) MAKE_ATTR_USE;
+CondResult Cond_EvalCondition(const char *) MAKE_ATTR_USE;
+CondResult Cond_EvalLine(const char *) MAKE_ATTR_USE;
void Cond_restore_depth(unsigned int);
unsigned int Cond_save_depth(void) MAKE_ATTR_USE;
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.990 src/usr.bin/make/var.c:1.991
--- src/usr.bin/make/var.c:1.990 Wed Dec 29 04:50:56 2021
+++ src/usr.bin/make/var.c Wed Dec 29 05:05:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.990 2021/12/29 04:50:56 rillig Exp $ */
+/* $NetBSD: var.c,v 1.991 2021/12/29 05:05:21 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.990 2021/12/29 04:50:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.991 2021/12/29 05:05:21 rillig Exp $");
/*
* Variables are defined using one of the VAR=value assignments. Their
@@ -3454,7 +3454,7 @@ ApplyModifier_IfElse(const char **pp, Mo
VarEvalMode then_emode = VARE_PARSE_ONLY;
VarEvalMode else_emode = VARE_PARSE_ONLY;
- CondEvalResult cond_rc = CR_TRUE; /* just not CR_ERROR */
+ CondResult cond_rc = CR_TRUE; /* just not CR_ERROR */
if (Expr_ShouldEval(expr)) {
cond_rc = Cond_EvalCondition(expr->name);
if (cond_rc == CR_TRUE)