[pypy-commit] cffi default: Fix(?) an issue that only showed up on PPC64 so far, about

arigo noreply at buildbot.pypy.org
Sat Mar 30 17:50:50 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r1208:c5e85201f3ce
Date: 2013-03-30 09:48 -0700
http://bitbucket.org/cffi/cffi/changeset/c5e85201f3ce/

Log:	Fix(?) an issue that only showed up on PPC64 so far, about char-
	returning C functions.

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -4932,11 +4932,6 @@
 _cffi_to_c_UNSIGNED_FN(unsigned int, 32)
 _cffi_to_c_UNSIGNED_FN(unsigned PY_LONG_LONG, 64)
 
-static char _cffi_to_c_char(PyObject *obj)
-{
-    return (char)_convert_to_char(obj);
-}
-
 static PyObject *_cffi_from_c_pointer(char *ptr, CTypeDescrObject *ct)
 {
     return convert_to_object((char *)&ptr, ct);
@@ -5024,7 +5019,7 @@
     _cffi_to_c_u32,
     _cffi_to_c_i64,
     _cffi_to_c_u64,
-    _cffi_to_c_char,
+    _convert_to_char,
     _cffi_from_c_pointer,
     _cffi_to_c_pointer,
     _cffi_get_struct_layout,
diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
--- a/cffi/vengine_cpy.py
+++ b/cffi/vengine_cpy.py
@@ -778,7 +778,7 @@
 #define _cffi_to_c_u64                                                   \
                  ((unsigned long long(*)(PyObject *))_cffi_exports[8])
 #define _cffi_to_c_char                                                  \
-                 ((char(*)(PyObject *))_cffi_exports[9])
+                 ((int(*)(PyObject *))_cffi_exports[9])
 #define _cffi_from_c_pointer                                             \
     ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10])
 #define _cffi_to_c_pointer                                               \


More information about the pypy-commit mailing list