Skip to content

Commit e68dd76

Browse files
committed
Remove some uses of longest_to_int from ada-lang.c
A few spots in ada-lang.c use longest_to_int -- but in a context where the value is immediately passed to a function accepting LONGEST. This patch removes the offending calls. It turned out to be easy to change find_struct_field as well, so I've included that in this patch.
1 parent adb23bc commit e68dd76

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

gdb/ada-lang.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static struct value *ada_search_struct_field (const char *, struct value *, int,
182182
struct type *);
183183

184184
static int find_struct_field (const char *, struct type *, int,
185-
struct type **, int *, int *, int *, int *);
185+
struct type **, int *, int *, int *, LONGEST *);
186186

187187
static int ada_resolve_function (std::vector<struct block_symbol> &,
188188
struct value **, int, const char *,
@@ -2175,8 +2175,8 @@ ada_type_of_array (struct value *arr, int bounds)
21752175
arity -= 1;
21762176
struct type *range_type
21772177
= create_static_range_type (alloc, low->type (),
2178-
longest_to_int (value_as_long (low)),
2179-
longest_to_int (value_as_long (high)));
2178+
value_as_long (low),
2179+
value_as_long (high));
21802180
elt_type = create_array_type (alloc, elt_type, range_type);
21812181
INIT_GNAT_SPECIFIC (elt_type);
21822182

@@ -6932,7 +6932,7 @@ static int
69326932
find_struct_field (const char *name, struct type *type, int offset,
69336933
struct type **field_type_p,
69346934
int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
6935-
int *index_p)
6935+
LONGEST *index_p)
69366936
{
69376937
int i;
69386938
int parent_offset = -1;
@@ -7046,12 +7046,10 @@ find_struct_field (const char *name, struct type *type, int offset,
70467046

70477047
/* Number of user-visible fields in record type TYPE. */
70487048

7049-
static int
7049+
static LONGEST
70507050
num_visible_fields (struct type *type)
70517051
{
7052-
int n;
7053-
7054-
n = 0;
7052+
LONGEST n = 0;
70557053
find_struct_field (NULL, type, 0, NULL, NULL, NULL, NULL, &n);
70567054
return n;
70577055
}
@@ -9569,12 +9567,12 @@ void
95699567
ada_name_association::assign (aggregate_assigner &assigner,
95709568
operation_up &op)
95719569
{
9572-
int index;
9570+
LONGEST index;
95739571

95749572
if (ada_is_direct_array_type (assigner.lhs->type ()))
95759573
{
95769574
value *tem = m_val->evaluate (nullptr, assigner.exp, EVAL_NORMAL);
9577-
index = longest_to_int (value_as_long (tem));
9575+
index = value_as_long (tem);
95789576
}
95799577
else
95809578
{

0 commit comments

Comments
 (0)