Author: Armin Rigo <[email protected]>
Branch:
Changeset: r49299:f87b5df4955d
Date: 2011-11-11 13:11 +0100
http://bitbucket.org/pypy/pypy/changeset/f87b5df4955d/
Log: Uh. Fix this function. No clue how it could have worked: it
returned "unsigned=False" for all non-Number types, like Char.
diff --git a/pypy/rpython/lltypesystem/rffi.py
b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -862,11 +862,12 @@
try:
unsigned = not tp._type.SIGNED
except AttributeError:
- if tp in [lltype.Char, lltype.Float, lltype.Signed] or\
- isinstance(tp, lltype.Ptr):
+ if (isinstance(tp, lltype.Ptr) or
+ tp in (FLOAT, DOUBLE) or
+ cast(lltype.SignedLongLong, cast(tp, -1)) < 0):
unsigned = False
else:
- unsigned = False
+ unsigned = True
return size, unsigned
def sizeof(tp):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit