diff options
author | Noel Power <noel.power@suse.com> | 2019-05-02 19:47:29 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-05-16 17:55:17 +0000 |
commit | cbdd3d0c26c9cefd968a2adaf9892c5c858bf597 (patch) | |
tree | ce2f3c7d6a024b80f2c5981707371123c6d12c81 /libgpo | |
parent | a7d75a1c57befee4a178b7061ea218e353a72195 (diff) | |
download | samba-cbdd3d0c26c9cefd968a2adaf9892c5c858bf597.tar.gz |
squash 'cast between incompatible function types' warning
To avoid warning above produced by using
-Wcast-function-type we;
+ ensure PyCFunctions of type METH_NOARGS defined dummy arg
+ ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
macro
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'libgpo')
-rw-r--r-- | libgpo/pygpo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index e82cc5c984f..35d35d69cbe 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -28,6 +28,7 @@ #include "auth/credentials/pycredentials.h" #include "libcli/util/pyerrors.h" #include "python/py3compat.h" +#include "python/modules.h" /* A Python C API module to use LIBGPO */ @@ -115,7 +116,9 @@ out: } static PyMethodDef GPO_methods[] = { - {"get_unix_path", (PyCFunction)py_gpo_get_unix_path, METH_KEYWORDS, + {"get_unix_path", PY_DISCARD_FUNC_SIG(PyCFunction, + py_gpo_get_unix_path), + METH_KEYWORDS, NULL }, {NULL} }; @@ -143,7 +146,7 @@ static void py_ads_dealloc(ADS* self) Py_TYPE(self)->tp_free((PyObject*)self); } -static PyObject* py_ads_connect(ADS *self); +static PyObject* py_ads_connect(ADS *self, PyObject *Py_UNUSED(ignored)); static int py_ads_init(ADS *self, PyObject *args, PyObject *kwds) { const char *realm = NULL; @@ -213,7 +216,8 @@ static int py_ads_init(ADS *self, PyObject *args, PyObject *kwds) } /* connect. Failure to connect results in an Exception */ -static PyObject* py_ads_connect(ADS *self) +static PyObject* py_ads_connect(ADS *self, + PyObject *Py_UNUSED(ignored)) { ADS_STATUS status; TALLOC_CTX *frame = talloc_stackframe(); @@ -485,7 +489,8 @@ static PyMethodDef ADS_methods[] = { { "connect", (PyCFunction)py_ads_connect, METH_NOARGS, "Connect to the LDAP server" }, #ifdef HAVE_ADS - { "get_gpo_list", (PyCFunction)py_ads_get_gpo_list, METH_VARARGS | METH_KEYWORDS, + { "get_gpo_list", PY_DISCARD_FUNC_SIG(PyCFunction, py_ads_get_gpo_list), + METH_VARARGS | METH_KEYWORDS, NULL }, #endif { NULL } |