[pypy-commit] cffi default: Kill this function, inlining its last usage with a more explicit error msg.

arigo noreply at buildbot.pypy.org
Sat Jun 23 16:36:27 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r500:fff94826272d
Date: 2012-06-23 16:36 +0200
http://bitbucket.org/cffi/cffi/changeset/fff94826272d/

Log:	Kill this function, inlining its last usage with a more explicit
	error msg.

diff --git a/c/_ffi_backend.c b/c/_ffi_backend.c
--- a/c/_ffi_backend.c
+++ b/c/_ffi_backend.c
@@ -643,16 +643,6 @@
     }
 }
 
-static int bitfield_not_supported(CFieldObject *cf)
-{
-    if (cf->cf_bitshift >= 0) {
-        PyErr_SetString(PyExc_NotImplementedError,
-                        "bit fields not supported for this operation");
-        return -1;
-    }
-    return 0;
-}
-
 static int _convert_overflow(PyObject *init, const char *ct_name)
 {
     PyObject *s;
@@ -2664,8 +2654,11 @@
 
         for (i=0; i<n; i++) {
             assert(cf != NULL);
-            if (bitfield_not_supported(cf) < 0)
+            if (cf->cf_bitshift >= 0) {
+                PyErr_SetString(PyExc_NotImplementedError,
+                    "cannot pass as argument a struct with bit fields");
                 return NULL;
+            }
             ffifield = fb_fill_type(fb, cf->cf_type);
             if (elements != NULL)
                 elements[i] = ffifield;


More information about the pypy-commit mailing list