-/* Copyright (C) 2020 Free Software Foundation, Inc.
+/* Copyright (C) 2020-2021 Free Software Foundation, Inc.
This file is part of GDB.
/* Get the range, and extract the bounds. */
struct type *range_type = type->index_type ();
- if (get_discrete_bounds (range_type, &m_lowerbound, &m_upperbound) < 0)
+ if (!get_discrete_bounds (range_type, &m_lowerbound, &m_upperbound))
error ("unable to read array bounds");
/* Figure out the stride for this array. */
m_stride = type_length_units (elt_type);
else
{
- struct gdbarch *arch = get_type_arch (elt_type);
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size
+ = gdbarch_addressable_memory_unit_size (elt_type->arch ());
m_stride /= (unit_size * 8);
}
};
/* Extract the range, and get lower and upper bounds. */
struct type *range_type = check_typedef (type)->index_type ();
LONGEST lowerbound, upperbound;
- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
+ if (!get_discrete_bounds (range_type, &lowerbound, &upperbound))
error ("failed to get range bounds");
/* CALC is used to calculate the offsets for each element in this