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): declare strings for suff.c constant



details:   https://anonhg.NetBSD.org/src/rev/37b0e8fbe94c
branches:  trunk
changeset: 944285:37b0e8fbe94c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 25 19:50:04 2020 +0000

description:
make(1): declare strings for suff.c constant

diffstat:

 usr.bin/make/nonints.h |  12 ++++++------
 usr.bin/make/suff.c    |  18 +++++++++---------
 2 files changed, 15 insertions(+), 15 deletions(-)

diffs (109 lines):

diff -r 5832e2454347 -r 37b0e8fbe94c usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Fri Sep 25 19:40:23 2020 +0000
+++ b/usr.bin/make/nonints.h    Fri Sep 25 19:50:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.128 2020/09/25 15:54:50 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.129 2020/09/25 19:50:04 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -152,17 +152,17 @@
 
 /* suff.c */
 void Suff_ClearSuffixes(void);
-Boolean Suff_IsTransform(char *);
-GNode *Suff_AddTransform(char *);
+Boolean Suff_IsTransform(const char *);
+GNode *Suff_AddTransform(const char *);
 void Suff_EndTransform(GNode *);
 void Suff_AddSuffix(const char *, GNode **);
-SearchPath *Suff_GetPath(char *);
+SearchPath *Suff_GetPath(const char *);
 void Suff_DoPaths(void);
-void Suff_AddInclude(char *);
+void Suff_AddInclude(const char *);
 void Suff_AddLib(const char *);
 void Suff_FindDeps(GNode *);
 SearchPath *Suff_FindPath(GNode *);
-void Suff_SetNull(char *);
+void Suff_SetNull(const char *);
 void Suff_Init(void);
 void Suff_End(void);
 void Suff_PrintAll(void);
diff -r 5832e2454347 -r 37b0e8fbe94c usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Fri Sep 25 19:40:23 2020 +0000
+++ b/usr.bin/make/suff.c       Fri Sep 25 19:50:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.166 2020/09/25 18:58:12 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.167 2020/09/25 19:50:04 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include         "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.166 2020/09/25 18:58:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.167 2020/09/25 19:50:04 rillig Exp $");
 
 #define SUFF_DEBUG0(fmt) \
     if (!DEBUG(SUFF)) (void) 0; else fprintf(debug_file, fmt)
@@ -464,11 +464,11 @@
  *     TRUE if the string is a valid transformation, FALSE otherwise.
  */
 static Boolean
-SuffParseTransform(char *str, Suff **out_src, Suff **out_targ)
+SuffParseTransform(const char *str, Suff **out_src, Suff **out_targ)
 {
     SuffListNode *srcLn;       /* element in suffix list of trans source*/
     Suff *src;                 /* Source of transformation */
-    char *str2;                        /* Extra pointer (maybe target suffix) */
+    const char *str2;          /* Extra pointer (maybe target suffix) */
     SuffListNode *singleLn;    /* element in suffix list of any suffix
                                 * that exactly matches str */
     Suff *single = NULL;       /* Source of possible transformation to
@@ -529,7 +529,7 @@
 /* Return TRUE if the given string is a transformation rule, that is, a
  * concatenation of two known suffixes. */
 Boolean
-Suff_IsTransform(char *str)
+Suff_IsTransform(const char *str)
 {
     Suff         *src, *targ;
 
@@ -549,7 +549,7 @@
  *     The node created for the transformation in the transforms list
  */
 GNode *
-Suff_AddTransform(char *line)
+Suff_AddTransform(const char *line)
 {
     GNode         *gn;         /* GNode of transformation rule */
     Suff          *s,          /* source suffix */
@@ -803,7 +803,7 @@
 
 /* Return the search path for the given suffix, or NULL. */
 SearchPath *
-Suff_GetPath(char *sname)
+Suff_GetPath(const char *sname)
 {
     Suff *s = FindSuffByName(sname);
     return s != NULL ? s->searchPath : NULL;
@@ -871,7 +871,7 @@
  *     sname           Name of the suffix to mark
  */
 void
-Suff_AddInclude(char *sname)
+Suff_AddInclude(const char *sname)
 {
     Suff *suff = FindSuffByName(sname);
     if (suff != NULL)
@@ -2095,7 +2095,7 @@
  *     name            Name of null suffix
  */
 void
-Suff_SetNull(char *name)
+Suff_SetNull(const char *name)
 {
     Suff *s = FindSuffByName(name);
     if (s == NULL) {



Home | Main Index | Thread Index | Old Index