struct value *res_val;
- switch (TYPE_CODE (check_typedef (value_type (value))))
+ switch (check_typedef (value_type (value))->code ())
{
case TYPE_CODE_PTR:
res_val = value_ind (value);
type = value_type (value);
type = check_typedef (type);
- if (((TYPE_CODE (type) == TYPE_CODE_PTR)
- || (TYPE_CODE (type) == TYPE_CODE_REF))
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
+ if (((type->code () == TYPE_CODE_PTR)
+ || (type->code () == TYPE_CODE_REF))
+ && (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRUCT))
{
struct value *target;
- int was_pointer = TYPE_CODE (type) == TYPE_CODE_PTR;
+ int was_pointer = type->code () == TYPE_CODE_PTR;
if (was_pointer)
target = value_ind (value);
type = lookup_lvalue_reference_type (type);
}
}
- else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ else if (type->code () == TYPE_CODE_STRUCT)
type = value_rtti_type (value, NULL, NULL, NULL);
else
{
a subscript. */
struct value *tmp = coerce_ref (value);
struct type *tmp_type = check_typedef (value_type (tmp));
- if (TYPE_CODE (tmp_type) != TYPE_CODE_ARRAY
- && TYPE_CODE (tmp_type) != TYPE_CODE_PTR)
+ if (tmp_type->code () != TYPE_CODE_ARRAY
+ && tmp_type->code () != TYPE_CODE_PTR)
error (_("Cannot subscript requested type"));
struct value *res_val = value_subscript (tmp, value_as_long (index));
}
GDBSCM_HANDLE_GDB_EXCEPTION (exc);
- SCM_ASSERT_TYPE (TYPE_CODE (ftype) == TYPE_CODE_FUNC, self,
+ SCM_ASSERT_TYPE (ftype->code () == TYPE_CODE_FUNC, self,
SCM_ARG1, FUNC_NAME,
_("function (value of TYPE_CODE_FUNC)"));
static int
is_intlike (struct type *type, int ptr_ok)
{
- return (TYPE_CODE (type) == TYPE_CODE_INT
- || TYPE_CODE (type) == TYPE_CODE_ENUM
- || TYPE_CODE (type) == TYPE_CODE_BOOL
- || TYPE_CODE (type) == TYPE_CODE_CHAR
- || (ptr_ok && TYPE_CODE (type) == TYPE_CODE_PTR));
+ return (type->code () == TYPE_CODE_INT
+ || type->code () == TYPE_CODE_ENUM
+ || type->code () == TYPE_CODE_BOOL
+ || type->code () == TYPE_CODE_CHAR
+ || (ptr_ok && type->code () == TYPE_CODE_PTR));
}
/* (value->bool <gdb:value>) -> boolean
try
{
- if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ if (type->code () == TYPE_CODE_PTR)
l = value_as_address (value);
else
l = value_as_long (value);
try
{
- if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ if (type->code () == TYPE_CODE_PTR)
l = value_as_address (value);
else
l = value_as_long (value);
}
GDBSCM_HANDLE_GDB_EXCEPTION (exc);
- SCM_ASSERT_TYPE (is_intlike (type, 0) || TYPE_CODE (type) == TYPE_CODE_FLT,
+ SCM_ASSERT_TYPE (is_intlike (type, 0) || type->code () == TYPE_CODE_FLT,
self, SCM_ARG1, FUNC_NAME, _("number"));
try
type = value_type (value);
realtype = check_typedef (type);
- switch (TYPE_CODE (realtype))
+ switch (realtype->code ())
{
case TYPE_CODE_ARRAY:
{