[pypy-svn] pypy real-rffi.INT: in external function calls, automatic cast from SIZE_T to lltype.Unsigned

amauryfa commits-noreply at bitbucket.org
Wed Mar 2 13:20:16 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: real-rffi.INT
Changeset: r42381:c444392d2e35
Date: 2011-03-02 11:34 +0100
http://bitbucket.org/pypy/pypy/changeset/c444392d2e35/

Log:	in external function calls, automatic cast from SIZE_T to
	lltype.Unsigned

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
@@ -222,7 +222,7 @@
         if rarithmetic.r_int is not r_int:
             if result is INT:
                 return cast(lltype.Signed, res)
-            elif result is UINT:
+            elif result is UINT or result is SIZE_T:
                 return cast(lltype.Unsigned, res)
         return res
     wrapper._annspecialcase_ = 'specialize:ll'


More information about the Pypy-commit mailing list