mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-09 07:00:23 +02:00
SCM-to-C number conversion functions incorrect when SIZEOF_LONG != SIZEOF_SCM_T_BITS
* libguile/conv-integer.i.c (SCM_FROM_TYPE_PROTO, SCM_TO_TYPE_PROTO): prefer fixnum size to scm_t_bits size * libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO, SCM_TO_TYPE_PROTO): prefer fixnum size to scm_t_bits size
This commit is contained in:
parent
c56d2d1023
commit
dbc10620a4
2 changed files with 3 additions and 3 deletions
|
@ -29,7 +29,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
if (SCM_I_INUMP (val))
|
||||
{
|
||||
scm_t_signed_bits n = SCM_I_INUM (val);
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE > SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE * 8 > SCM_I_FIXNUM_BIT
|
||||
return n;
|
||||
#else
|
||||
if (n >= TYPE_MIN && n <= TYPE_MAX)
|
||||
|
@ -113,7 +113,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
SCM
|
||||
SCM_FROM_TYPE_PROTO (TYPE val)
|
||||
{
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE * 8 < SCM_I_FIXNUM_BIT
|
||||
return SCM_I_MAKINUM (val);
|
||||
#else
|
||||
if (SCM_FIXABLE (val))
|
||||
|
|
|
@ -95,7 +95,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
SCM
|
||||
SCM_FROM_TYPE_PROTO (TYPE val)
|
||||
{
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE * 8 < SCM_I_FIXNUM_BIT
|
||||
return SCM_I_MAKINUM (val);
|
||||
#else
|
||||
if (SCM_POSFIXABLE (val))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue