[pypy-svn] pypy real-rffi.INT: Don't do automatic conversions that change the integer size

amauryfa commits-noreply at bitbucket.org
Wed Mar 2 20:23:15 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: real-rffi.INT
Changeset: r42396:855661be5f16
Date: 2011-03-02 20:22 +0100
http://bitbucket.org/pypy/pypy/changeset/855661be5f16/

Log:	Don't do automatic conversions that change the integer size

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
@@ -219,11 +219,11 @@
         for i, TARGET in unrolling_arg_tps:
             if to_free[i]:
                 lltype.free(to_free[i], flavor='raw')
-        if rarithmetic.r_int is not r_int:
-            if result is INT:
-                return cast(lltype.Signed, res)
-            elif result is UINT or result is SIZE_T:
-                return cast(lltype.Unsigned, res)
+        # XXX these don't work on win64
+        if result is LONG:
+            return cast(lltype.Signed, res)
+        elif result is ULONG or result is SIZE_T:
+            return cast(lltype.Unsigned, res)
         return res
     wrapper._annspecialcase_ = 'specialize:ll'
     wrapper._always_inline_ = True


More information about the Pypy-commit mailing list