[pypy-svn] r60047 - pypy/branch/oo-jit/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri Nov 21 12:18:08 CET 2008


Author: arigo
Date: Fri Nov 21 12:18:07 2008
New Revision: 60047

Modified:
   pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
Log:
Allow yet another argument propagated from force_cast()
to lltype2ctypes().


Modified: pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	(original)
+++ pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	Fri Nov 21 12:18:07 2008
@@ -744,12 +744,12 @@
         return ctypes2lltype(RESULT, cres, rtyper)
     return invoke_via_ctypes
 
-def force_cast(RESTYPE, value, rtyper=None):
+def force_cast(RESTYPE, value, rtyper=None, acceptgckind=False):
     """Cast a value to a result type, trying to use the same rules as C."""
     if not isinstance(RESTYPE, lltype.LowLevelType):
         raise TypeError("rffi.cast() first arg should be a TYPE")
     TYPE1 = lltype.typeOf(value)
-    cvalue = lltype2ctypes(value, rtyper)
+    cvalue = lltype2ctypes(value, rtyper, acceptgckind=acceptgckind)
     cresulttype = get_ctypes_type(rtyper, RESTYPE)
     if isinstance(TYPE1, lltype.Ptr):
         if isinstance(RESTYPE, lltype.Ptr):



More information about the Pypy-commit mailing list