diff options
author | Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> | 2018-04-29 18:59:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-04-29 18:59:33 (GMT) |
commit | 55edd0c185ad2d895b5d73e47d67049bc156b654 (patch) | |
tree | d609dfc924b59b89816a610ba86cd3e6c34a641c /Objects/stringlib | |
parent | 9f3535c9cde8813ce631d6ebe4d790682f594828 (diff) | |
download | cpython-55edd0c185ad2d895b5d73e47d67049bc156b654.zip cpython-55edd0c185ad2d895b5d73e47d67049bc156b654.tar.gz cpython-55edd0c185ad2d895b5d73e47d67049bc156b654.tar.bz2 |
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments. This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
Diffstat (limited to 'Objects/stringlib')
-rw-r--r-- | Objects/stringlib/ctype.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Objects/stringlib/ctype.h b/Objects/stringlib/ctype.h index fd7b1bd..843cfa2 100644 --- a/Objects/stringlib/ctype.h +++ b/Objects/stringlib/ctype.h @@ -5,49 +5,49 @@ #include "bytes_methods.h" static PyObject* -stringlib_isspace(PyObject *self) +stringlib_isspace(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isspace(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_isalpha(PyObject *self) +stringlib_isalpha(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isalpha(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_isalnum(PyObject *self) +stringlib_isalnum(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isalnum(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_isascii(PyObject *self) +stringlib_isascii(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isascii(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_isdigit(PyObject *self) +stringlib_isdigit(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isdigit(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_islower(PyObject *self) +stringlib_islower(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_islower(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_isupper(PyObject *self) +stringlib_isupper(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_isupper(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } static PyObject* -stringlib_istitle(PyObject *self) +stringlib_istitle(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _Py_bytes_istitle(STRINGLIB_STR(self), STRINGLIB_LEN(self)); } @@ -56,7 +56,7 @@ stringlib_istitle(PyObject *self) /* functions that return a new object partially translated by ctype funcs: */ static PyObject* -stringlib_lower(PyObject *self) +stringlib_lower(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject* newobj; newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self)); @@ -68,7 +68,7 @@ stringlib_lower(PyObject *self) } static PyObject* -stringlib_upper(PyObject *self) +stringlib_upper(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject* newobj; newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self)); @@ -80,7 +80,7 @@ stringlib_upper(PyObject *self) } static PyObject* -stringlib_title(PyObject *self) +stringlib_title(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject* newobj; newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self)); @@ -92,7 +92,7 @@ stringlib_title(PyObject *self) } static PyObject* -stringlib_capitalize(PyObject *self) +stringlib_capitalize(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject* newobj; newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self)); @@ -104,7 +104,7 @@ stringlib_capitalize(PyObject *self) } static PyObject* -stringlib_swapcase(PyObject *self) +stringlib_swapcase(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject* newobj; newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self)); |