]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33012: Fix signatures of METH_NOARGS functions. (GH-10736) (GH-10748)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 27 Nov 2018 18:51:07 +0000 (10:51 -0800)
committerGitHub <noreply@github.com>
Tue, 27 Nov 2018 18:51:07 +0000 (10:51 -0800)
(cherry picked from commit 81524022d0c0df7a41f9b2b2df41e2ebe140e610)
(cherry picked from commit ad8ac54aa3d2323bdb5feb5e858a922840358187)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Modules/_collectionsmodule.c
Modules/_cursesmodule.c
Modules/_testcapimodule.c
Objects/odictobject.c

index 4fbf3bdb1463e5f0133da895c77fd57d82ec3fd6..25006fa2c975810ea1319065d0fd43ebcd8afc3f 100644 (file)
@@ -1341,7 +1341,7 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
 }
 
 static PyObject *
-deque_reduce(dequeobject *deque)
+deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
 {
     PyObject *dict, *it;
     _Py_IDENTIFIER(__dict__);
index 8b46466d6f0058b563c4dfd72e8f9459a0b442d6..c048a7ddf2da3ace98e5f3bf4797eb75a0fd40b8 100644 (file)
@@ -414,27 +414,27 @@ PyTypeObject PyCursesWindow_Type;
    PARSESTR - format string for argument parsing
 */
 
-#define Window_NoArgNoReturnFunction(X)                 \
-    static PyObject *PyCursesWindow_ ## X               \
-    (PyCursesWindowObject *self, PyObject *args)        \
+#define Window_NoArgNoReturnFunction(X)                         \
+    static PyObject *PyCursesWindow_ ## X                       \
+    (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))  \
     { return PyCursesCheckERR(X(self->win), # X); }
 
 #define Window_NoArgTrueFalseFunction(X)                                \
     static PyObject * PyCursesWindow_ ## X                              \
-    (PyCursesWindowObject *self)                                        \
+    (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))          \
     {                                                                   \
         if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
         else { Py_INCREF(Py_True); return Py_True; } }
 
 #define Window_NoArgNoReturnVoidFunction(X)                     \
     static PyObject * PyCursesWindow_ ## X                      \
-    (PyCursesWindowObject *self)                                \
+    (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))  \
     {                                                           \
         X(self->win); Py_INCREF(Py_None); return Py_None; }
 
 #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR)               \
     static PyObject * PyCursesWindow_ ## X                              \
-    (PyCursesWindowObject *self)                                        \
+    (PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))          \
     {                                                                   \
         TYPE arg1, arg2;                                                \
         X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }
index 556d49bb3c83998406806b513518300822ee1307..067d46346a68d2098143e01de1e6cf85fcd22230 100644 (file)
@@ -952,7 +952,7 @@ test_buildvalue_N_error(const char *fmt)
 }
 
 static PyObject *
-test_buildvalue_N(PyObject *self, PyObject *noargs)
+test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     PyObject *arg, *res;
 
@@ -2351,7 +2351,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
 
 /* Some tests of PyUnicode_FromFormat().  This needs more tests. */
 static PyObject *
-test_string_from_format(PyObject *self, PyObject *args)
+test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     PyObject *result;
     char *msg;
@@ -2491,7 +2491,7 @@ typedef struct {
 } known_capsule;
 
 static PyObject *
-test_capsule(PyObject *self, PyObject *args)
+test_capsule(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     PyObject *object;
     const char *error = NULL;
@@ -2863,7 +2863,7 @@ make_memoryview_from_NULL_pointer(PyObject *self)
 }
 
 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 init[5] = {0, 1, 2, 3, 4};
@@ -2916,7 +2916,7 @@ test_from_contiguous(PyObject* self, PyObject *noargs)
 extern PyTypeObject _PyBytesIOBuffer_Type;
 
 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;
     PyObject *b;
index f433cd2f4cec67536f300917a664d3d43f3e1293..fdeda43bbd81f0dcabc79178328ab3d953dd0dee 100644 (file)
@@ -1889,7 +1889,7 @@ done:
 PyDoc_STRVAR(reduce_doc, "Return state information for pickling");
 
 static PyObject *
-odictiter_reduce(odictiterobject *di)
+odictiter_reduce(odictiterobject *di, PyObject *Py_UNUSED(ignored))
 {
     /* copy the iterator state */
     odictiterobject tmp = *di;