From: Dmitry Antipov Date: Wed, 8 Feb 2023 09:03:16 +0000 (+0300) Subject: pylibsmb: fix cast warnings in Python method definitions X-Git-Tag: tevent-0.17.0~565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90c04dd62c108c13b11ead1d4afb023f96a9886d;p=thirdparty%2Fsamba.git pylibsmb: fix cast warnings in Python method definitions Fix the following cast warnings in Python method definitions: ../../source3/libsmb/pylibsmb.c:1867:28: warning: cast between incompatible function types from ‘PyObject * (*)(struct py_cli_notify_state *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct py_cli_notify_state *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type] 1867 | .ml_meth = (PyCFunction)py_cli_notify_get_changes, | ^ ../../source3/libsmb/pylibsmb.c:2661:11: warning: cast between incompatible function types from ‘PyObject * (*)(struct py_cli_state *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct py_cli_state *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type] 2661 | (PyCFunction)py_cli_fsctl, | ^ Signed-off-by: Dmitry Antipov Reviewed-by: Volker Lendecke Reviewed-by: Douglas Bagnall --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 97ae69ef50e..19e6f4e717f 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -2111,7 +2111,8 @@ static PyObject *py_cli_notify_get_changes(struct py_cli_notify_state *self, static PyMethodDef py_cli_notify_state_methods[] = { { .ml_name = "get_changes", - .ml_meth = (PyCFunction)py_cli_notify_get_changes, + .ml_meth = (PY_DISCARD_FUNC_SIG(PyCFunction, + py_cli_notify_get_changes)), .ml_flags = METH_VARARGS|METH_KEYWORDS, .ml_doc = "Wait for change notifications: \n" "N.get_changes(wait=BOOLEAN) -> " @@ -3122,7 +3123,7 @@ static PyMethodDef py_cli_state_methods[] = { "smb1_stat(path) -> stat info", }, { "fsctl", - (PyCFunction)py_cli_fsctl, + PY_DISCARD_FUNC_SIG(PyCFunction, py_cli_fsctl), METH_VARARGS|METH_KEYWORDS, "fsctl(fnum, ctl_code, in_bytes, max_out) -> out_bytes", },