summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1992-11-08 20:19:58 +0000
committerJim Meyering <jim@meyering.net>1992-11-08 20:19:58 +0000
commit925487607cfed5d4e68ffa375bc17941934dba07 (patch)
treed9333d9e8759a18b2ea1b3550319491cce519cb0 /src/tr.c
parent40d0a06450310c7abc8b393f130fa76de682313d (diff)
downloadcoreutils-925487607cfed5d4e68ffa375bc17941934dba07.tar.xz
Declared lots of external functions and variables static.
Made several statically-initialized arrays `const'
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tr.c b/src/tr.c
index bd12f383f..a1376381d 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -99,7 +99,7 @@ enum Upper_Lower_class
from upper or lower. In fact, no other character classes are allowed
when translating, but that condition is tested elsewhere. This array
is indexed by values of type enum Upper_Lower_class. */
-static int class_ok[3][3] =
+static int const class_ok[3][3] =
{
{0, 1, 0},
{1, 0, 0},
@@ -263,7 +263,7 @@ static int translating;
#define IO_BUF_SIZE BUFSIZ
static unsigned char io_buf[IO_BUF_SIZE];
-char *char_class_name[] =
+static char const* const char_class_name[] =
{
"alnum", "alpha", "blank", "cntrl", "digit", "graph",
"lower", "print", "punct", "space", "upper", "xdigit"
@@ -289,7 +289,7 @@ static SET_TYPE in_delete_set[N_CHARS];
two specification strings and the delete switch is not given. */
static char xlate[N_CHARS];
-static struct option long_options[] =
+static struct option const long_options[] =
{
{"complement", 0, NULL, 'c'},
{"delete", 0, NULL, 'd'},
@@ -494,7 +494,7 @@ look_up_char_class (class_str)
unsigned int i;
for (i = 0; i < N_CHAR_CLASSES; i++)
- if (strcmp (class_str, char_class_name[i]) == 0)
+ if (strcmp ((const char *) class_str, char_class_name[i]) == 0)
return (enum Char_class) i;
return CC_NO_CLASS;
}