Skip to content

Commit ad8ac54

Browse files
bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)
(cherry picked from commit 8152402)
1 parent 5ceb701 commit ad8ac54

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
@@ -1344,7 +1344,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
13441344
}
13451345

13461346
static PyObject *
1347-
deque_reduce(dequeobject *deque)
1347+
deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
13481348
{
13491349
PyObject *dict, *it;
13501350
_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_RETURN_FALSE; } \
427427
else { Py_RETURN_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_RETURN_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
@@ -943,7 +943,7 @@ test_buildvalue_N_error(const char *fmt)
943943
}
944944

945945
static PyObject *
946-
test_buildvalue_N(PyObject *self, PyObject *noargs)
946+
test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
947947
{
948948
PyObject *arg, *res;
949949

@@ -2453,7 +2453,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
24532453

24542454
/* Some tests of PyUnicode_FromFormat(). This needs more tests. */
24552455
static PyObject *
2456-
test_string_from_format(PyObject *self, PyObject *args)
2456+
test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
24572457
{
24582458
PyObject *result;
24592459
char *msg;
@@ -2593,7 +2593,7 @@ typedef struct {
25932593
} known_capsule;
25942594

25952595
static PyObject *
2596-
test_capsule(PyObject *self, PyObject *args)
2596+
test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored))
25972597
{
25982598
PyObject *object;
25992599
const char *error = NULL;
@@ -2964,7 +2964,7 @@ make_memoryview_from_NULL_pointer(PyObject *self)
29642964
}
29652965

29662966
static PyObject *
2967-
test_from_contiguous(PyObject* self, PyObject *noargs)
2967+
test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored))
29682968
{
29692969
int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
29702970
int init[5] = {0, 1, 2, 3, 4};
@@ -3017,7 +3017,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs)
30173017
extern PyTypeObject _PyBytesIOBuffer_Type;
30183018

30193019
static PyObject *
3020-
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs)
3020+
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored))
30213021
{
30223022
PyTypeObject *type = &_PyBytesIOBuffer_Type;
30233023
PyObject *b;

Objects/odictobject.c

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

18051805
static PyObject *
1806-
odictiter_reduce(odictiterobject *di)
1806+
odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored))
18071807
{
18081808
/* copy the iterator state */
18091809
odictiterobject tmp = *di;

0 commit comments

Comments
 (0)