Module Name:    src
Committed By:   rillig
Date:           Mon Nov 16 21:48:19 UTC 2020

Modified Files:
        src/usr.bin/make: nonints.h targ.c

Log Message:
make(1): make some GNode functions const


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/make/targ.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/nonints.h
diff -u src/usr.bin/make/nonints.h:1.161 src/usr.bin/make/nonints.h:1.162
--- src/usr.bin/make/nonints.h:1.161	Mon Nov 16 21:39:22 2020
+++ src/usr.bin/make/nonints.h	Mon Nov 16 21:48:18 2020
@@ -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_GetNode(const char *);
 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);

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.130 src/usr.bin/make/targ.c:1.131
--- src/usr.bin/make/targ.c:1.130	Mon Nov 16 21:44:29 2020
+++ src/usr.bin/make/targ.c	Mon Nov 16 21:48:18 2020
@@ -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 @@ Targ_FindList(StringList *names)
 
 /* 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);
 }
 

Reply via email to