return NULL;
}
-/* Store in *MAX the largest number representable by unsigned integer type
- TYPE. */
+/* Return the largest number representable by unsigned integer type TYPE. */
-void
-get_unsigned_type_max (struct type *type, ULONGEST *max)
+ULONGEST
+get_unsigned_type_max (struct type *type)
{
unsigned int n;
/* Written this way to avoid overflow. */
n = TYPE_LENGTH (type) * TARGET_CHAR_BIT;
- *max = ((((ULONGEST) 1 << (n - 1)) - 1) << 1) | 1;
+ return ((((ULONGEST) 1 << (n - 1)) - 1) << 1) | 1;
}
/* Store in *MIN, *MAX the smallest and largest numbers representable by
extern struct type *lookup_signed_typename (const struct language_defn *,
const char *);
-extern void get_unsigned_type_max (struct type *, ULONGEST *);
+extern ULONGEST get_unsigned_type_max (struct type *);
extern void get_signed_type_minmax (struct type *, LONGEST *, LONGEST *);
{
if (type->is_unsigned ())
{
- ULONGEST max;
-
- get_unsigned_type_max (type, &max);
+ ULONGEST max = get_unsigned_type_max (type);
if (!scm_is_unsigned_integer (obj, 0, max))
{
*except_scmp
{
if (type->is_unsigned ())
{
- ULONGEST max;
-
/* If scm_is_unsigned_integer can't work with this type, just punt. */
if (TYPE_LENGTH (type) > sizeof (uintmax_t))
return 0;
- get_unsigned_type_max (type, &max);
+
+ ULONGEST max = get_unsigned_type_max (type);
return scm_is_unsigned_integer (obj, 0, max);
}
else