#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
#endif
-void _initialize_valarith (void);
-\f
-
/* Given a pointer, return the size of its target.
If the pointer type is void *, then return 1.
If the target type is incomplete, then error out.
= TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
return value_zero (return_type, VALUE_LVAL (arg1));
}
- return call_function_by_hand (argvec[0], 2 - static_memfuncp,
+ return call_function_by_hand (argvec[0], NULL, 2 - static_memfuncp,
argvec + 1);
}
throw_error (NOT_FOUND_ERROR,
= TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
return value_zero (return_type, VALUE_LVAL (arg1));
}
- return call_function_by_hand (argvec[0], nargs, argvec + 1);
+ return call_function_by_hand (argvec[0], NULL, nargs, argvec + 1);
}
throw_error (NOT_FOUND_ERROR,
_("member function %s not found"), tstr);
{
*byte_order_x = gdbarch_byte_order (get_type_arch (type2));
*len_x = TYPE_LENGTH (type2);
- decimal_from_integral (arg1, x, *len_x, *byte_order_x);
+ if (TYPE_UNSIGNED (type1))
+ decimal_from_ulongest (value_as_long (arg1), x, *len_x, *byte_order_x);
+ else
+ decimal_from_longest (value_as_long (arg1), x, *len_x, *byte_order_x);
}
else
error (_("Don't know how to convert from %s to %s."), TYPE_NAME (type1),
{
*byte_order_y = gdbarch_byte_order (get_type_arch (type1));
*len_y = TYPE_LENGTH (type1);
- decimal_from_integral (arg2, y, *len_y, *byte_order_y);
+ if (TYPE_UNSIGNED (type2))
+ decimal_from_ulongest (value_as_long (arg2), y, *len_y, *byte_order_y);
+ else
+ decimal_from_longest (value_as_long (arg2), y, *len_y, *byte_order_y);
}
else
error (_("Don't know how to convert from %s to %s."), TYPE_NAME (type1),