aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
commit7813437494ac39f3aef392d06ed5416e84fe386b (patch)
tree15290bf5b2bd9d23c59103a6a42b99adc0111d6d /gdb/m2-lang.c
parent67607e24d0413828acdfa9bc38f6fbac40b860b9 (diff)
downloadgdb-7813437494ac39f3aef392d06ed5416e84fe386b.zip
gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.gz
gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.bz2
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.
Diffstat (limited to 'gdb/m2-lang.c')
-rw-r--r--gdb/m2-lang.c10
1 files changed, 5 insertions, 5 deletions
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'"),