diff options
author | Josh Triplett <josh@freedesktop.org> | 2007-05-01 11:30:58 -0700 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2007-05-01 11:30:58 -0700 |
commit | bda7c7c515496a78ceb57d2ee07746f33e3c0c79 (patch) | |
tree | b63c409cae82f13b5c02a060f867142b954dd74d | |
parent | aec53c938c34c47cdbdd6824552e0f2a5104b1cb (diff) | |
download | sparse-0.3.tar.gz |
Fix most -Wshadow warnings in Sparse.0.3
Signed-off-by: Josh Triplett <josh@freedesktop.org>
-rw-r--r-- | compile-i386.c | 2 | ||||
-rw-r--r-- | ctags.c | 9 | ||||
-rw-r--r-- | evaluate.c | 8 | ||||
-rw-r--r-- | example.c | 2 | ||||
-rw-r--r-- | parse.c | 1 |
5 files changed, 10 insertions, 12 deletions
diff --git a/compile-i386.c b/compile-i386.c index a6c4431b..425a1bc7 100644 --- a/compile-i386.c +++ b/compile-i386.c @@ -1006,8 +1006,6 @@ static void sort_array(struct expression *expr) list[0] = entry; sorted = 1; } else { - unsigned int i; - for (i = 0; i < sorted; i++) if (sort_array_cmp(entry, list[i]) <= 0) break; @@ -28,12 +28,13 @@ static int cmp_sym(const void *m, const void *n) struct ident *b = ((struct symbol *)n)->ident; int ret = strncmp(a->name, b->name, MAX(a->len, b->len)); if (!ret) { - struct position a = ((struct symbol *)m)->pos; - struct position b = ((struct symbol *)n)->pos; + struct position a_pos = ((struct symbol *)m)->pos; + struct position b_pos = ((struct symbol *)n)->pos; - ret = strcmp(stream_name(a.stream), stream_name(b.stream)); + ret = strcmp(stream_name(a_pos.stream), + stream_name(b_pos.stream)); if (!ret) - return a.line < b.line; + return a_pos.line < b_pos.line; } return ret; } @@ -785,11 +785,11 @@ const char * type_difference(struct symbol *target, struct symbol *source, PREPARE_PTR_LIST(source->arguments, arg2); i = 1; for (;;) { - const char *diff; - diff = type_difference(arg1, arg2, 0, 0); - if (diff) { + const char *diffstr; + diffstr = type_difference(arg1, arg2, 0, 0); + if (diffstr) { static char argdiff[80]; - sprintf(argdiff, "incompatible argument %d (%s)", i, diff); + sprintf(argdiff, "incompatible argument %d (%s)", i, diffstr); return argdiff; } if (!arg1) @@ -679,7 +679,7 @@ static struct hardreg *copy_reg(struct bb_state *state, struct hardreg *src, pse } for (i = 0; i < REGNO; i++) { - struct hardreg *reg = hardregs + i; + reg = hardregs + i; if (!reg->contains) { output_comment(state, "copying %s to %s", show_pseudo(target), reg->name); output_insn(state, "movl %s,%s", src->name, reg->name); @@ -1954,7 +1954,6 @@ static struct token *parse_function_body(struct token *token, struct symbol *dec if (!function_computed_target_list) warning(decl->pos, "function '%s' has computed goto but no targets?", show_ident(decl->ident)); else { - struct statement *stmt; FOR_EACH_PTR(function_computed_goto_list, stmt) { stmt->target_list = function_computed_target_list; } END_FOR_EACH_PTR(stmt); |