diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:15 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:15 -0400 |
commit | 1f704f761b34e145f5eabdc222301ce6e9ec9102 (patch) | |
tree | 89c8b6dbf40b606ef045929b718d9271093057a3 /gdb/m2-typeprint.c | |
parent | 5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff) | |
download | fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.bz2 |
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
Diffstat (limited to 'gdb/m2-typeprint.c')
-rw-r--r-- | gdb/m2-typeprint.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 9922299..d2596b2 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -284,7 +284,7 @@ m2_procedure (struct type *type, struct ui_file *stream, if (TYPE_TARGET_TYPE (type) == NULL || TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) { - int i, len = TYPE_NFIELDS (type); + int i, len = type->num_fields (); fprintf_filtered (stream, " ("); for (i = 0; i < len; i++) @@ -311,7 +311,7 @@ m2_print_bounds (struct type *type, { struct type *target = TYPE_TARGET_TYPE (type); - if (TYPE_NFIELDS(type) == 0) + if (type->num_fields () == 0) return; if (print_high) @@ -346,7 +346,7 @@ m2_is_long_set (struct type *type) /* check if all fields of the RECORD are consecutive sets. */ - len = TYPE_NFIELDS (type); + len = type->num_fields (); for (i = TYPE_N_BASECLASSES (type); i < len; i++) { if (TYPE_FIELD_TYPE (type, i) == NULL) @@ -409,7 +409,7 @@ m2_is_long_set_of_type (struct type *type, struct type **of_type) if (type->code () == TYPE_CODE_STRUCT) { - len = TYPE_NFIELDS (type); + len = type->num_fields (); i = TYPE_N_BASECLASSES (type); if (len == 0) return 0; @@ -434,7 +434,7 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level, { struct type *of_type; int i; - int len = TYPE_NFIELDS (type); + int len = type->num_fields (); LONGEST low; LONGEST high; @@ -490,7 +490,7 @@ m2_is_unbounded_array (struct type *type) * type of _m2_contents is a pointer. The TYPE_TARGET_TYPE * of the pointer determines the unbounded ARRAY OF type. */ - if (TYPE_NFIELDS (type) != 2) + if (type->num_fields () != 2) return 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "_m2_contents") != 0) return 0; @@ -550,7 +550,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, else if (show > 0) { int i; - int len = TYPE_NFIELDS (type); + int len = type->num_fields (); if (type->code () == TYPE_CODE_STRUCT) fprintf_filtered (stream, "RECORD\n"); @@ -601,7 +601,7 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) else if (show > 0 || type->name () == NULL) { fprintf_filtered (stream, "("); - len = TYPE_NFIELDS (type); + len = type->num_fields (); lastval = 0; for (i = 0; i < len; i++) { |