mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
Make fixed_point_type_base_type a method of struct type
As suggested by Simon, to logically connect this function to the object it inspects. Note that, logically, this method should be "const". Unfortunately, the implementation iterates on struct type objects starting with "this", and thus trying to declare the method "const" triggers a compilation error. gdb/ChangeLog: * gdbtypes.h (struct type) <fixed_point_type_base_type> New method, replacing the fixed_point_type_base_type function. All callers updated throughout this project. (fixed_point_type_base_type): Remove declaration. * gdbtypes.c (type::fixed_point_type_base_type): Replaces fixed_point_type_base_type. Adjust implementation accordingly.
This commit is contained in:
@ -5866,8 +5866,10 @@ is_fixed_point_type (struct type *type)
|
||||
/* See gdbtypes.h. */
|
||||
|
||||
struct type *
|
||||
fixed_point_type_base_type (struct type *type)
|
||||
type::fixed_point_type_base_type ()
|
||||
{
|
||||
struct type *type = this;
|
||||
|
||||
while (check_typedef (type)->code () == TYPE_CODE_RANGE)
|
||||
type = TYPE_TARGET_TYPE (check_typedef (type));
|
||||
type = check_typedef (type);
|
||||
@ -5881,7 +5883,7 @@ fixed_point_type_base_type (struct type *type)
|
||||
const gdb_mpq &
|
||||
fixed_point_scaling_factor (struct type *type)
|
||||
{
|
||||
type = fixed_point_type_base_type (type);
|
||||
type = type->fixed_point_type_base_type ();
|
||||
|
||||
return type->fixed_point_info ().scaling_factor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user