[10/15] sim: m68hc11: fix -Wshadow=local warnings

Message ID 20231222012355.7504-10-vapier@gentoo.org
State New
Headers
Series [01/15] sim: aarch64: fix -Wshadow=local warnings |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Mike Frysinger Dec. 22, 2023, 1:23 a.m. UTC
  Delete redundant decls when the existing scope has the same var and
type available for use.
---
 sim/m68hc11/dv-m68hc11.c    | 3 +--
 sim/m68hc11/dv-m68hc11sio.c | 2 +-
 sim/m68hc11/interp.c        | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c
index ef18f0999360..fc8b22cede3f 100644
--- a/sim/m68hc11/dv-m68hc11.c
+++ b/sim/m68hc11/dv-m68hc11.c
@@ -782,7 +782,6 @@  m68hc11_option_handler (SIM_DESC sd, sim_cpu *cpu,
           osc = &controller->oscillators[i];
           if (osc->event)
             {
-              double f;
               int cur_value;
               int next_value;
               char freq[32];
@@ -927,7 +926,7 @@  m68hc11cpu_set_port (struct hw *me, sim_cpu *cpu,
       /* Scan IC3, IC2 and IC1.  Bit number is 3 - i.  */
       for (i = 0; i < 3; i++)
         {
-          uint8_t mask = (1 << i);
+          mask = (1 << i);
           
           if (delta & mask)
             {
diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c
index 03b44613c180..f77dfdec1f99 100644
--- a/sim/m68hc11/dv-m68hc11sio.c
+++ b/sim/m68hc11/dv-m68hc11sio.c
@@ -227,7 +227,7 @@  m68hc11sio_port_event (struct hw *me,
            simulate some initial setup by the internal rom.  */
         if (((m68hc11_cpu->ios[M6811_HPRIO]) & (M6811_SMOD | M6811_MDA)) == M6811_SMOD)
           {
-            unsigned char val = 0x33;
+            val = 0x33;
             
             m68hc11sio_io_write_buffer (me, &val, io_map,
                                         (unsigned_word) M6811_BAUD, 1);
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index df6bd7bea565..c4d5c22fa075 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -478,7 +478,7 @@  sim_open (SIM_OPEN_KIND kind, host_callback *callback,
   /* CPU specific initialization.  */
   for (i = 0; i < MAX_NR_PROCESSORS; ++i)
     {
-      SIM_CPU *cpu = STATE_CPU (sd, i);
+      cpu = STATE_CPU (sd, i);
 
       CPU_REG_FETCH (cpu) = m68hc11_reg_fetch;
       CPU_REG_STORE (cpu) = m68hc11_reg_store;