s3/smbd: squash 'cast between incompatible function types' warning
authorNoel Power <noel.power@suse.com>
Thu, 2 May 2019 18:31:18 +0000 (19:31 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 16 May 2019 17:55:17 +0000 (17:55 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/pysmbd.c

index 29db8eb01c4dbfb29843c7639925ff4cb04569f3..199885e68017643565c3ff12ee37bc6267f1ad1a 100644 (file)
@@ -26,6 +26,7 @@
 #include <Python.h>
 #include "includes.h"
 #include "python/py3compat.h"
+#include "python/modules.h"
 #include "smbd/smbd.h"
 #include "libcli/util/pyerrors.h"
 #include "librpc/rpc/pyrpc_util.h"
@@ -538,7 +539,8 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
 /*
   check if we have ACL support
  */
-static PyObject *py_smbd_have_posix_acls(PyObject *self)
+static PyObject *py_smbd_have_posix_acls(PyObject *self,
+               PyObject *Py_UNUSED(ignored))
 {
 #ifdef HAVE_POSIX_ACLS
        return PyBool_FromLong(true);
@@ -882,31 +884,40 @@ static PyMethodDef py_smbd_methods[] = {
                (PyCFunction)py_smbd_have_posix_acls, METH_NOARGS,
                NULL },
        { "set_simple_acl",
-               (PyCFunction)py_smbd_set_simple_acl, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_simple_acl),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "set_nt_acl",
-               (PyCFunction)py_smbd_set_nt_acl, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_nt_acl),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "get_nt_acl",
-               (PyCFunction)py_smbd_get_nt_acl, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_get_nt_acl),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "get_sys_acl",
-               (PyCFunction)py_smbd_get_sys_acl, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_get_sys_acl),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "set_sys_acl",
-               (PyCFunction)py_smbd_set_sys_acl, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_set_sys_acl),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "chown",
-               (PyCFunction)py_smbd_chown, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_chown),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "unlink",
-               (PyCFunction)py_smbd_unlink, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_unlink),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "mkdir",
-               (PyCFunction)py_smbd_mkdir, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_mkdir),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { "create_file",
-               (PyCFunction)py_smbd_create_file, METH_VARARGS|METH_KEYWORDS,
+               PY_DISCARD_FUNC_SIG(PyCFunction, py_smbd_create_file),
+               METH_VARARGS|METH_KEYWORDS,
                NULL },
        { NULL }
 };