Module Name: othersrc
Committed By: dholland
Date: Sat Mar 23 18:33:01 UTC 2013
Modified Files:
othersrc/usr.bin/dholland-make2: nonints.h parse.c suff.c
Log Message:
Use more const.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 othersrc/usr.bin/dholland-make2/nonints.h
cvs rdiff -u -r1.7 -r1.8 othersrc/usr.bin/dholland-make2/parse.c
cvs rdiff -u -r1.17 -r1.18 othersrc/usr.bin/dholland-make2/suff.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/usr.bin/dholland-make2/nonints.h
diff -u othersrc/usr.bin/dholland-make2/nonints.h:1.6 othersrc/usr.bin/dholland-make2/nonints.h:1.7
--- othersrc/usr.bin/dholland-make2/nonints.h:1.6 Sat Mar 23 17:47:11 2013
+++ othersrc/usr.bin/dholland-make2/nonints.h Sat Mar 23 18:33:00 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.6 2013/03/23 17:47:11 dholland Exp $ */
+/* $NetBSD: nonints.h,v 1.7 2013/03/23 18:33:00 dholland Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -142,17 +142,17 @@ void Str_SYSVSubst(Buffer *, char *, cha
/* suff.c */
void Suff_ClearSuffixes(void);
-Boolean Suff_IsTransform(char *);
-GNode *Suff_AddTransform(char *);
+Boolean Suff_IsTransform(const char *);
+GNode *Suff_AddTransform(const char *);
int Suff_EndTransform(void *, void *);
-void Suff_AddSuffix(char *, GNode **);
-struct patharray *Suff_GetPath(char *);
+void Suff_AddSuffix(const char *, GNode **);
+struct patharray *Suff_GetPath(const char *);
void Suff_DoPaths(void);
-void Suff_AddInclude(char *);
-void Suff_AddLib(char *);
+void Suff_AddInclude(const char *);
+void Suff_AddLib(const char *);
void Suff_FindDeps(GNode *);
const struct patharray *Suff_FindPath(GNode *);
-void Suff_SetNull(char *);
+void Suff_SetNull(const char *);
void Suff_Init(void);
void Suff_End(void);
void Suff_PrintAll(void);
Index: othersrc/usr.bin/dholland-make2/parse.c
diff -u othersrc/usr.bin/dholland-make2/parse.c:1.7 othersrc/usr.bin/dholland-make2/parse.c:1.8
--- othersrc/usr.bin/dholland-make2/parse.c:1.7 Tue Mar 5 04:27:27 2013
+++ othersrc/usr.bin/dholland-make2/parse.c Sat Mar 23 18:33:00 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.7 2013/03/05 04:27:27 dholland Exp $ */
+/* $NetBSD: parse.c,v 1.8 2013/03/23 18:33:00 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -138,7 +138,7 @@
#include "buf.h"
#include "pathnames.h"
-MAKE_RCSID("$NetBSD: parse.c,v 1.7 2013/03/05 04:27:27 dholland Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.8 2013/03/23 18:33:00 dholland Exp $");
////////////////////////////////////////////////////////////
// types and constants
@@ -2010,7 +2010,7 @@ Parse_AddIncludeDir(char *dir)
*/
static void
-Parse_include_file(char *file, Boolean isSystem, int silent)
+Parse_include_file(const char *file, Boolean isSystem, int silent)
{
struct loadedfile *lf;
char *fullname; /* full pathname of file */
@@ -2061,7 +2061,7 @@ Parse_include_file(char *file, Boolean i
* then on the .PATH search path, if not found in a -I directory.
* If we have a suffix specific path we should use that.
*/
- char *suff;
+ const char *suff;
struct patharray *suffPath;
if ((suff = strrchr(file, '.'))) {
@@ -2180,7 +2180,8 @@ ParseDoInclude(char *line)
static void
ParseSetParseFile(const char *filename)
{
- char *slash, *dirname;
+ const char *slash;
+ char *dirname;
const char *pd, *pf;
int len;
Index: othersrc/usr.bin/dholland-make2/suff.c
diff -u othersrc/usr.bin/dholland-make2/suff.c:1.17 othersrc/usr.bin/dholland-make2/suff.c:1.18
--- othersrc/usr.bin/dholland-make2/suff.c:1.17 Sat Mar 23 18:27:18 2013
+++ othersrc/usr.bin/dholland-make2/suff.c Sat Mar 23 18:33:00 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.17 2013/03/23 18:27:18 dholland Exp $ */
+/* $NetBSD: suff.c,v 1.18 2013/03/23 18:33:00 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "hash.h"
#include "dir.h"
-MAKE_RCSID("$NetBSD: suff.c,v 1.17 2013/03/23 18:27:18 dholland Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.18 2013/03/23 18:33:00 dholland Exp $");
#define CLEANUP
@@ -209,10 +209,10 @@ static Suff *emptySuff; /* The empt
static const char *SuffStrIsPrefix(const char *, const char *);
static const char *SuffSuffIsSuffix(const Suff *, const char *name);
static void SuffUnRef(struct sufflist *, Suff *);
-static void SuffFree(void *);
+static void SuffFree(Suff *);
static void SuffInsert(struct sufflist *, Suff *);
static void SuffRemove(struct sufflist *, Suff *);
-static Boolean SuffParseTransform(char *, Suff **, Suff **);
+static Boolean SuffParseTransform(const char *, Suff **, Suff **);
static void SuffRebuildGraph(GNode *, Suff *);
static void SuffAddSrc(Suff *, struct srclist *, Src *);
static int SuffRemoveSrc(struct srclist *);
@@ -328,9 +328,8 @@ SuffUnRef(struct sufflist *l, Suff *s)
* Destroy a suffix.
*/
static void
-SuffFree(void *sp)
+SuffFree(Suff *s)
{
- Suff *s = (Suff *)sp;
unsigned i;
if (s == suffNull)
@@ -465,7 +464,7 @@ Suff_ClearSuffixes(void)
*-----------------------------------------------------------------------
*/
static Boolean
-SuffParseTransform(char *str, Suff **srcPtr, Suff **targPtr)
+SuffParseTransform(const char *str, Suff **srcPtr, Suff **targPtr)
{
/*
* STR is a string that might be of the form ".c.o". If it is
@@ -559,7 +558,7 @@ SuffParseTransform(char *str, Suff **src
*-----------------------------------------------------------------------
*/
Boolean
-Suff_IsTransform(char *str)
+Suff_IsTransform(const char *str)
{
Suff *src, *targ;
@@ -584,7 +583,7 @@ Suff_IsTransform(char *str)
*-----------------------------------------------------------------------
*/
GNode *
-Suff_AddTransform(char *line)
+Suff_AddTransform(const char *line)
{
GNode *gn; /* GNode of transformation rule */
Suff *s, /* source suffix */
@@ -882,7 +881,7 @@ SuffFindBySuffix(struct sufflist *list,
}
void
-Suff_AddSuffix(char *str, GNode **gn)
+Suff_AddSuffix(const char *str, GNode **gn)
{
Suff *s; /* new suffix descriptor */
GNodeSuff gs;
@@ -948,7 +947,7 @@ Suff_AddSuffix(char *str, GNode **gn)
*-----------------------------------------------------------------------
*/
struct patharray *
-Suff_GetPath(char *sname)
+Suff_GetPath(const char *sname)
{
Suff *s;
@@ -1051,7 +1050,7 @@ Suff_DoPaths(void)
*-----------------------------------------------------------------------
*/
void
-Suff_AddInclude(char *sname)
+Suff_AddInclude(const char *sname)
{
Suff *s;
@@ -1081,7 +1080,7 @@ Suff_AddInclude(char *sname)
*-----------------------------------------------------------------------
*/
void
-Suff_AddLib(char *sname)
+Suff_AddLib(const char *sname)
{
Suff *s;
@@ -2474,7 +2473,7 @@ SuffFindDeps(GNode *gn, struct srclist *
*-----------------------------------------------------------------------
*/
void
-Suff_SetNull(char *name)
+Suff_SetNull(const char *name)
{
Suff *s;