sim: arm: fix -Wshadow=local warnings

Remove duplicate nested variable declarations, rename some to avoid
confusion when the type is different or the original value should be
retained, and fix some weirdness with nested enums in structs.
This commit is contained in:
Mike Frysinger
2023-12-21 20:03:41 -05:00
parent 2bf4edd2ea
commit 8ce49cf102
3 changed files with 30 additions and 46 deletions

View File

@@ -746,14 +746,14 @@ sim_target_parse_command_line (int argc, char ** argv)
while (* ptr)
{
int i;
int o;
for (i = ARRAY_SIZE (options); i--;)
if (strncmp (ptr, options[i].swi_option,
strlen (options[i].swi_option)) == 0)
for (o = ARRAY_SIZE (options); o--;)
if (strncmp (ptr, options[o].swi_option,
strlen (options[o].swi_option)) == 0)
{
swi_mask |= options[i].swi_mask;
ptr += strlen (options[i].swi_option);
swi_mask |= options[o].swi_mask;
ptr += strlen (options[o].swi_option);
if (* ptr == ',')
++ ptr;
@@ -761,7 +761,7 @@ sim_target_parse_command_line (int argc, char ** argv)
break;
}
if (i < 0)
if (o < 0)
break;
}
@@ -884,8 +884,6 @@ sim_open (SIM_OPEN_KIND kind,
if (argv_copy[1] != NULL)
{
int i;
/* Scan for memory-size switches. */
for (i = 0; (argv_copy[i] != NULL) && (argv_copy[i][0] != 0); i++)
if (argv_copy[i][0] == '-' && argv_copy[i][1] == 'm')