[pypy-svn] pypy fast-forward: Fix translation and update comment

amauryfa commits-noreply at bitbucket.org
Fri Jan 14 18:25:01 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: fast-forward
Changeset: r40692:b27f1951a6a6
Date: 2011-01-14 18:22 +0100
http://bitbucket.org/pypy/pypy/changeset/b27f1951a6a6/

Log:	Fix translation and update comment

diff --git a/pypy/module/_rawffi/callback.py b/pypy/module/_rawffi/callback.py
--- a/pypy/module/_rawffi/callback.py
+++ b/pypy/module/_rawffi/callback.py
@@ -30,17 +30,16 @@
     argtypes = callback_ptr.argtypes
     space = callback_ptr.space
     try:
-        # XXX The app-level callback gets the arguments as a list of integers.
-        #     Irregular interface here.  Shows something, I say.
         args_w = [None] * len(argtypes)
         for i in range(len(argtypes)):
             argtype = argtypes[i]
             if isinstance(argtype, W_Structure):
-                args_w[i] = space.wrap(argtype.fromaddress(
-                    space, rffi.cast(rffi.SIZE_T, ll_args[i])))
+                args_w[i] = argtype.fromaddress(
+                    space, rffi.cast(rffi.SIZE_T, ll_args[i]))
             else:
+                # XXX other types?
                 args_w[i] = space.wrap(rffi.cast(rffi.ULONG, ll_args[i]))
-        w_res = space.call_function(w_callable, *args_w)
+        w_res = space.call(w_callable, space.newtuple(args_w))
         if callback_ptr.result is not None: # don't return void
             unwrap_value(space, push_elem, ll_res, 0,
                          callback_ptr.result, w_res)


More information about the Pypy-commit mailing list