[04/15] sim: common: fix -Wshadow=local warnings

Message ID 20231222012355.7504-4-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
  Rename shadowed vars with different types, and delete redundant decls.
---
 sim/common/sim-fpu.c     | 4 ++--
 sim/common/sim-options.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c
index 491a99b7212e..4ee26723ee26 100644
--- a/sim/common/sim-fpu.c
+++ b/sim/common/sim-fpu.c
@@ -413,9 +413,9 @@  unpack_fpu (sim_fpu *dst, uint64_t packed, int is_double)
       }
     else
       {
-	uint32_t val = pack_fpu (dst, 0);
+	uint32_t fval = pack_fpu (dst, 0);
 	uint32_t org = packed;
-	ASSERT (val == org);
+	ASSERT (fval == org);
       }
   }
 }
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index 9f238339fb8f..c695db687cb1 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -496,7 +496,7 @@  standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
 
     case OPTION_ENV_UNSET:
       {
-	int i, varlen;
+	int varlen;
 	char **envp;
 
 	if (STATE_PROG_ENVP (sd) == NULL)