[pypy-svn] r45712 - in pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem: . test
fijal at codespeak.net
fijal at codespeak.net
Thu Aug 16 13:38:39 CEST 2007
Author: fijal
Date: Thu Aug 16 13:38:39 2007
New Revision: 45712
Modified:
pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/rffi.py
pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/test/test_rffi.py
Log:
Move it to return unsigned flag (negated sign), because rffi_platform
expects this
Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/rffi.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/rffi.py (original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/rffi.py Thu Aug 16 13:38:39 2007
@@ -199,13 +199,13 @@
def size_and_sign(tp):
if tp is lltype.Char:
- return 1, True
+ return 1, False
assert isinstance(tp, lltype.Number)
if tp is lltype.Signed:
- sign = True
+ unsigned = False
else:
- sign = tp._type.SIGNED
- return sizeof(tp), sign
+ unsigned = not tp._type.SIGNED
+ return sizeof(tp), unsigned
def sizeof(tp):
# works only for int types!
Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/test/test_rffi.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/test/test_rffi.py (original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/test/test_rffi.py Thu Aug 16 13:38:39 2007
@@ -252,6 +252,6 @@
ll2ctypes._setup_ctypes_cache()
for ll, ctp in ll2ctypes._ctypes_cache.items():
assert sizeof(ll) == ctypes.sizeof(ctp)
- assert size_and_sign(lltype.Signed)[1]
- assert size_and_sign(lltype.Char)[1]
- assert not size_and_sign(UINT)[1]
+ assert not size_and_sign(lltype.Signed)[1]
+ assert not size_and_sign(lltype.Char)[1]
+ assert size_and_sign(UINT)[1]
More information about the Pypy-commit
mailing list