[pypy-commit] pypy ffistruct: rpython fixes

antocuni noreply at buildbot.pypy.org
Wed May 16 18:14:33 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ffistruct
Changeset: r55114:11246454eb46
Date: 2012-05-16 13:44 +0200
http://bitbucket.org/pypy/pypy/changeset/11246454eb46/

Log:	rpython fixes

diff --git a/pypy/module/_ffi/type_converter.py b/pypy/module/_ffi/type_converter.py
--- a/pypy/module/_ffi/type_converter.py
+++ b/pypy/module/_ffi/type_converter.py
@@ -86,6 +86,7 @@
             unicodeval = self.space.unicode_w(w_obj)
             self.handle_unichar_p(w_ffitype, w_obj, unicodeval)
             return True
+        return False
 
     def convert_pointer_arg_maybe(self, w_arg, w_argtype):
         """
diff --git a/pypy/rlib/clibffi.py b/pypy/rlib/clibffi.py
--- a/pypy/rlib/clibffi.py
+++ b/pypy/rlib/clibffi.py
@@ -11,6 +11,7 @@
 from pypy.rlib.rdynload import dlopen, dlclose, dlsym, dlsym_byordinal
 from pypy.rlib.rdynload import DLOpenError, DLLHANDLE
 from pypy.rlib import jit
+from pypy.rlib.objectmodel import specialize
 from pypy.tool.autopath import pypydir
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
@@ -347,6 +348,7 @@
                                         ('ffistruct', FFI_TYPE_P.TO),
                                         ('members', lltype.Array(FFI_TYPE_P))))
 
+ at specialize.arg(3)
 def make_struct_ffitype_e(size, aligment, field_types, track_allocation=True):
     """Compute the type of a structure.  Returns a FFI_STRUCT_P out of
        which the 'ffistruct' member is a regular FFI_TYPE.


More information about the pypy-commit mailing list