[pypy-commit] pypy ffi-backend: Just use a regular Signed field for cif_descr.abi.

arigo noreply at buildbot.pypy.org
Tue Aug 7 17:39:58 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: ffi-backend
Changeset: r56645:062eec2fc9ff
Date: 2012-08-07 17:39 +0200
http://bitbucket.org/pypy/pypy/changeset/062eec2fc9ff/

Log:	Just use a regular Signed field for cif_descr.abi.

diff --git a/pypy/jit/backend/llsupport/ffisupport.py b/pypy/jit/backend/llsupport/ffisupport.py
--- a/pypy/jit/backend/llsupport/ffisupport.py
+++ b/pypy/jit/backend/llsupport/ffisupport.py
@@ -87,7 +87,7 @@
     #
     p = lltype.malloc(CIF_DESCRIPTION, len(atypes),
                       flavor='raw', immortal=True)
-    rffi.setintfield(p, 'abi', getattr(clibffi, abiname))
+    p.abi = getattr(clibffi, abiname)
     p.nargs = len(atypes)
     p.rtype = rtype
     p.atypes = lltype.malloc(FFI_TYPE_PP.TO, len(atypes),
diff --git a/pypy/jit/metainterp/test/test_fficall.py b/pypy/jit/metainterp/test/test_fficall.py
--- a/pypy/jit/metainterp/test/test_fficall.py
+++ b/pypy/jit/metainterp/test/test_fficall.py
@@ -9,7 +9,7 @@
 def get_description(atypes, rtype):
     p = lltype.malloc(CIF_DESCRIPTION, len(atypes),
                       flavor='raw', immortal=True)
-    rffi.setintfield(p, 'abi', 42)
+    p.abi = 42
     p.nargs = len(atypes)
     p.rtype = rtype
     p.atypes = lltype.malloc(FFI_TYPE_PP.TO, len(atypes),
diff --git a/pypy/module/_cffi_backend/ctypefunc.py b/pypy/module/_cffi_backend/ctypefunc.py
--- a/pypy/module/_cffi_backend/ctypefunc.py
+++ b/pypy/module/_cffi_backend/ctypefunc.py
@@ -367,7 +367,7 @@
         cif_descr.exchange_size = exchange_offset
 
     def fb_extra_fields(self, cif_descr):
-        rffi.setintfield(cif_descr, 'abi', clibffi.FFI_DEFAULT_ABI)    # XXX
+        cif_descr.abi = clibffi.FFI_DEFAULT_ABI    # XXX
         cif_descr.nargs = len(self.fargs)
         cif_descr.rtype = self.rtype
         cif_descr.atypes = self.atypes
diff --git a/pypy/rlib/jit_libffi.py b/pypy/rlib/jit_libffi.py
--- a/pypy/rlib/jit_libffi.py
+++ b/pypy/rlib/jit_libffi.py
@@ -31,7 +31,7 @@
 CIF_DESCRIPTION = lltype.Struct(
     'CIF_DESCRIPTION',
     ('cif', FFI_CIF),
-    ('abi', FFI_ABI),          # these 4 fields could also be read directly
+    ('abi', lltype.Signed),    # these 4 fields could also be read directly
     ('nargs', lltype.Signed),  # from 'cif', but doing so adds a dependency
     ('rtype', FFI_TYPE_P),     # on the exact fields available from ffi_cif.
     ('atypes', FFI_TYPE_PP),   #


More information about the pypy-commit mailing list