Make function fixed_point_scaling_factor a method of struct type

This logically connects this function to the object it inspects.

gdb/ChangeLog:

        * gdbtypes.h (struct type) <fixed_point_scaling_factor>: New method,
        replacing fixed_point_scaling_factor.  All callers updated
        throughout this project.
        (fixed_point_scaling_factor): Delete declaration.
        * gdbtypes.c (type::fixed_point_scaling_factor): Replaces
        fixed_point_scaling_factor.  Adjust implementation accordingly.
This commit is contained in:
Joel Brobecker 2020-11-23 21:49:13 -05:00
parent d19937a74c
commit e6fcee3a73
8 changed files with 26 additions and 15 deletions

View file

@ -2814,7 +2814,7 @@ unpack_long (struct type *type, const gdb_byte *valaddr)
gdb_mpq vq;
vq.read_fixed_point (gdb::make_array_view (valaddr, len),
byte_order, nosign,
fixed_point_scaling_factor (type));
type->fixed_point_scaling_factor ());
gdb_mpz vz;
mpz_tdiv_q (vz.val, mpq_numref (vq.val), mpq_denref (vq.val));