Simple -Wshadow=local fixes
authorTom Tromey <tom@tromey.com>
Sat, 21 Apr 2018 22:16:27 +0000 (16:16 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 5 Oct 2018 04:51:45 +0000 (22:51 -0600)
commitb926417afaea99ed17663e06d6654d0048536017
treeb26a979c2f74c28f5c8979f55acfdacefdb18cfb
parent1f88d0c87c37d3a15fa6376335e8b0d1c79d85aa
Simple -Wshadow=local fixes

This fixes all the straightforward -Wshadow=local warnings in gdb.  A
few standard approaches are used here:

* Renaming an inner (or outer, but more commonly inner) variable;
* Lowering a declaration to avoid a clash;
* Moving a declaration into a more inner scope to avoid a clash,
  including the special case of moving a declaration into a loop header.

I did not consider any of the changes in this patch to be particularly
noteworthy, though of course they should all still be examined.

gdb/ChangeLog
2018-10-04  Tom Tromey  <tom@tromey.com>

* ctf.c (SET_ARRAY_FIELD): Rename "u32".
* p-valprint.c (pascal_val_print): Split inner "i" variable.
* xtensa-tdep.c (xtensa_push_dummy_call): Declare "i" in loop
header.
* xstormy16-tdep.c (xstormy16_push_dummy_call): Declare "val" in
more inner scope.
* xcoffread.c (read_xcoff_symtab): Rename inner "symbol".
* varobj.c (varobj_update): Rename inner "newobj",
"type_changed".
* valprint.c (generic_emit_char): Rename inner "buf".
* valops.c (find_overload_match): Rename inner "temp".
(value_struct_elt_for_reference): Declare "v" in more inner
scope.
* v850-tdep.c (v850_push_dummy_call): Rename "len".
* unittests/array-view-selftests.c (run_tests): Rename inner
"vec".
* tui/tui-stack.c (tui_show_frame_info): Declare "i" in loop
header.
* tracepoint.c (merge_uploaded_trace_state_variables): Declare
"tsv" in more inner scope.
(print_one_static_tracepoint_marker): Rename inner
"tuple_emitter".
* tic6x-tdep.c (tic6x_analyze_prologue): Declare "inst" lower.
(tic6x_push_dummy_call): Don't redeclare "addr".
* target-float.c: Declare "dto" lower.
* symtab.c (lookup_local_symbol): Rename inner "sym".
(find_pc_sect_line): Rename inner "pc".
* stack.c (print_frame): Don't redeclare "gdbarch".
(return_command): Rename inner "gdbarch".
* s390-tdep.c (s390_prologue_frame_unwind_cache): Renam inner
"sp".
* rust-lang.c (rust_internal_print_type): Declare "i" in loop
header.
* rs6000-tdep.c (ppc_process_record): Rename inner "addr".
* riscv-tdep.c (riscv_push_dummy_call): Declare "info" in inner
scope.
* remote.c (remote_target::update_thread_list): Don't redeclare
"tp".
(remote_target::process_initial_stop_replies): Rename inner
"thread".
(remote_target::remote_parse_stop_reply): Don't redeclare "p".
(remote_target::wait_as): Don't redeclare "stop_reply".
(remote_target::get_thread_local_address): Rename inner
"result".
(remote_target::get_tib_address): Likewise.
67 files changed:
gdb/ChangeLog
gdb/arch/arm-get-next-pcs.c
gdb/arm-tdep.c
gdb/breakpoint.c
gdb/c-exp.y
gdb/cli/cli-cmds.c
gdb/cli/cli-utils.c
gdb/coffread.c
gdb/common/agent.c
gdb/compile/compile.c
gdb/cp-support.c
gdb/cp-valprint.c
gdb/csky-tdep.c
gdb/ctf.c
gdb/disasm-selftests.c
gdb/disasm.c
gdb/dwarf2-frame.c
gdb/dwarf2expr.c
gdb/dwarf2loc.c
gdb/dwarf2read.c
gdb/elfread.c
gdb/eval.c
gdb/f-exp.y
gdb/findvar.c
gdb/guile/scm-symbol.c
gdb/hppa-bsd-tdep.c
gdb/ia64-tdep.c
gdb/infrun.c
gdb/linespec.c
gdb/linux-tdep.c
gdb/machoread.c
gdb/main.c
gdb/mdebugread.c
gdb/mep-tdep.c
gdb/mi/mi-cmd-var.c
gdb/mi/mi-main.c
gdb/microblaze-tdep.c
gdb/mips-tdep.c
gdb/nat/linux-osdata.c
gdb/nios2-tdep.c
gdb/objfiles.c
gdb/p-exp.y
gdb/p-valprint.c
gdb/parse.c
gdb/ppc-linux-tdep.c
gdb/ppc-sysv-tdep.c
gdb/record-btrace.c
gdb/regcache.c
gdb/remote.c
gdb/riscv-tdep.c
gdb/rs6000-tdep.c
gdb/rust-lang.c
gdb/s390-tdep.c
gdb/stack.c
gdb/symtab.c
gdb/target-float.c
gdb/tic6x-tdep.c
gdb/tracepoint.c
gdb/tui/tui-stack.c
gdb/unittests/array-view-selftests.c
gdb/v850-tdep.c
gdb/valops.c
gdb/valprint.c
gdb/varobj.c
gdb/xcoffread.c
gdb/xstormy16-tdep.c
gdb/xtensa-tdep.c
This page took 0.031108 seconds and 4 git commands to generate.