forked from Imagelibrary/binutils-gdb
gdb: remove TYPE_NFIELDS macro
Remove `TYPE_NFIELDS`, changing all the call sites to use `type::num_fields` directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_NFIELDS): Remove. Change all cal sites to use type::num_fields instead. Change-Id: Ib73be4c36f9e770e0f729bac3b5257d7cb2f9591
This commit is contained in:
@@ -587,7 +587,7 @@ generic_val_print_enum_1 (struct type *type, LONGEST val,
|
||||
unsigned int i;
|
||||
unsigned int len;
|
||||
|
||||
len = TYPE_NFIELDS (type);
|
||||
len = type->num_fields ();
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
QUIT;
|
||||
@@ -1135,7 +1135,7 @@ val_print_type_code_flags (struct type *type, struct value *original_value,
|
||||
const gdb_byte *valaddr = (value_contents_for_printing (original_value)
|
||||
+ embedded_offset);
|
||||
ULONGEST val = unpack_long (type, valaddr);
|
||||
int field, nfields = TYPE_NFIELDS (type);
|
||||
int field, nfields = type->num_fields ();
|
||||
struct gdbarch *gdbarch = get_type_arch (type);
|
||||
struct type *bool_type = builtin_type (gdbarch)->builtin_bool;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user