case TYPE_CODE_MEMBER:
retvalp = value_from_longest (type, value_as_long (arg2));
/* force evaluation */
- ptr = (unsigned int *) VALUE_CONTENTS (retvalp);
+ ptr = (unsigned int *) VALUE_CONTENTS (retvalp);
*ptr &= ~0x20000000; /* zap 29th bit to remove bias */
return retvalp;
}
}
longest = value_as_long (arg2);
- return value_from_longest (type, convert_to_boolean ?
+ return value_from_longest (type, convert_to_boolean ?
(LONGEST) (longest ? 1 : 0) : longest);
}
- else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT ||
+ else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT ||
code2 == TYPE_CODE_ENUM ||
code2 == TYPE_CODE_RANGE))
{
}
else if (length)
read_memory (addr, VALUE_CONTENTS_ALL_RAW (val), length);
-
+
VALUE_LAZY (val) = 0;
return 0;
}
if (VALUE_BITSIZE (toval))
{
char buffer[sizeof (LONGEST)];
- int len =
+ int len =
REGISTER_RAW_SIZE (VALUE_REGNO (toval)) - VALUE_OFFSET (toval);
if (len > (int) sizeof (LONGEST))
continue;
}
- while (TYPE_CODE (tt1) == TYPE_CODE_PTR
- && (TYPE_CODE (tt2) == TYPE_CODE_ARRAY
- || TYPE_CODE (tt2) == TYPE_CODE_PTR))
+ /* djb - 20000715 - Until the new type structure is in the
+ place, and we can attempt things like implicit conversions,
+ we need to do this so you can take something like a map<const
+ char *>, and properly access map["hello"], because the
+ argument to [] will be a reference to a pointer to a char,
+ and the arrgument will be a pointer to a char. */
+ while ( TYPE_CODE(tt1) == TYPE_CODE_REF ||
+ TYPE_CODE (tt1) == TYPE_CODE_PTR)
+ {
+ tt1 = check_typedef( TYPE_TARGET_TYPE(tt1) );
+ }
+ while ( TYPE_CODE(tt2) == TYPE_CODE_ARRAY ||
+ TYPE_CODE(tt2) == TYPE_CODE_PTR ||
+ TYPE_CODE(tt2) == TYPE_CODE_REF)
{
- tt1 = check_typedef (TYPE_TARGET_TYPE (tt1));
- tt2 = check_typedef (TYPE_TARGET_TYPE (tt2));
+ tt2 = check_typedef( TYPE_TARGET_TYPE(tt2) );
}
if (TYPE_CODE (tt1) == TYPE_CODE (tt2))
continue;
/*
Right now this is G++ RTTI. Plan on this changing in the
future as i get around to setting the vtables properly for G++
- compiled stuff. Also, i'll be using the type info functions,
+ compiled stuff. Also, i'll be using the type info functions,
which are always right. Deal with it until then.
*/
{
*using_enc=1;
}
/*
- We can't use value_ind here, because it would want to use RTTI, and
+ We can't use value_ind here, because it would want to use RTTI, and
we'd waste a bunch of time figuring out we already know the type.
Besides, we don't care about the type, just the actual pointer
*/