[pypy-svn] r80023 - pypy/branch/jitypes2/lib_pypy/_ctypes

antocuni at codespeak.net antocuni at codespeak.net
Mon Dec 13 09:55:10 CET 2010


Author: antocuni
Date: Mon Dec 13 09:55:08 2010
New Revision: 80023

Modified:
   pypy/branch/jitypes2/lib_pypy/_ctypes/function.py
Log:
actually pass the *value* of the pointer buffer (i.e., the address of the param which has been wrapped with byref). test_voidresult passes


Modified: pypy/branch/jitypes2/lib_pypy/_ctypes/function.py
==============================================================================
--- pypy/branch/jitypes2/lib_pypy/_ctypes/function.py	(original)
+++ pypy/branch/jitypes2/lib_pypy/_ctypes/function.py	Mon Dec 13 09:55:08 2010
@@ -398,11 +398,7 @@
                 assert isinstance(value, basestring) and len(value) == 1
                 value = ord(value)
             elif argtype._ffishape == 'P':
-                value = arg._buffer.buffer
-                if value > sys.maxint:
-                    # XXX: workaround for old versions of pypy-c, as soon as
-                    # translation works again we can remove it
-                    value = (-sys.maxint-1)*2 + value
+                value = arg._get_buffer_value()
             else:
                 value = arg.value
             newargs.append(value)



More information about the Pypy-commit mailing list