Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/tr sprinkle const
details: https://anonhg.NetBSD.org/src/rev/efe8052f0221
branches: trunk
changeset: 789191:efe8052f0221
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Aug 11 00:05:49 2013 +0000
description:
sprinkle const
diffstat:
usr.bin/tr/extern.h | 4 ++--
usr.bin/tr/str.c | 10 +++++-----
usr.bin/tr/tr.c | 8 ++++----
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (97 lines):
diff -r c555b9c287f1 -r efe8052f0221 usr.bin/tr/extern.h
--- a/usr.bin/tr/extern.h Sun Aug 11 00:04:14 2013 +0000
+++ b/usr.bin/tr/extern.h Sun Aug 11 00:05:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.9 2013/08/11 00:04:14 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.10 2013/08/11 00:05:49 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -40,5 +40,5 @@
STR *str_create(int);
void str_destroy(STR *);
-void str_setstring(STR *s, char *txt);
+void str_setstring(STR *s, const char *txt);
int next(STR *, int *);
diff -r c555b9c287f1 -r efe8052f0221 usr.bin/tr/str.c
--- a/usr.bin/tr/str.c Sun Aug 11 00:04:14 2013 +0000
+++ b/usr.bin/tr/str.c Sun Aug 11 00:05:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.21 2013/08/11 00:04:14 dholland Exp $ */
+/* $NetBSD: str.c,v 1.22 2013/08/11 00:05:49 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
#endif
-__RCSID("$NetBSD: str.c,v 1.21 2013/08/11 00:04:14 dholland Exp $");
+__RCSID("$NetBSD: str.c,v 1.22 2013/08/11 00:05:49 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -57,7 +57,7 @@
int lastch; /* last character */
int equiv[2]; /* equivalence set */
int *set; /* set of characters */
- unsigned char *str; /* user's string */
+ unsigned const char *str; /* user's string */
};
static int backslash(STR *);
@@ -100,7 +100,7 @@
}
void
-str_setstring(STR *s, char *txt)
+str_setstring(STR *s, const char *txt)
{
s->str = txt;
}
@@ -281,7 +281,7 @@
genrange(STR *s)
{
int stopval;
- char *savestart;
+ const char *savestart;
savestart = s->str;
stopval = *++s->str == '\\' ? backslash(s) : *s->str++;
diff -r c555b9c287f1 -r efe8052f0221 usr.bin/tr/tr.c
--- a/usr.bin/tr/tr.c Sun Aug 11 00:04:14 2013 +0000
+++ b/usr.bin/tr/tr.c Sun Aug 11 00:05:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tr.c,v 1.11 2013/08/11 00:04:14 dholland Exp $ */
+/* $NetBSD: tr.c,v 1.12 2013/08/11 00:05:49 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95";
#endif
-__RCSID("$NetBSD: tr.c,v 1.11 2013/08/11 00:04:14 dholland Exp $");
+__RCSID("$NetBSD: tr.c,v 1.12 2013/08/11 00:05:49 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -87,7 +87,7 @@
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
}, string2[NCHARS];
-static void setup(int *, char *, STR *, int);
+static void setup(int *, const char *, STR *, int);
__dead static void usage(void);
int
@@ -242,7 +242,7 @@
}
static void
-setup(int *string, char *arg, STR *str, int cflag)
+setup(int *string, const char *arg, STR *str, int cflag)
{
int cnt, *p;
int ch;
Home |
Main Index |
Thread Index |
Old Index