offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
{
- v = value_from_long (type,
+ v = value_from_longest (type,
unpack_field_as_long (arg_type,
VALUE_CONTENTS (arg1),
fieldno));
should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */
value entry, vfn, vtbl;
- value vi = value_from_long (builtin_type_int,
+ value vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
struct type *context;
nelems = longest_to_int (value_as_long (value_field (entry, 2)));
for (i = 1; i <= nelems; i++)
{
- entry = value_subscript (vtbl, value_from_long (builtin_type_int, i));
+ entry = value_subscript (vtbl, value_from_longest (builtin_type_int,
+ (LONGEST) i));
offset = longest_to_int (value_as_long (value_field (entry, 0)));
if (offset < best_offset)
{
/* Convert C numbers into newly allocated values */
value
-value_from_long (type, num)
+value_from_longest (type, num)
struct type *type;
register LONGEST num;
{
register enum type_code code = TYPE_CODE (type);
register int len = TYPE_LENGTH (type);
- if (code == TYPE_CODE_INT || code == TYPE_CODE_ENUM)
+ /* FIXME, we assume that pointers have the same form and byte order as
+ integers, and that all pointers have the same form. */
+ if (code == TYPE_CODE_INT || code == TYPE_CODE_ENUM || code == TYPE_CODE_PTR)
{
if (len == sizeof (char))
* (char *) VALUE_CONTENTS_RAW (val) = num;