From b76c14e4528bc50f501084a386549b441cd335cf Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Mon, 22 Dec 2008 08:18:01 -0800 Subject: [PATCH] Shadow reduction part 6 Finish cleaning up shadowed variables, flagged by turning on -Wshadow. No intended change in functionality. Patch looks right, and is tested to compile and run on my machine. No regressions in the test suite. This is the end of the simple, coordination-free patches. The remaining shadows are special cases that will need extra attention. --- elaborate_analog.cc | 6 +++--- netlist.cc | 4 ++-- tgt-vhdl/vhdl_syntax.cc | 4 ++-- vvp/vpip_bin.cc | 10 +++++----- vvp/vpip_hex.cc | 4 ++-- vvp/vpip_oct.cc | 4 ++-- vvp/vpip_to_dec.cc | 4 ++-- vvp/vvp_net.h | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/elaborate_analog.cc b/elaborate_analog.cc index d6c4d6405..5d538b98d 100644 --- a/elaborate_analog.cc +++ b/elaborate_analog.cc @@ -48,11 +48,11 @@ NetProc* AContrib::elaborate(Design*des, NetScope*scope) const bool AProcess::elaborate(Design*des, NetScope*scope) const { - NetProc*statement = statement_->elaborate(des, scope); - if (statement == 0) + NetProc*estatement = statement_->elaborate(des, scope); + if (estatement == 0) return false; - NetAnalogTop*top = new NetAnalogTop(scope, type_, statement); + NetAnalogTop*top = new NetAnalogTop(scope, type_, estatement); // Evaluate the attributes for this process, if there // are any. These attributes are to be attached to the diff --git a/netlist.cc b/netlist.cc index 16b262205..a8e588d19 100644 --- a/netlist.cc +++ b/netlist.cc @@ -879,8 +879,8 @@ const NetScope* NetProcTop::scope() const return scope_; } -NetAnalogTop::NetAnalogTop(NetScope*scope, ivl_process_type_t t, NetProc*st) -: type_(t), statement_(st), scope_(scope) +NetAnalogTop::NetAnalogTop(NetScope*scope__, ivl_process_type_t t, NetProc*st) +: type_(t), statement_(st), scope_(scope__) { next_ = 0; } diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index 65314de9d..8a699b7e8 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -87,8 +87,8 @@ vhdl_scope *vhdl_scope::get_parent() const } vhdl_entity::vhdl_entity(const char *name, const char *derived_from, - vhdl_arch *arch, int depth) - : depth(depth), name_(name), arch_(arch), derived_from_(derived_from) + vhdl_arch *arch, int depth__) + : depth(depth__), name_(name), arch_(arch), derived_from_(derived_from) { arch->get_scope()->set_parent(&ports_); } diff --git a/vvp/vpip_bin.cc b/vvp/vpip_bin.cc index ecbcd9eb6..e871f1c05 100644 --- a/vvp/vpip_bin.cc +++ b/vvp/vpip_bin.cc @@ -74,8 +74,8 @@ void vpip_bin_str_to_vec4(vvp_vector4_t&vec4, const char*buf) /* Return "x" if there are invalid digits in the string. */ fprintf(stderr, "Warning: Invalid binary digit %c(%d) in " "\"%s\".\n", *ebuf, *ebuf, buf); - for (unsigned idx = 0 ; idx < vec4.size() ; idx += 1) { - vec4.set_bit(idx, BIT4_X); + for (unsigned jdx = 0 ; jdx < vec4.size() ; jdx += 1) { + vec4.set_bit(jdx, BIT4_X); } return; break; @@ -109,8 +109,8 @@ void vpip_bin_str_to_vec4(vvp_vector4_t&vec4, const char*buf) break; } - for (unsigned idx = 0 ; idx < vec4.size() ; idx += 1) { - if (idx < tval.size()) vec4.set_bit(idx, tval.value(idx)); - else vec4.set_bit(idx, pad); + for (unsigned jdx = 0 ; jdx < vec4.size() ; jdx += 1) { + if (jdx < tval.size()) vec4.set_bit(jdx, tval.value(jdx)); + else vec4.set_bit(jdx, pad); } } diff --git a/vvp/vpip_hex.cc b/vvp/vpip_hex.cc index 3846ac235..2e24f6095 100644 --- a/vvp/vpip_hex.cc +++ b/vvp/vpip_hex.cc @@ -102,8 +102,8 @@ void vpip_hex_str_to_vec4(vvp_vector4_t&val, const char*str) /* Return "x" if there are invalid digits in the string. */ fprintf(stderr, "Warning: Invalid hex digit %c(%d) in " "\"%s\".\n", ch, ch, str); - for (unsigned idx = 0 ; idx < val.size() ; idx += 1) { - val.set_bit(idx, BIT4_X); + for (unsigned jdx = 0 ; jdx < val.size() ; jdx += 1) { + val.set_bit(jdx, BIT4_X); } return; break; diff --git a/vvp/vpip_oct.cc b/vvp/vpip_oct.cc index 0b28e102e..a6ee42df8 100644 --- a/vvp/vpip_oct.cc +++ b/vvp/vpip_oct.cc @@ -82,8 +82,8 @@ void vpip_oct_str_to_vec4(vvp_vector4_t&val, const char*str) /* Return "x" if there are invalid digits in the string. */ fprintf(stderr, "Warning: Invalid octal digit %c(%d) in " "\"%s\".\n", ch, ch, str); - for (unsigned idx = 0 ; idx < val.size() ; idx += 1) { - val.set_bit(idx, BIT4_X); + for (unsigned jdx = 0 ; jdx < val.size() ; jdx += 1) { + val.set_bit(jdx, BIT4_X); } return; break; diff --git a/vvp/vpip_to_dec.cc b/vvp/vpip_to_dec.cc index f59818845..ae189fbb1 100644 --- a/vvp/vpip_to_dec.cc +++ b/vvp/vpip_to_dec.cc @@ -283,8 +283,8 @@ void vpip_dec_str_to_vec4(vvp_vector4_t&vec, const char*buf) /* Return "x" if there are invalid digits in the string. */ fprintf(stderr, "Warning: Invalid decimal digit %c(%d) in " "\"%s.\"\n", buf[slen-idx-1], buf[slen-idx-1], buf); - for (unsigned idx = 0 ; idx < vec.size() ; idx += 1) { - vec.set_bit(idx, BIT4_X); + for (unsigned jdx = 0 ; jdx < vec.size() ; jdx += 1) { + vec.set_bit(jdx, BIT4_X); } return; } diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index e1bca9dec..03cd8a288 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -727,7 +727,7 @@ inline vvp_bit4_t vvp_scalar_t::value() const inline vvp_scalar_t resolve(vvp_scalar_t a, vvp_scalar_t b) { - extern vvp_scalar_t fully_featured_resolv_(vvp_scalar_t a, vvp_scalar_t b); + extern vvp_scalar_t fully_featured_resolv_(vvp_scalar_t, vvp_scalar_t); // If the value is HiZ, resolution is simply a matter of // returning the *other* value.