summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2022-12-24 14:09:37 +0100
committerArmin Rigo <arigo@tunes.org>2022-12-24 14:09:37 +0100
commit7aecd67547c025a8c146569d5f0c3bd22ec72718 (patch)
tree77c3ddfe9205b03ae68716116be10b2cf48c37d0
parenta06428ea810576b27774b76c650f83364e6f6e7f (diff)
downloadcffi-7aecd67547c025a8c146569d5f0c3bd22ec72718.tar.gz
style issues onlyhppa
-rw-r--r--c/_cffi_backend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
index 5e1ebe9..fd71ede 100644
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -62,9 +62,9 @@
/* Convert from closure pointer to function pointer. */
#if defined(__hppa__) && !defined(__LP64__)
-#define CFFI_FN(f) ((void (*)(void))((unsigned int)(f) | 2))
+#define CFFI_CLOSURE_TO_FNPTR(type, f) ((type)((unsigned int)(f) | 2))
#else
-#define CFFI_FN(f) ((void (*)(void))f)
+#define CFFI_CLOSURE_TO_FNPTR(type, f) ((type)(f))
#endif
@@ -3198,7 +3198,7 @@ cdata_call(CDataObject *cd, PyObject *args, PyObject *kwds)
Py_BEGIN_ALLOW_THREADS
restore_errno();
- ffi_call(&cif_descr->cif, (void (*)(void)) CFFI_FN(cd->c_data),
+ ffi_call(&cif_descr->cif, CFFI_CLOSURE_TO_FNPTR(void (*)(void), cd->c_data),
resultdata, buffer_array);
save_errno();
Py_END_ALLOW_THREADS
@@ -6401,7 +6401,7 @@ static PyObject *b_callback(PyObject *self, PyObject *args)
goto error;
Py_INCREF(ct);
cd->head.c_type = ct;
- cd->head.c_data = (char *)CFFI_FN(closure_exec);
+ cd->head.c_data = CFFI_CLOSURE_TO_FNPTR(char *, closure_exec);
cd->head.c_weakreflist = NULL;
closure->user_data = NULL;
cd->closure = closure;