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): remove redundant macros from ParseEOF ...
details: https://anonhg.NetBSD.org/src/rev/fa25a854ee28
branches: trunk
changeset: 944960:fa25a854ee28
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Oct 17 18:58:26 2020 +0000
description:
make(1): remove redundant macros from ParseEOF and Parse_File
diffstat:
usr.bin/make/parse.c | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diffs (83 lines):
diff -r 1f287434480b -r fa25a854ee28 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Sat Oct 17 18:39:43 2020 +0000
+++ b/usr.bin/make/parse.c Sat Oct 17 18:58:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.375 2020/10/17 18:39:43 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.376 2020/10/17 18:58:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.375 2020/10/17 18:39:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.376 2020/10/17 18:58:26 rillig Exp $");
/* types and constants */
@@ -153,15 +153,6 @@
struct loadedfile *lf; /* loadedfile object, if any */
} IFile;
-
-/*
- * These values are returned by ParseEOF to tell Parse_File whether to
- * CONTINUE parsing, i.e. it had only reached the end of an include file,
- * or if it's DONE.
- */
-#define CONTINUE 1
-#define DONE 0
-
/*
* Tokens for target attributes
*/
@@ -2572,9 +2563,10 @@
* to reading the previous file at the previous location.
*
* Results:
- * CONTINUE if there's more to do. DONE if not.
+ * TRUE to continue parsing, i.e. it had only reached the end of an
+ * included file, FALSE if the main file has been parsed completely.
*/
-static int
+static Boolean
ParseEOF(void)
{
char *ptr;
@@ -2591,7 +2583,7 @@
curFile->lineno = curFile->first_lineno;
if (ptr != NULL) {
/* Iterate again */
- return CONTINUE;
+ return TRUE;
}
/* Ensure the makefile (or loop) didn't have mismatched conditionals */
@@ -2614,7 +2606,7 @@
Var_Delete(".PARSEFILE", VAR_GLOBAL);
Var_Delete(".INCLUDEDFROMDIR", VAR_GLOBAL);
Var_Delete(".INCLUDEDFROMFILE", VAR_GLOBAL);
- return DONE;
+ return FALSE;
}
curFile = Stack_Pop(&includes);
@@ -2622,7 +2614,7 @@
curFile->fname, curFile->lineno);
ParseSetParseFile(curFile->fname);
- return CONTINUE;
+ return TRUE;
}
#define PARSE_RAW 1
@@ -3125,7 +3117,7 @@
/*
* Reached EOF, but it may be just EOF of an include file...
*/
- } while (ParseEOF() == CONTINUE);
+ } while (ParseEOF());
FinishDependencyGroup();
Home |
Main Index |
Thread Index |
Old Index