summaryrefslogtreecommitdiff
path: root/c/_cffi_backend.c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-07-10 04:00:04 +0200
committerArmin Rigo <arigo@tunes.org>2020-07-10 04:00:04 +0200
commitec801d43b7df6ccdeb5fda62c6cb1ae00261492a (patch)
treef5c5386d8328d0233fa9a60b9eb0e24ebe20b966 /c/_cffi_backend.c
parent6e2ce7bdd4741ed2df55ad5c7480a8ef0224f815 (diff)
downloadcffi-ec801d43b7df6ccdeb5fda62c6cb1ae00261492a.tar.gz
non-mac: cannot use 'true' in C sources without some more includes;
we'd need to write '1'. But in this case we can simplify a bit the function signature, removing its need
Diffstat (limited to 'c/_cffi_backend.c')
-rw-r--r--c/_cffi_backend.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
index 5c5fe45..474ee06 100644
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -2892,7 +2892,8 @@ static PyObject *
convert_struct_to_owning_object(char *data, CTypeDescrObject *ct); /*forward*/
static cif_description_t *
-fb_prepare_cif(PyObject *fargs, CTypeDescrObject *, Py_ssize_t, int, ffi_abi); /*forward*/
+fb_prepare_cif(PyObject *fargs, CTypeDescrObject *, Py_ssize_t, ffi_abi);
+ /*forward*/
static PyObject *new_primitive_type(const char *name); /*forward*/
@@ -3085,7 +3086,7 @@ cdata_call(CDataObject *cd, PyObject *args, PyObject *kwds)
#else
fabi = PyLong_AS_LONG(PyTuple_GET_ITEM(signature, 0));
#endif
- cif_descr = fb_prepare_cif(fvarargs, fresult, nargs_declared, true, fabi);
+ cif_descr = fb_prepare_cif(fvarargs, fresult, nargs_declared, fabi);
if (cif_descr == NULL)
goto error;
}
@@ -5812,8 +5813,7 @@ static CTypeDescrObject *fb_prepare_ctype(struct funcbuilder_s *fb,
static cif_description_t *fb_prepare_cif(PyObject *fargs,
CTypeDescrObject *fresult,
- Py_ssize_t nargs_declared,
- int ellipsis,
+ Py_ssize_t variadic_nargs_declared,
ffi_abi fabi)
{
@@ -5844,9 +5844,9 @@ static cif_description_t *fb_prepare_cif(PyObject *fargs,
cif_descr = (cif_description_t *)buffer;
ffi_status status;
#if HAVE_FFI_PREP_CIF_VAR
- if (ellipsis) {
+ if (variadic_nargs_declared >= 0) {
status = ffi_prep_cif_var(&cif_descr->cif, fabi,
- nargs_declared, funcbuffer.nargs,
+ variadic_nargs_declared, funcbuffer.nargs,
funcbuffer.rtype, funcbuffer.atypes);
} else
#endif
@@ -5901,7 +5901,7 @@ static PyObject *new_function_type(PyObject *fargs, /* tuple */
is computed here. */
cif_description_t *cif_descr;
- cif_descr = fb_prepare_cif(fargs, fresult, 0, ellipsis, fabi);
+ cif_descr = fb_prepare_cif(fargs, fresult, -1, fabi);
if (cif_descr == NULL) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
PyErr_Clear(); /* will get the exception if we see an