diff options
author | Eric Blake <eblake@redhat.com> | 2010-08-30 15:52:27 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-08-30 15:52:27 -0600 |
commit | dadaf5f2d58ffd484bd5141fc808552b8f17467d (patch) | |
tree | 9abd396cb3ccd5a3eb0dff7117c54e6f94ecb3f2 | |
parent | edf2d2a2af08b0d4af530150c1c7b504c803a637 (diff) | |
download | m4-dadaf5f2d58ffd484bd5141fc808552b8f17467d.tar.gz |
Clean up compiler warnings.
* src/builtin.c (m4_patsubst): Drop dead store.
* src/eval.c (unary_term): Likewise.
* src/input.c (match_input): Likewise. Also drop useless casts to
void.
* src/symtab.c (symtab_debug): Drop useless casts.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/builtin.c | 1 | ||||
-rw-r--r-- | src/eval.c | 3 | ||||
-rw-r--r-- | src/input.c | 10 | ||||
-rw-r--r-- | src/symtab.c | 5 |
5 files changed, 14 insertions, 12 deletions
@@ -1,5 +1,12 @@ 2010-08-30 Eric Blake <eblake@redhat.com> + Clean up compiler warnings. + * src/builtin.c (m4_patsubst): Drop dead store. + * src/eval.c (unary_term): Likewise. + * src/input.c (match_input): Likewise. Also drop useless casts to + void. + * src/symtab.c (symtab_debug): Drop useless casts. + Test previous commit. * doc/m4.texinfo (Format): Add a test. * NEWS: Document the fix. diff --git a/src/builtin.c b/src/builtin.c index 6efa9017..4b714f8f 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -2130,7 +2130,6 @@ m4_patsubst (struct obstack *obs, int argc, token_data **argv) length = strlen (victim); offset = 0; - matchpos = 0; while (offset <= length) { matchpos = re_search (&buf, victim, length, @@ -789,12 +789,11 @@ exp_term (eval_token et, int32_t *v1) static eval_error unary_term (eval_token et, int32_t *v1) { - eval_token et2 = et; eval_error er; if (et == PLUS || et == MINUS || et == NOT || et == LNOT) { - et2 = eval_lex (v1); + eval_token et2 = eval_lex (v1); if (et2 == ERROR) return UNKNOWN_INPUT; diff --git a/src/input.c b/src/input.c index 6d8eee1d..c16f6f1c 100644 --- a/src/input.c +++ b/src/input.c @@ -614,14 +614,14 @@ match_input (const char *s, bool consume) if (s[1] == '\0') { if (consume) - (void) next_char (); + next_char (); return true; /* short match */ } - (void) next_char (); - for (n = 1, t = s++; (ch = peek_input ()) == to_uchar (*s++); ) + next_char (); + for (n = 1, t = s++; peek_input () == to_uchar (*s++); ) { - (void) next_char (); + next_char (); n++; if (*s == '\0') /* long match */ { @@ -883,7 +883,7 @@ next_token (token_data *td, int *line) while ((ch = peek_input ()) != CHAR_EOF && (isalnum (ch) || ch == '_')) { obstack_1grow (&token_stack, ch); - (void) next_char (); + next_char (); } type = TOKEN_WORD; } diff --git a/src/symtab.c b/src/symtab.c index 7012cbe5..6519a87d 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -374,10 +374,7 @@ symtab_debug (void) if (s == NULL) xprintf ("Name `%s' is unknown\n", text); - if (delete) - (void) lookup_symbol (text, SYMBOL_DELETE); - else - (void) lookup_symbol (text, SYMBOL_INSERT); + lookup_symbol (text, delete ? SYMBOL_DELETE : SYMBOL_INSERT); } symtab_print_list (i++); } |