Skip to content

Commit d5c8bd8

Browse files
bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)
(cherry picked from commit 8152402) (cherry picked from commit ad8ac54) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 29d2f3c commit d5c8bd8

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Modules/_collectionsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
13411341
}
13421342

13431343
static PyObject *
1344-
deque_reduce(dequeobject *deque)
1344+
deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
13451345
{
13461346
PyObject *dict, *it;
13471347
_Py_IDENTIFIER(__dict__);

Modules/_cursesmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,27 +414,27 @@ PyTypeObject PyCursesWindow_Type;
414414
PARSESTR - format string for argument parsing
415415
*/
416416

417-
#define Window_NoArgNoReturnFunction(X) \
418-
static PyObject *PyCursesWindow_ ## X \
419-
(PyCursesWindowObject *self, PyObject *args) \
417+
#define Window_NoArgNoReturnFunction(X) \
418+
static PyObject *PyCursesWindow_ ## X \
419+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
420420
{ return PyCursesCheckERR(X(self->win), # X); }
421421

422422
#define Window_NoArgTrueFalseFunction(X) \
423423
static PyObject * PyCursesWindow_ ## X \
424-
(PyCursesWindowObject *self) \
424+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
425425
{ \
426426
if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
427427
else { Py_INCREF(Py_True); return Py_True; } }
428428

429429
#define Window_NoArgNoReturnVoidFunction(X) \
430430
static PyObject * PyCursesWindow_ ## X \
431-
(PyCursesWindowObject *self) \
431+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
432432
{ \
433433
X(self->win); Py_INCREF(Py_None); return Py_None; }
434434

435435
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
436436
static PyObject * PyCursesWindow_ ## X \
437-
(PyCursesWindowObject *self) \
437+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
438438
{ \
439439
TYPE arg1, arg2; \
440440
X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }

Modules/_testcapimodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ test_buildvalue_N_error(const char *fmt)
952952
}
953953

954954
static PyObject *
955-
test_buildvalue_N(PyObject *self, PyObject *noargs)
955+
test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
956956
{
957957
PyObject *arg, *res;
958958

@@ -2351,7 +2351,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
23512351

23522352
/* Some tests of PyUnicode_FromFormat(). This needs more tests. */
23532353
static PyObject *
2354-
test_string_from_format(PyObject *self, PyObject *args)
2354+
test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
23552355
{
23562356
PyObject *result;
23572357
char *msg;
@@ -2491,7 +2491,7 @@ typedef struct {
24912491
} known_capsule;
24922492

24932493
static PyObject *
2494-
test_capsule(PyObject *self, PyObject *args)
2494+
test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored))
24952495
{
24962496
PyObject *object;
24972497
const char *error = NULL;
@@ -2863,7 +2863,7 @@ make_memoryview_from_NULL_pointer(PyObject *self)
28632863
}
28642864

28652865
static PyObject *
2866-
test_from_contiguous(PyObject* self, PyObject *noargs)
2866+
test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored))
28672867
{
28682868
int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
28692869
int init[5] = {0, 1, 2, 3, 4};
@@ -2916,7 +2916,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs)
29162916
extern PyTypeObject _PyBytesIOBuffer_Type;
29172917

29182918
static PyObject *
2919-
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs)
2919+
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored))
29202920
{
29212921
PyTypeObject *type = &_PyBytesIOBuffer_Type;
29222922
PyObject *b;

Objects/odictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ odictiter_iternext(odictiterobject *di)
18891889
PyDoc_STRVAR(reduce_doc, "Return state information for pickling");
18901890

18911891
static PyObject *
1892-
odictiter_reduce(odictiterobject *di)
1892+
odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored))
18931893
{
18941894
/* copy the iterator state */
18951895
odictiterobject tmp = *di;

0 commit comments

Comments
 (0)