summaryrefslogtreecommitdiffstats
path: root/bin/sh/mksyntax.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-12-27 18:04:05 +0000
committerjilles <jilles@FreeBSD.org>2009-12-27 18:04:05 +0000
commit5e8a2136e77b00534434ca09013b82b54a34e781 (patch)
tree460140e6f2859387224bc3cf5cc7148cf75b3745 /bin/sh/mksyntax.c
parent6d0737d0cb83394edfef580d58950553333a6cc1 (diff)
downloadFreeBSD-src-5e8a2136e77b00534434ca09013b82b54a34e781.zip
FreeBSD-src-5e8a2136e77b00534434ca09013b82b54a34e781.tar.gz
sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
- const - initializations to silence -Wuninitialized (it was safe anyway) - remove nested extern declarations - rename "index" locals to "idx"
Diffstat (limited to 'bin/sh/mksyntax.c')
-rw-r--r--bin/sh/mksyntax.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c
index f8fad0d..28a018b 100644
--- a/bin/sh/mksyntax.c
+++ b/bin/sh/mksyntax.c
@@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$");
struct synclass {
- char *name;
- char *comment;
+ const char *name;
+ const char *comment;
};
/* Syntax classes */
@@ -101,16 +101,16 @@ static char writer[] = "\
static FILE *cfile;
static FILE *hfile;
-static char *syntax[513];
+static const char *syntax[513];
static int base;
static int size; /* number of values which a char variable can have */
static int nbits; /* number of bits in a character */
static int digit_contig;/* true if digits are contiguous */
-static void filltable(char *);
+static void filltable(const char *);
static void init(void);
-static void add(char *, char *);
-static void print(char *);
+static void add(const char *, const char *);
+static void print(const char *);
static void output_type_macros(void);
static void digit_convert(void);
@@ -259,7 +259,7 @@ main(int argc __unused, char **argv __unused)
*/
static void
-filltable(char *dftval)
+filltable(const char *dftval)
{
int i;
@@ -293,7 +293,7 @@ init(void)
*/
static void
-add(char *p, char *type)
+add(const char *p, const char *type)
{
while (*p)
syntax[*p++ + base] = type;
@@ -306,7 +306,7 @@ add(char *p, char *type)
*/
static void
-print(char *name)
+print(const char *name)
{
int i;
int col;
@@ -338,7 +338,7 @@ print(char *name)
* contiguous, we can test for them quickly.
*/
-static char *macro[] = {
+static const char *macro[] = {
"#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)",
"#define is_eof(c)\t((c) == PEOF)",
"#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))",
@@ -351,7 +351,7 @@ static char *macro[] = {
static void
output_type_macros(void)
{
- char **pp;
+ const char **pp;
if (digit_contig)
macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)";
OpenPOWER on IntegriCloud