From 7813437494ac39f3aef392d06ed5416e84fe386b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 May 2020 13:46:38 -0400 Subject: gdb: remove TYPE_CODE macro Remove TYPE_CODE, changing all the call sites to use type::code 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_CODE): Remove. Change all call sites to use type::code instead. --- gdb/m2-lang.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/m2-lang.c') diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index af3cf3a..7f0255b 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -181,15 +181,15 @@ static bool m2_is_string_type_p (struct type *type) { type = check_typedef (type); - if (TYPE_CODE (type) == TYPE_CODE_ARRAY + if (type->code () == TYPE_CODE_ARRAY && TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) { struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type)); if (TYPE_LENGTH (elttype) == 1 - && (TYPE_CODE (elttype) == TYPE_CODE_INT - || TYPE_CODE (elttype) == TYPE_CODE_CHAR)) + && (elttype->code () == TYPE_CODE_INT + || elttype->code () == TYPE_CODE_CHAR)) return true; } @@ -251,7 +251,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp, { struct value *temp = arg1; type = TYPE_FIELD_TYPE (type, 0); - if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR)) + if (type == NULL || (type->code () != TYPE_CODE_PTR)) { warning (_("internal error: unbounded " "array structure is unknown")); @@ -269,7 +269,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp, return value_ind (value_ptradd (arg1, value_as_long (arg2))); } else - if (TYPE_CODE (type) != TYPE_CODE_ARRAY) + if (type->code () != TYPE_CODE_ARRAY) { if (TYPE_NAME (type)) error (_("cannot subscript something of type `%s'"), -- cgit v1.1