aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-08-26 11:29:01 -0600
committerTom Tromey <tromey@adacore.com>2024-09-09 11:47:17 -0600
commit511c6575b2febee533a4d8796647bbabc2c27249 (patch)
tree185b19b00278b437c4c8b3c159b6e9c6b5e5bbac /gdb/ada-lang.c
parent6b8262318783e5cf30db7a1792b29fb463537444 (diff)
downloadbinutils-511c6575b2febee533a4d8796647bbabc2c27249.zip
binutils-511c6575b2febee533a4d8796647bbabc2c27249.tar.gz
binutils-511c6575b2febee533a4d8796647bbabc2c27249.tar.bz2
Minor cleanup to ada_identical_enum_types_p
This moves the declaration of 'i' into the 'for' loops in ada_identical_enum_types_p. This is just a trivial cleanup. Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 8d5d667..57f2b2b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4976,21 +4976,19 @@ is_nondebugging_type (struct type *type)
static bool
ada_identical_enum_types_p (struct type *type1, struct type *type2)
{
- int i;
-
/* The heuristic we use here is fairly conservative. We consider
that 2 enumerate types are identical if they have the same
number of enumerals and that all enumerals have the same
underlying value and name. */
/* All enums in the type should have an identical underlying value. */
- for (i = 0; i < type1->num_fields (); i++)
+ for (int i = 0; i < type1->num_fields (); i++)
if (type1->field (i).loc_enumval () != type2->field (i).loc_enumval ())
return false;
/* All enumerals should also have the same name (modulo any numerical
suffix). */
- for (i = 0; i < type1->num_fields (); i++)
+ for (int i = 0; i < type1->num_fields (); i++)
{
const char *name_1 = type1->field (i).name ();
const char *name_2 = type2->field (i).name ();