Skip to content

Commit 8152402

Browse files
bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736)
1 parent 4a934d4 commit 8152402

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

Modules/_collectionsmodule.c

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

13121312
static PyObject *
1313-
deque_reduce(dequeobject *deque)
1313+
deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
13141314
{
13151315
PyObject *dict, *it;
13161316
_Py_IDENTIFIER(__dict__);

Modules/_cursesmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,26 +412,26 @@ PyTypeObject PyCursesWindow_Type;
412412
PARSESTR - format string for argument parsing
413413
*/
414414

415-
#define Window_NoArgNoReturnFunction(X) \
416-
static PyObject *PyCursesWindow_ ## X \
417-
(PyCursesWindowObject *self, PyObject *args) \
415+
#define Window_NoArgNoReturnFunction(X) \
416+
static PyObject *PyCursesWindow_ ## X \
417+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
418418
{ return PyCursesCheckERR(X(self->win), # X); }
419419

420420
#define Window_NoArgTrueFalseFunction(X) \
421421
static PyObject * PyCursesWindow_ ## X \
422-
(PyCursesWindowObject *self) \
422+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
423423
{ \
424424
return PyBool_FromLong(X(self->win)); }
425425

426426
#define Window_NoArgNoReturnVoidFunction(X) \
427427
static PyObject * PyCursesWindow_ ## X \
428-
(PyCursesWindowObject *self) \
428+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
429429
{ \
430430
X(self->win); Py_RETURN_NONE; }
431431

432432
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
433433
static PyObject * PyCursesWindow_ ## X \
434-
(PyCursesWindowObject *self) \
434+
(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored)) \
435435
{ \
436436
TYPE arg1, arg2; \
437437
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
@@ -947,7 +947,7 @@ test_buildvalue_N_error(const char *fmt)
947947
}
948948

949949
static PyObject *
950-
test_buildvalue_N(PyObject *self, PyObject *noargs)
950+
test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
951951
{
952952
PyObject *arg, *res;
953953

@@ -2457,7 +2457,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
24572457

24582458
/* Some tests of PyUnicode_FromFormat(). This needs more tests. */
24592459
static PyObject *
2460-
test_string_from_format(PyObject *self, PyObject *args)
2460+
test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
24612461
{
24622462
PyObject *result;
24632463
char *msg;
@@ -2597,7 +2597,7 @@ typedef struct {
25972597
} known_capsule;
25982598

25992599
static PyObject *
2600-
test_capsule(PyObject *self, PyObject *args)
2600+
test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored))
26012601
{
26022602
PyObject *object;
26032603
const char *error = NULL;
@@ -2968,7 +2968,7 @@ make_memoryview_from_NULL_pointer(PyObject *self, PyObject *Py_UNUSED(ignored))
29682968
}
29692969

29702970
static PyObject *
2971-
test_from_contiguous(PyObject* self, PyObject *noargs)
2971+
test_from_contiguous(PyObject* self, PyObject *Py_UNUSED(ignored))
29722972
{
29732973
int data[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
29742974
int init[5] = {0, 1, 2, 3, 4};
@@ -3021,7 +3021,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs)
30213021
extern PyTypeObject _PyBytesIOBuffer_Type;
30223022

30233023
static PyObject *
3024-
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *noargs)
3024+
test_pep3118_obsolete_write_locks(PyObject* self, PyObject *Py_UNUSED(ignored))
30253025
{
30263026
PyTypeObject *type = &_PyBytesIOBuffer_Type;
30273027
PyObject *b;

Objects/dictobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4201,7 +4201,7 @@ dictviews_isdisjoint(PyObject *self, PyObject *other)
42014201
PyDoc_STRVAR(isdisjoint_doc,
42024202
"Return True if the view and the given iterable have a null intersection.");
42034203

4204-
static PyObject* dictkeys_reversed(_PyDictViewObject *dv);
4204+
static PyObject* dictkeys_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored));
42054205

42064206
PyDoc_STRVAR(reversed_keys_doc,
42074207
"Return a reverse iterator over the dict keys.");
@@ -4254,7 +4254,7 @@ dictkeys_new(PyObject *dict, PyObject *Py_UNUSED(ignored))
42544254
}
42554255

42564256
static PyObject *
4257-
dictkeys_reversed(_PyDictViewObject *dv)
4257+
dictkeys_reversed(_PyDictViewObject *dv, PyObject *Py_UNUSED(ignored))
42584258
{
42594259
if (dv->dv_dict == NULL) {
42604260
Py_RETURN_NONE;

Objects/odictobject.c

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

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

0 commit comments

Comments
 (0)