{
value_ptr bound;
int c_style = current_language->c_style_arrays;
- struct type *tarray, *tint;
+ struct type *tarray;
COERCE_REF (array);
tarray = check_typedef (VALUE_TYPE (array));
LONGEST index = value_as_long (idx);
value_ptr v;
int offset, byte, bit_index;
- LONGEST lowerbound, upperbound, word;
+ LONGEST lowerbound, upperbound;
get_discrete_bounds (range_type, &lowerbound, &upperbound);
if (index < lowerbound || index > upperbound)
error ("bitstring index out of range");
{
struct type *array_type = check_typedef (VALUE_TYPE (array));
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
- int elt_size = TYPE_LENGTH (elt_type);
+ unsigned int elt_size = TYPE_LENGTH (elt_type);
LONGEST index = value_as_long (idx);
- int elt_offs = elt_size * longest_to_int (index - lowerbound);
+ unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
value_ptr v;
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
/* FIXME: This implements ANSI C rules (also correct for C++).
What about FORTRAN and chill? */
{
- int promoted_len1 = TYPE_LENGTH (type1);
- int promoted_len2 = TYPE_LENGTH (type2);
+ unsigned int promoted_len1 = TYPE_LENGTH (type1);
+ unsigned int promoted_len2 = TYPE_LENGTH (type2);
int is_unsigned1 = TYPE_UNSIGNED (type1);
int is_unsigned2 = TYPE_UNSIGNED (type2);
- int result_len;
+ unsigned int result_len;
int unsigned_operation;
/* Determine type length and signedness after promotion for
return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
else if (code1 == code2
- && ((len = TYPE_LENGTH (type1))
- == TYPE_LENGTH (type2)))
+ && ((len = (int) TYPE_LENGTH (type1))
+ == (int) TYPE_LENGTH (type2)))
{
p1 = VALUE_CONTENTS (arg1);
p2 = VALUE_CONTENTS (arg2);
int member;
struct type *settype = check_typedef (VALUE_TYPE (set));
struct type *eltype = check_typedef (VALUE_TYPE (element));
+ if (TYPE_CODE (eltype) == TYPE_CODE_RANGE)
+ eltype = TYPE_TARGET_TYPE (eltype);
if (TYPE_CODE (settype) != TYPE_CODE_SET)
error ("Second argument of 'IN' has wrong type");
if (TYPE_CODE (eltype) != TYPE_CODE_INT
value_as_long (element));
if (member < 0)
error ("First argument of 'IN' not in range");
- return value_from_longest (builtin_type_int, member);
+ return value_from_longest (LA_BOOL_TYPE, member);
}
void