[pypy-commit] pypy improve-rbigint: We need the cast, otherwise I'm sure it won't work on 32bit. On 64bit it links to the same type anyway

stian noreply at buildbot.pypy.org
Sat Jul 21 18:41:20 CEST 2012


Author: stian
Branch: improve-rbigint
Changeset: r56333:4fee44dbf222
Date: 2012-06-25 08:38 +0200
http://bitbucket.org/pypy/pypy/changeset/4fee44dbf222/

Log:	We need the cast, otherwise I'm sure it won't work on 32bit. On
	64bit it links to the same type anyway

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -68,8 +68,7 @@
     elif SHIFT <= 31:
         return rffi.cast(rffi.INT, x)
     elif SHIFT <= 63:
-        return int(x)
-        #return rffi.cast(rffi.LONGLONG, x)
+        return rffi.cast(rffi.LONGLONG, x)
     else:
         raise ValueError("SHIFT too large!")
 
@@ -78,8 +77,8 @@
     #return rffi.cast(lltype.Signed, x)
 
 def _load_unsigned_digit(x):
-    #return r_ulonglong(x)
-    return rffi.cast(lltype.Unsigned, x)
+    return r_ulonglong(x)
+    #return rffi.cast(lltype.Unsigned, x)
 
 NULLDIGIT = _store_digit(0)
 ONEDIGIT  = _store_digit(1)


More information about the pypy-commit mailing list