Author: Antonio Cuni <anto.c...@gmail.com>
Branch: ffistruct
Changeset: r51268:36e31f50363c
Date: 2012-01-12 11:58 +0100
http://bitbucket.org/pypy/pypy/changeset/36e31f50363c/

Log:    fix for the case in which we return a ulonglong on 64 bit

diff --git a/pypy/module/_ffi/type_converter.py 
b/pypy/module/_ffi/type_converter.py
--- a/pypy/module/_ffi/type_converter.py
+++ b/pypy/module/_ffi/type_converter.py
@@ -194,8 +194,13 @@
         elif w_ffitype.is_signed():
             intval = self.get_signed(w_ffitype)
             return space.wrap(intval)
-        elif w_ffitype is app_types.ulong:
-            # we need to be careful when the return type is ULONG, because the
+        elif w_ffitype is app_types.ulong or w_ffitype is app_types.ulonglong:
+            # Note that we the second check (for ulonglong) is meaningful only
+            # on 64 bit, because on 32 bit the ulonglong case would have been
+            # handled by the is_longlong() branch above. On 64 bit, ulonglong
+            # is essentially the same as ulong.
+            #
+            # We need to be careful when the return type is ULONG, because the
             # value might not fit into a signed LONG, and thus might require
             # and app-evel <long>.  This is why we need to treat it separately
             # than the other unsigned types.
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to