Module Name: src
Committed By: rillig
Date: Sat Nov 14 15:58:01 UTC 2020
Modified Files:
src/usr.bin/make: job.c main.c make.h parse.c
Log Message:
make(1): rename DEFAULT to defaultNode
In C, uppercase names are typically used for constants, and this is not
a constant.
To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/make/job.c
cvs rdiff -u -r1.458 -r1.459 src/usr.bin/make/main.c
cvs rdiff -u -r1.206 -r1.207 src/usr.bin/make/make.h
cvs rdiff -u -r1.438 -r1.439 src/usr.bin/make/parse.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/job.c
diff -u src/usr.bin/make/job.c:1.322 src/usr.bin/make/job.c:1.323
--- src/usr.bin/make/job.c:1.322 Sat Nov 14 15:47:35 2020
+++ src/usr.bin/make/job.c Sat Nov 14 15:58:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.322 2020/11/14 15:47:35 rillig Exp $ */
+/* $NetBSD: job.c,v 1.323 2020/11/14 15:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.322 2020/11/14 15:47:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.323 2020/11/14 15:58:01 rillig Exp $");
/* A shell defines how the commands are run. All commands for a target are
* written into a single file, which is then given to the shell to execute
@@ -1182,20 +1182,19 @@ Job_CheckCommands(GNode *gn, void (*abor
/*
* No commands. Look for .DEFAULT rule from which we might infer
- * commands
+ * commands.
*/
- if (DEFAULT != NULL && !Lst_IsEmpty(DEFAULT->commands) &&
+ if (defaultNode != NULL && !Lst_IsEmpty(defaultNode->commands) &&
!(gn->type & OP_SPECIAL)) {
/*
- * Make only looks for a .DEFAULT if the node was never the
- * target of an operator, so that's what we do too. If
- * a .DEFAULT was given, we substitute its commands for gn's
- * commands and set the IMPSRC variable to be the target's name
- * The DEFAULT node acts like a transformation rule, in that
+ * The traditional Make only looks for a .DEFAULT if the node was
+ * never the target of an operator, so that's what we do too.
+ *
+ * The .DEFAULT node acts like a transformation rule, in that
* gn also inherits any attributes or sources attached to
* .DEFAULT itself.
*/
- Make_HandleUse(DEFAULT, gn);
+ Make_HandleUse(defaultNode, gn);
Var_Set(IMPSRC, GNode_VarTarget(gn), gn);
return TRUE;
}
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.458 src/usr.bin/make/main.c:1.459
--- src/usr.bin/make/main.c:1.458 Fri Nov 13 19:45:24 2020
+++ src/usr.bin/make/main.c Sat Nov 14 15:58:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.458 2020/11/13 19:45:24 rillig Exp $ */
+/* $NetBSD: main.c,v 1.459 2020/11/14 15:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.458 2020/11/13 19:45:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.459 2020/11/14 15:58:01 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -122,7 +122,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
CmdOpts opts;
time_t now; /* Time at start of make */
-GNode *DEFAULT; /* .DEFAULT node */
+GNode *defaultNode; /* .DEFAULT node */
Boolean allPrecious; /* .PRECIOUS given on line by itself */
Boolean deleteOnError; /* .DELETE_ON_ERROR: set */
@@ -1504,7 +1504,7 @@ main_Init(int argc, char **argv)
Suff_Init();
Trace_Init(tracefile);
- DEFAULT = NULL;
+ defaultNode = NULL;
(void)time(&now);
Trace_Log(MAKESTART, NULL);
Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.206 src/usr.bin/make/make.h:1.207
--- src/usr.bin/make/make.h:1.206 Thu Nov 12 23:35:21 2020
+++ src/usr.bin/make/make.h Sat Nov 14 15:58:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.206 2020/11/12 23:35:21 sjg Exp $ */
+/* $NetBSD: make.h,v 1.207 2020/11/14 15:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -423,7 +423,7 @@ extern Boolean deleteOnError;
/* TRUE while processing .depend */
extern Boolean doing_depend;
/* .DEFAULT rule */
-extern GNode *DEFAULT;
+extern GNode *defaultNode;
/* Variables defined internally by make which should not override those set
* by makefiles. */
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.438 src/usr.bin/make/parse.c:1.439
--- src/usr.bin/make/parse.c:1.438 Thu Nov 12 23:35:21 2020
+++ src/usr.bin/make/parse.c Sat Nov 14 15:58:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.438 2020/11/12 23:35:21 sjg Exp $ */
+/* $NetBSD: parse.c,v 1.439 2020/11/14 15:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.438 2020/11/12 23:35:21 sjg Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.439 2020/11/14 15:58:01 rillig Exp $");
/* types and constants */
@@ -1088,7 +1088,7 @@ ParseDependencyTargetWord(/*const*/ char
* it to be the Main Target, so we
* create it, set OP_NOTMAIN and
* add it to the list, setting
- * DEFAULT to the new node for
+ * defaultNode to the new node for
* later use. We claim the node is
* A transformation rule to make
* life easier later, when we'll
@@ -1138,7 +1138,7 @@ ParseDoDependencyTargetSpecial(ParseSpec
GNode *gn = Targ_NewGN(".DEFAULT");
gn->type |= OP_NOTMAIN|OP_TRANSFORM;
Lst_Append(targets, gn);
- DEFAULT = gn;
+ defaultNode = gn;
break;
}
case SP_DELETE_ON_ERROR: