mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +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:
parent
d93ec5445b
commit
995e23f117
@ -47,7 +47,8 @@ static PyObject *pytalloc_report_full(PyObject *self, PyObject *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* enable null tracking */
|
/* 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();
|
talloc_enable_null_tracking();
|
||||||
return Py_None;
|
return Py_None;
|
||||||
|
@ -30,25 +30,31 @@
|
|||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
#include <pytalloc.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");;
|
char *obj = talloc_strdup(NULL, "This is a test string");;
|
||||||
return pytalloc_steal(pytalloc_GetObjectType(), obj);
|
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();
|
PyObject *type = (PyObject *)pytalloc_GetObjectType();
|
||||||
Py_INCREF(type);
|
Py_INCREF(type);
|
||||||
return 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");;
|
char *obj = talloc_strdup(NULL, "This is a test string for a BaseObject");;
|
||||||
return pytalloc_steal(pytalloc_GetBaseObjectType(), obj);
|
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();
|
PyObject *type = (PyObject *)pytalloc_GetBaseObjectType();
|
||||||
Py_INCREF(type);
|
Py_INCREF(type);
|
||||||
return type;
|
return type;
|
||||||
|
Loading…
Reference in New Issue
Block a user