struct type *element_type = TYPE_TARGET_TYPE (type);
unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
- if (element_length > 0
- && type->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED)
+ if (element_length > 0 && type->bounds ()->high.kind () == PROP_UNDEFINED)
{
struct type *range_type = type->index_type ();
int val_length = TYPE_LENGTH (type2);
if (current_language->c_style_arrays
&& type2->code () == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (type2))
+ && !type2->is_vector ())
arg2 = value_coerce_array (arg2);
if (type2->code () == TYPE_CODE_FUNC)
}
/* The only option left is an integral type. */
- if (TYPE_UNSIGNED (type2))
+ if (type2->is_unsigned ())
return value_from_ulongest (to_type, value_as_long (arg2));
else
return value_from_longest (to_type, value_as_long (arg2));
minus one, instead of biasing the normal case. */
return value_from_longest (to_type, -1);
}
- else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
- && code2 == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)
+ else if (code1 == TYPE_CODE_ARRAY && type->is_vector ()
+ && code2 == TYPE_CODE_ARRAY && type2->is_vector ()
&& TYPE_LENGTH (type) != TYPE_LENGTH (type2))
error (_("Cannot convert between vector values of different sizes"));
- else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && scalar
+ else if (code1 == TYPE_CODE_ARRAY && type->is_vector () && scalar
&& TYPE_LENGTH (type) != TYPE_LENGTH (type2))
error (_("can only cast scalar to vector of same size"));
else if (code1 == TYPE_CODE_VOID)
{
val = value_from_longest (type, (LONGEST) 1);
}
- else if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
+ else if (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
{
struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type1));
int i;
LONGEST valmask = (((ULONGEST) 1) << value_bitsize (toval)) - 1;
fieldval &= valmask;
- if (!TYPE_UNSIGNED (type)
+ if (!type->is_unsigned ()
&& (fieldval & (valmask ^ (valmask >> 1))))
fieldval |= ~valmask;
switch (valtype->code ())
{
case TYPE_CODE_ARRAY:
- return TYPE_VECTOR (valtype) ? 0 : 1;
+ return valtype->is_vector () ? 0 : 1;
case TYPE_CODE_STRING:
return true;
default:
enc_type = check_typedef (value_enclosing_type (arg1));
enc_type = TYPE_TARGET_TYPE (enc_type);
+ CORE_ADDR base_addr;
if (check_typedef (enc_type)->code () == TYPE_CODE_FUNC
|| check_typedef (enc_type)->code () == TYPE_CODE_METHOD)
- /* For functions, go through find_function_addr, which knows
- how to handle function descriptors. */
- arg2 = value_at_lazy (enc_type,
- find_function_addr (arg1, NULL));
+ {
+ /* For functions, go through find_function_addr, which knows
+ how to handle function descriptors. */
+ base_addr = find_function_addr (arg1, NULL);
+ }
else
- /* Retrieve the enclosing object pointed to. */
- arg2 = value_at_lazy (enc_type,
- (value_as_address (arg1)
- - value_pointed_to_offset (arg1)));
-
+ {
+ /* Retrieve the enclosing object pointed to. */
+ base_addr = (value_as_address (arg1)
+ - value_pointed_to_offset (arg1));
+ }
+ arg2 = value_at_lazy (enc_type, base_addr);
enc_type = value_type (arg2);
- return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
+ return readjust_indirect_value_type (arg2, enc_type, base_type,
+ arg1, base_addr);
}
error (_("Attempt to take contents of a non-pointer value."));
while (j >= 0)
{
if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
- TYPE_VARARGS (TYPE_FN_FIELD_TYPE (f, j)),
+ TYPE_FN_FIELD_TYPE (f, j)->has_varargs (),
TYPE_FN_FIELD_TYPE (f, j)->num_fields (),
TYPE_FN_FIELD_ARGS (f, j), args))
{