1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib/talloc: 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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Noel Power 2019-05-02 19:49:27 +01:00 committed by Andreas Schneider
parent d93ec5445b
commit 995e23f117
2 changed files with 12 additions and 5 deletions

View File

@ -47,7 +47,8 @@ static PyObject *pytalloc_report_full(PyObject *self, PyObject *args)
}
/* enable null tracking */
static PyObject *pytalloc_enable_null_tracking(PyObject *self)
static PyObject *pytalloc_enable_null_tracking(PyObject *self,
PyObject *Py_UNUSED(ignored))
{
talloc_enable_null_tracking();
return Py_None;

View File

@ -30,25 +30,31 @@
#include <talloc.h>
#include <pytalloc.h>
static PyObject *testpytalloc_new(PyTypeObject *mod)
static PyObject *testpytalloc_new(PyTypeObject *mod,
PyObject *Py_UNUSED(ignored))
{
char *obj = talloc_strdup(NULL, "This is a test string");;
return pytalloc_steal(pytalloc_GetObjectType(), obj);
}
static PyObject *testpytalloc_get_object_type(PyObject *mod) {
static PyObject *testpytalloc_get_object_type(PyObject *mod,
PyObject *Py_UNUSED(ignored))
{
PyObject *type = (PyObject *)pytalloc_GetObjectType();
Py_INCREF(type);
return type;
}
static PyObject *testpytalloc_base_new(PyTypeObject *mod)
static PyObject *testpytalloc_base_new(PyTypeObject *mod,
PyObject *Py_UNUSED(ignored))
{
char *obj = talloc_strdup(NULL, "This is a test string for a BaseObject");;
return pytalloc_steal(pytalloc_GetBaseObjectType(), obj);
}
static PyObject *testpytalloc_base_get_object_type(PyObject *mod) {
static PyObject *testpytalloc_base_get_object_type(PyObject *mod,
PyObject *Py_UNUSED(ignored))
{
PyObject *type = (PyObject *)pytalloc_GetBaseObjectType();
Py_INCREF(type);
return type;