[pypy-svn] r76521 - pypy/branch/fast-ctypes/pypy/module/jitffi

getxsick at codespeak.net getxsick at codespeak.net
Sat Aug 7 18:08:32 CEST 2010


Author: getxsick
Date: Sat Aug  7 18:08:31 2010
New Revision: 76521

Modified:
   pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
Log:
use interp2app for wrap_*


Modified: pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
==============================================================================
--- pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	(original)
+++ pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	Sat Aug  7 18:08:31 2010
@@ -71,13 +71,13 @@
 
         if res_type == 'i':
             self.rget = rjitffi._Get(cpu, lib, func, args_type,
-                                     res_type, self.wrap_int, cache=True)
+                                     res_type, self.wrap_int_w, cache=True)
         elif res_type == 'f':
             self.rget = rjitffi._Get(cpu, lib, func, args_type,
-                                     res_type, self.wrap_float, cache=True)
+                                     res_type, self.wrap_float_w, cache=True)
         elif res_type == 'v':
             self.rget = rjitffi._Get(cpu, lib, func, args_type,
-                                     res_type, self.wrap_void, cache=True)
+                                     res_type, self.wrap_void_w, cache=True)
         else:
             raise OperationError(
                     space.w_ValueError,
@@ -119,9 +119,9 @@
                 i += 1
         return self.rget.call()
 
-    wrap_int = lambda self, value: self.space.wrap(value)
-    wrap_float = lambda self, value: self.space.wrap(value)
-    wrap_void = lambda self, value: self.space.wrap(value)
+    wrap_int_w = lambda self, value: self.space.wrap(value)
+    wrap_float_w = lambda self, value: self.space.wrap(value)
+    wrap_void_w = lambda self, w_value: value
 
 #def W_Get___new__(space, w_type, cpu, lib, func, args_type, res_type):
 #    try:
@@ -132,5 +132,8 @@
 W_Get.typedef = TypeDef(
         'Get',
         #__new__ = interp2app(W_Get___new__, unwrap_spec=[ObjSpace, W_Root, W_Root, W_Root, str, W_Root, str]),
-        call = interp2app(W_Get.call_w, unwrap_spec=['self', ObjSpace, W_Root])
+        call = interp2app(W_Get.call_w, unwrap_spec=['self', ObjSpace, W_Root]),
+        wrap_int = interp2app(W_Get.wrap_int_w, unwrap_spec=['self', int]),
+        wrap_float = interp2app(W_Get.wrap_float_w, unwrap_spec=['self', float]),
+        wrap_void = interp2app(W_Get.wrap_void_w, unwrap_spec=['self', W_Root])
 )



More information about the Pypy-commit mailing list