aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/scm-math.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/guile/scm-math.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/guile/scm-math.c')
-rw-r--r--gdb/guile/scm-math.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index 12784d6..7c63fa2 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -65,7 +65,7 @@ enum valscm_binary_opcode
/* If TYPE is a reference, return the target; otherwise return TYPE. */
#define STRIP_REFERENCE(TYPE) \
- ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
+ ((TYPE->code () == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
/* Helper for vlscm_unop. Contains all the code that may throw a GDB
exception. */
@@ -168,10 +168,10 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
- if (TYPE_CODE (ltype) == TYPE_CODE_PTR
+ if (ltype->code () == TYPE_CODE_PTR
&& is_integral_type (rtype))
res_val = value_ptradd (arg1, value_as_long (arg2));
- else if (TYPE_CODE (rtype) == TYPE_CODE_PTR
+ else if (rtype->code () == TYPE_CODE_PTR
&& is_integral_type (ltype))
res_val = value_ptradd (arg2, value_as_long (arg1));
else
@@ -188,15 +188,15 @@ vlscm_binop_gdbthrow (enum valscm_binary_opcode opcode, SCM x, SCM y,
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
- if (TYPE_CODE (ltype) == TYPE_CODE_PTR
- && TYPE_CODE (rtype) == TYPE_CODE_PTR)
+ if (ltype->code () == TYPE_CODE_PTR
+ && rtype->code () == TYPE_CODE_PTR)
{
/* A ptrdiff_t for the target would be preferable here. */
res_val
= value_from_longest (builtin_type (gdbarch)->builtin_long,
value_ptrdiff (arg1, arg2));
}
- else if (TYPE_CODE (ltype) == TYPE_CODE_PTR
+ else if (ltype->code () == TYPE_CODE_PTR
&& is_integral_type (rtype))
res_val = value_ptradd (arg1, - value_as_long (arg2));
else
@@ -525,7 +525,7 @@ vlscm_convert_typed_number (const char *func_name, int obj_arg_pos, SCM obj,
struct gdbarch *gdbarch, SCM *except_scmp)
{
if (is_integral_type (type)
- || TYPE_CODE (type) == TYPE_CODE_PTR)
+ || type->code () == TYPE_CODE_PTR)
{
if (TYPE_UNSIGNED (type))
{
@@ -558,7 +558,7 @@ vlscm_convert_typed_number (const char *func_name, int obj_arg_pos, SCM obj,
return value_from_longest (type, gdbscm_scm_to_longest (obj));
}
}
- else if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ else if (type->code () == TYPE_CODE_FLT)
return value_from_host_double (type, scm_to_double (obj));
else
{