guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: SCM-to-C number conversion functions incorrect wh


From: Mike Gran
Subject: [Guile-commits] 01/01: SCM-to-C number conversion functions incorrect when SIZEOF_LONG != SIZEOF_SCM_T_BITS
Date: Fri, 13 Apr 2018 17:20:15 -0400 (EDT)

mike121 pushed a commit to branch wip-mingw-guile-2.2
in repository guile.

commit dbc10620a447200274afb056b5554bebc4277fcf
Author: Michael Gran <address@hidden>
Date:   Fri Apr 13 14:20:02 2018 -0700

    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
---
 libguile/conv-integer.i.c  | 4 ++--
 libguile/conv-uinteger.i.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libguile/conv-integer.i.c b/libguile/conv-integer.i.c
index 0aa81dc..81529fa 100644
--- a/libguile/conv-integer.i.c
+++ b/libguile/conv-integer.i.c
@@ -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))
diff --git a/libguile/conv-uinteger.i.c b/libguile/conv-uinteger.i.c
index f62dc41..4da7432 100644
--- a/libguile/conv-uinteger.i.c
+++ b/libguile/conv-uinteger.i.c
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]