s4: squash 'cast between incompatible function types' warning
[bbaumbach/samba-autobuild/.git] / source4 / lib / messaging / pymessaging.c
index 0681b34922096f32c12d9acb425b06deea502614..39c09a8240324c5f4c73b08d1f340ed325df6416 100644 (file)
@@ -310,7 +310,7 @@ static PyObject *py_imessaging_loop_once(PyObject *self, PyObject *args, PyObjec
        Py_RETURN_NONE;
 }
 
-static PyObject *py_irpc_add_name(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_add_name(PyObject *self, PyObject *args)
 {
        imessaging_Object *iface = (imessaging_Object *)self;
        char *server_name;
@@ -329,7 +329,7 @@ static PyObject *py_irpc_add_name(PyObject *self, PyObject *args, PyObject *kwar
        Py_RETURN_NONE;
 }
 
-static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args)
 {
        imessaging_Object *iface = (imessaging_Object *)self;
        char *server_name;
@@ -343,7 +343,7 @@ static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args, PyObject *k
        Py_RETURN_NONE;
 }
 
-static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args)
 {
        imessaging_Object *iface = (imessaging_Object *)self;
        char *server_name;
@@ -397,7 +397,8 @@ static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args, PyObject
        return pylist;
 }
 
-static PyObject *py_irpc_all_servers(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_irpc_all_servers(PyObject *self,
+               PyObject *Py_UNUSED(ignored))
 {
        imessaging_Object *iface = (imessaging_Object *)self;
        PyObject *pylist;
@@ -437,16 +438,22 @@ static PyObject *py_irpc_all_servers(PyObject *self, PyObject *args, PyObject *k
 }
 
 static PyMethodDef py_imessaging_methods[] = {
-       { "send", (PyCFunction)py_imessaging_send, METH_VARARGS|METH_KEYWORDS,
+       { "send", PY_DISCARD_FUNC_SIG(PyCFunction, py_imessaging_send),
+               METH_VARARGS|METH_KEYWORDS,
                "S.send(target, msg_type, data) -> None\nSend a message" },
-       { "register", (PyCFunction)py_imessaging_register, METH_VARARGS|METH_KEYWORDS,
+       { "register", PY_DISCARD_FUNC_SIG(PyCFunction, py_imessaging_register),
+               METH_VARARGS|METH_KEYWORDS,
                "S.register((callback, context), msg_type=None) -> msg_type\nRegister a message handler.  "
                "The callback and context must be supplied as a two-element tuple." },
-       { "deregister", (PyCFunction)py_imessaging_deregister, METH_VARARGS|METH_KEYWORDS,
+       { "deregister", PY_DISCARD_FUNC_SIG(PyCFunction,
+                                           py_imessaging_deregister),
+               METH_VARARGS|METH_KEYWORDS,
                "S.deregister((callback, context), msg_type) -> None\nDeregister a message handler "
                "The callback and context must be supplied as the exact same two-element tuple "
                "as was used as registration time." },
-       { "loop_once", (PyCFunction)py_imessaging_loop_once, METH_VARARGS|METH_KEYWORDS,
+       { "loop_once", PY_DISCARD_FUNC_SIG(PyCFunction,
+                                          py_imessaging_loop_once),
+               METH_VARARGS|METH_KEYWORDS,
                "S.loop_once(timeout) -> None\n"
                "Loop on the internal event context until we get an event "
                "(which might be a message calling the callback), "