diff options
author | jilles <jilles@FreeBSD.org> | 2009-12-27 18:04:05 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2009-12-27 18:04:05 +0000 |
commit | 5e8a2136e77b00534434ca09013b82b54a34e781 (patch) | |
tree | 460140e6f2859387224bc3cf5cc7148cf75b3745 /bin/sh/parser.c | |
parent | 6d0737d0cb83394edfef580d58950553333a6cc1 (diff) | |
download | FreeBSD-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/parser.c')
-rw-r--r-- | bin/sh/parser.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index de7b130..b1547e3 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -113,7 +113,7 @@ STATIC int xxreadtoken(void); STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); @@ -1547,7 +1547,7 @@ synexpect(int token) STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) outfmt(&errout, "%s: %d: ", commandname, startlinno); @@ -1579,13 +1579,14 @@ getprompt(void *unused __unused) static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = "<internal prompt error>"; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1594,7 +1595,7 @@ getprompt(void *unused __unused) fmt = ps2val(); break; default: - return "<internal prompt error>"; + return internal_error; } /* |