[pypy-svn] r22249 - in pypy/dist/pypy: annotation rpython/lltypesystem

ericvrp at codespeak.net ericvrp at codespeak.net
Tue Jan 17 13:16:25 CET 2006


Author: ericvrp
Date: Tue Jan 17 13:16:20 2006
New Revision: 22249

Modified:
   pypy/dist/pypy/annotation/model.py
   pypy/dist/pypy/rpython/lltypesystem/lltype.py
Log:
Some small fixes to not use longlong on non 32-bit systems.

(could someone please review this?)


Modified: pypy/dist/pypy/annotation/model.py
==============================================================================
--- pypy/dist/pypy/annotation/model.py	(original)
+++ pypy/dist/pypy/annotation/model.py	Tue Jan 17 13:16:20 2006
@@ -34,6 +34,7 @@
 from pypy.tool.tls import tlsobject
 from pypy.rpython.rarithmetic import r_uint, r_longlong, r_ulonglong
 import inspect
+from sys import maxint
 
 
 DEBUG = True    # set to False to disable recording of debugging information
@@ -168,6 +169,8 @@
     def __init__(self, nonneg=False, unsigned=False, size=1):
         self.nonneg = unsigned or nonneg
         self.unsigned = unsigned  # pypy.rpython.rarithmetic.r_uint
+        if maxint != 2**31-1:
+            size = 1    #XXX don't support longlong on 64 bits systems
         self.size = size
         if self.unsigned:
             if self.size == 2:

Modified: pypy/dist/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/lltype.py	Tue Jan 17 13:16:20 2006
@@ -4,6 +4,7 @@
 from pypy.tool.uid import Hashable
 from pypy.tool.tls import tlsobject
 from types import NoneType
+from sys import maxint
 
 log = py.log.Producer('lltype')
 
@@ -428,9 +429,13 @@
 
 
 Signed   = Primitive("Signed", 0)
-SignedLongLong = Primitive("SignedLongLong", r_longlong(0))
 Unsigned = Primitive("Unsigned", r_uint(0))
-UnsignedLongLong = Primitive("UnsignedLongLong", r_ulonglong(0))
+if maxint == 2**31-1:
+    SignedLongLong = Primitive("SignedLongLong", r_longlong(0))
+    UnsignedLongLong = Primitive("UnsignedLongLong", r_ulonglong(0))
+else:
+    SignedLongLong = Signed
+    UnsignedLongLong = Unsigned
 Float    = Primitive("Float", 0.0)
 Char     = Primitive("Char", '\x00')
 Bool     = Primitive("Bool", False)



More information about the Pypy-commit mailing list