bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)

(cherry picked from commit 81524022d0)
This commit is contained in:
Serhiy Storchaka 2018-11-27 20:27:47 +02:00 committed by GitHub
parent 5ceb7018dc
commit ad8ac54aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 13 deletions

View File

@ -1344,7 +1344,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
} }
static PyObject * static PyObject *
deque_reduce(dequeobject *deque) deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
{ {
PyObject *dict, *it; PyObject *dict, *it;
_Py_IDENTIFIER(__dict__); _Py_IDENTIFIER(__dict__);

View File

@ -414,27 +414,27 @@ PyTypeObject PyCursesWindow_Type;
PARSESTR - format string for argument parsing PARSESTR - format string for argument parsing
*/ */
#define Window_NoArgNoReturnFunction(X) \ #define Window_NoArgNoReturnFunction(X) \
static PyObject *PyCursesWindow_ ## X \ static PyObject *PyCursesWindow_ ## X \
(PyCursesWindowObject *self, PyObject *args) \ (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
{ return PyCursesCheckERR(X(self->win), # X); } { return PyCursesCheckERR(X(self->win), # X); }
#define Window_NoArgTrueFalseFunction(X) \ #define Window_NoArgTrueFalseFunction(X) \
static PyObject * PyCursesWindow_ ## X \ static PyObject * PyCursesWindow_ ## X \
(PyCursesWindowObject *self) \ (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
{ \ { \
if (X (self->win) == FALSE) { Py_RETURN_FALSE; } \ if (X (self->win) == FALSE) { Py_RETURN_FALSE; } \
else { Py_RETURN_TRUE; } } else { Py_RETURN_TRUE; } }
#define Window_NoArgNoReturnVoidFunction(X) \ #define Window_NoArgNoReturnVoidFunction(X) \
static PyObject * PyCursesWindow_ ## X \ static PyObject * PyCursesWindow_ ## X \
(PyCursesWindowObject *self) \ (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
{ \ { \
X(self->win); Py_RETURN_NONE; } X(self->win); Py_RETURN_NONE; }
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \ #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
static PyObject * PyCursesWindow_ ## X \ static PyObject * PyCursesWindow_ ## X \
(PyCursesWindowObject *self) \ (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
{ \ { \
TYPE arg1, arg2; \ TYPE arg1, arg2; \
X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); } X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }

View File

@ -943,7 +943,7 @@ test_buildvalue_N_error(const char *fmt)
} }
static PyObject * static PyObject *
test_buildvalue_N(PyObject *self, PyObject *noargs) test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
{ {
PyObject *arg, *res; PyObject *arg, *res;
@ -2453,7 +2453,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
/* Some tests of PyUnicode_FromFormat(). This needs more tests. */ /* Some tests of PyUnicode_FromFormat(). This needs more tests. */
static PyObject * static PyObject *
test_string_from_format(PyObject *self, PyObject *args) test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
{ {
PyObject *result; PyObject *result;
char *msg; char *msg;
@ -2593,7 +2593,7 @@ typedef struct {
} known_capsule; } known_capsule;
static PyObject * static PyObject *
test_capsule(PyObject *self, PyObject *args) test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored))
{ {
PyObject *object; PyObject *object;
const char *error = NULL; const char *error = NULL;
@ -2964,7 +2964,7 @@ make_memoryview_from_NULL_pointer(PyObject *self)
} }
static PyObject * static PyObject *
test_from_contiguous(PyObject* self, PyObject *noargs) test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored))
{ {
int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
int init[5] = {0, 1, 2, 3, 4}; int init[5] = {0, 1, 2, 3, 4};
@ -3017,7 +3017,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs)
extern PyTypeObject _PyBytesIOBuffer_Type; extern PyTypeObject _PyBytesIOBuffer_Type;
static PyObject * static PyObject *
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs) test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored))
{ {
PyTypeObject *type = &_PyBytesIOBuffer_Type; PyTypeObject *type = &_PyBytesIOBuffer_Type;
PyObject *b; PyObject *b;

View File

@ -1803,7 +1803,7 @@ done:
PyDoc_STRVAR(reduce_doc, "Return state information for pickling"); PyDoc_STRVAR(reduce_doc, "Return state information for pickling");
static PyObject * static PyObject *
odictiter_reduce(odictiterobject *di) odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored))
{ {
/* copy the iterator state */ /* copy the iterator state */
odictiterobject tmp = *di; odictiterobject tmp = *di;