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): make some GNode functions const



details:   https://anonhg.NetBSD.org/src/rev/148863d6f546
branches:  trunk
changeset: 957092:148863d6f546
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 16 21:48:18 2020 +0000

description:
make(1): make some GNode functions const

diffstat:

 usr.bin/make/nonints.h |   8 ++++----
 usr.bin/make/targ.c    |  11 ++++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r b9766bb768cb -r 148863d6f546 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Mon Nov 16 21:44:29 2020 +0000
+++ b/usr.bin/make/nonints.h    Mon Nov 16 21:48:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.161 2020/11/16 21:39:22 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.162 2020/11/16 21:48:18 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -197,9 +197,9 @@
 GNode *Targ_NewInternalNode(const char *);
 GNode *Targ_GetEndNode(void);
 GNodeList *Targ_FindList(StringList *);
-Boolean Targ_Ignore(GNode *);
-Boolean Targ_Silent(GNode *);
-Boolean Targ_Precious(GNode *);
+Boolean Targ_Ignore(const GNode *);
+Boolean Targ_Silent(const GNode *);
+Boolean Targ_Precious(const GNode *);
 void Targ_SetMain(GNode *);
 void Targ_PrintCmds(GNode *);
 void Targ_PrintNode(GNode *, int);
diff -r b9766bb768cb -r 148863d6f546 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Mon Nov 16 21:44:29 2020 +0000
+++ b/usr.bin/make/targ.c       Mon Nov 16 21:48:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.130 2020/11/16 21:44:29 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.131 2020/11/16 21:48:18 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*     "@(#)targ.c     8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.130 2020/11/16 21:44:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.131 2020/11/16 21:48:18 rillig Exp $");
 
 static GNodeList *allTargets;  /* the list of all targets found so far */
 static HashTable targets;      /* a hash table of same */
@@ -304,22 +304,23 @@
 
 /* Return true if should ignore errors when creating gn. */
 Boolean
-Targ_Ignore(GNode *gn)
+Targ_Ignore(const GNode *gn)
 {
     return opts.ignoreErrors || gn->type & OP_IGNORE;
 }
 
 /* Return true if be silent when creating gn. */
 Boolean
-Targ_Silent(GNode *gn)
+Targ_Silent(const GNode *gn)
 {
     return opts.beSilent || gn->type & OP_SILENT;
 }
 
 /* See if the given target is precious. */
 Boolean
-Targ_Precious(GNode *gn)
+Targ_Precious(const GNode *gn)
 {
+    /* XXX: Why are '::' targets precious? */
     return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP);
 }
 



Home | Main Index | Thread Index | Old Index