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: rename and inline Targ_Precious



details:   https://anonhg.NetBSD.org/src/rev/8b64bcb12f76
branches:  trunk
changeset: 359486:8b64bcb12f76
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jan 07 19:24:27 2022 +0000

description:
make: rename and inline Targ_Precious

No functional change.

diffstat:

 usr.bin/make/compat.c  |   8 ++++----
 usr.bin/make/job.c     |   6 +++---
 usr.bin/make/make.h    |  10 +++++++++-
 usr.bin/make/nonints.h |   3 +--
 usr.bin/make/targ.c    |  15 ++-------------
 5 files changed, 19 insertions(+), 23 deletions(-)

diffs (147 lines):

diff -r d6a4304bb93f -r 8b64bcb12f76 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Fri Jan 07 16:51:25 2022 +0000
+++ b/usr.bin/make/compat.c     Fri Jan 07 19:24:27 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.235 2021/12/27 18:26:22 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.236 2022/01/07 19:24:27 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*     "@(#)compat.c   8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.235 2021/12/27 18:26:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.236 2022/01/07 19:24:27 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -109,7 +109,7 @@
 static void
 CompatDeleteTarget(GNode *gn)
 {
-       if (gn != NULL && !Targ_Precious(gn)) {
+       if (gn != NULL && !GNode_IsPrecious(gn)) {
                const char *file = GNode_VarTarget(gn);
 
                if (!opts.noExecute && unlink_file(file)) {
@@ -132,7 +132,7 @@
 {
        CompatDeleteTarget(curTarg);
 
-       if (curTarg != NULL && !Targ_Precious(curTarg)) {
+       if (curTarg != NULL && !GNode_IsPrecious(curTarg)) {
                /*
                 * Run .INTERRUPT only if hit with interrupt signal
                 */
diff -r d6a4304bb93f -r 8b64bcb12f76 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Jan 07 16:51:25 2022 +0000
+++ b/usr.bin/make/job.c        Fri Jan 07 19:24:27 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.446 2022/01/07 08:28:06 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.447 2022/01/07 19:24:27 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.446 2022/01/07 08:28:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.447 2022/01/07 19:24:27 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -506,7 +506,7 @@
                return;
        if (gn->type & OP_PHONY)
                return;
-       if (Targ_Precious(gn))
+       if (GNode_IsPrecious(gn))
                return;
        if (opts.noExecute)
                return;
diff -r d6a4304bb93f -r 8b64bcb12f76 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Fri Jan 07 16:51:25 2022 +0000
+++ b/usr.bin/make/make.h       Fri Jan 07 19:24:27 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.285 2022/01/07 13:56:09 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.286 2022/01/07 19:24:27 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -820,6 +820,14 @@
                            OP_EXEC | OP_TRANSFORM)) == 0;
 }
 
+/* Return whether the target file should be preserved on interrupt. */
+MAKE_INLINE bool MAKE_ATTR_USE
+GNode_IsPrecious(const GNode *gn)
+{
+       /* XXX: Why are '::' targets precious? */
+       return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP);
+}
+
 MAKE_INLINE const char * MAKE_ATTR_USE
 GNode_VarTarget(GNode *gn) { return GNode_ValueDirect(gn, TARGET); }
 MAKE_INLINE const char * MAKE_ATTR_USE
diff -r d6a4304bb93f -r 8b64bcb12f76 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Fri Jan 07 16:51:25 2022 +0000
+++ b/usr.bin/make/nonints.h    Fri Jan 07 19:24:27 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.229 2022/01/02 01:54:43 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.230 2022/01/07 19:24:27 rillig Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -183,7 +183,6 @@
 GNode *Targ_NewInternalNode(const char *) MAKE_ATTR_USE;
 GNode *Targ_GetEndNode(void);
 void Targ_FindList(GNodeList *, StringList *);
-bool Targ_Precious(const GNode *) MAKE_ATTR_USE;
 void Targ_SetMain(GNode *);
 void Targ_PrintCmds(GNode *);
 void Targ_PrintNode(GNode *, int);
diff -r d6a4304bb93f -r 8b64bcb12f76 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Fri Jan 07 16:51:25 2022 +0000
+++ b/usr.bin/make/targ.c       Fri Jan 07 19:24:27 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.173 2021/11/28 19:51:06 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.174 2022/01/07 19:24:27 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -93,9 +93,6 @@
  *     Targ_FindList   Given a list of names, find nodes for all
  *                     of them, creating them as necessary.
  *
- *     Targ_Precious   Return true if the target is precious and
- *                     should not be removed if we are interrupted.
- *
  *     Targ_Propagate  Propagate information between related nodes.
  *                     Should be called after the makefiles are parsed
  *                     but before any action is taken.
@@ -113,7 +110,7 @@
 #include "dir.h"
 
 /*     "@(#)targ.c     8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.173 2021/11/28 19:51:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.174 2022/01/07 19:24:27 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -346,14 +343,6 @@
        }
 }
 
-/* See if the given target is precious. */
-bool
-Targ_Precious(const GNode *gn)
-{
-       /* XXX: Why are '::' targets precious? */
-       return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP);
-}
-
 /*
  * The main target to be made; only for debugging output.
  * See mainNode in parse.c for the definitive source.



Home | Main Index | Thread Index | Old Index