[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Removing some workarounds for big integers
From: |
Philipp Stephani |
Subject: |
Re: Removing some workarounds for big integers |
Date: |
Mon, 22 Apr 2019 18:59:24 +0200 |
Am Mo., 22. Apr. 2019 um 18:56 Uhr schrieb Andy Moreton
<address@hidden>:
>
> On Mon 22 Apr 2019, Philipp Stephani wrote:
>
> > Am Sa., 22. Sept. 2018 um 01:12 Uhr schrieb Paul Eggert <address@hidden>:
> >>
> >> Philipp Stephani wrote:
> >>
> >> > It looks like Paul has already done most of this work in commit
> >> > d77d01d22902acdc45c2c7059de4f1b158ab5806.
> >>
> >> Yes, I've already replaced all uses of make_fixnum_or_float and
> >> INTEGER_TO_CONS
> >> with INT_TO_INTEGER.
> >>
> >> There are still quite a few places that need looking at, though. Stefan
> >> mentioned timestamps; I'll try to bump the priority of that.
> >
> > I've checked some of the remaining uses of CONS_TO_INTEGER. It seems
> > some of them we can replace right away. For some others the
> > documentation requires a number; we can detect integral floats for
> > them, but should deprecate the float usage.
>
> In commit 4e2ea400 ("Introduce a helper macro to convert a Lisp integer
> to a C integer."):
>
> +/* Return the integral value of NUM. If NUM is too big for TYPE,
> + signal an error. */
> +#define INTEGER_TO_INT(num, type)
> \
> + (TYPE_SIGNED (type)
> \
> + ? ranged_integer_to_int ((num), TYPE_MINIMUM (type), TYPE_MAXIMUM
> (type)) \
> + : ranged_integer_to_uint ((num), TYPE_MINIMUM (type)))
> ^^^^^^^^^^^^
> This should be TYPE_MAXIMUM.
Thanks, fixed