diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-11-05 13:48:34 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-11-07 01:39:39 +0100 |
commit | 0d6f1a1630a3b26169fd68535d0ab97aa301913c (patch) | |
tree | 3298105bc0bbbd1ce255e549e5e6b03f39a7e120 | |
parent | 3d443b3797dd81133990a48b6021dcf529cc5497 (diff) | |
download | samba-0d6f1a1630a3b26169fd68535d0ab97aa301913c.tar.gz samba-0d6f1a1630a3b26169fd68535d0ab97aa301913c.tar.bz2 samba-0d6f1a1630a3b26169fd68535d0ab97aa301913c.zip |
pytalloc: Make some arguments optional.
-rw-r--r-- | lib/talloc/pytalloc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index 69a2c2fc13..96a6122a36 100644 --- a/lib/talloc/pytalloc.c +++ b/lib/talloc/pytalloc.c @@ -24,10 +24,10 @@ /* print a talloc tree report for a talloc python object */ static PyObject *py_talloc_report_full(PyObject *self, PyObject *args) { - PyObject *py_obj; + PyObject *py_obj = Py_None; PyTypeObject *type; - if (!PyArg_ParseTuple(args, "O", &py_obj)) + if (!PyArg_ParseTuple(args, "|O", &py_obj)) return NULL; if (py_obj == Py_None) { @@ -40,7 +40,7 @@ static PyObject *py_talloc_report_full(PyObject *self, PyObject *args) } /* enable null tracking */ -static PyObject *py_talloc_enable_null_tracking(PyObject *self, PyObject *args) +static PyObject *py_talloc_enable_null_tracking(PyObject *self) { talloc_enable_null_tracking(); return Py_None; @@ -49,10 +49,10 @@ static PyObject *py_talloc_enable_null_tracking(PyObject *self, PyObject *args) /* return the number of talloc blocks */ static PyObject *py_talloc_total_blocks(PyObject *self, PyObject *args) { - PyObject *py_obj; + PyObject *py_obj = Py_None; PyTypeObject *type; - if (!PyArg_ParseTuple(args, "O", &py_obj)) + if (!PyArg_ParseTuple(args, "|O", &py_obj)) return NULL; if (py_obj == Py_None) { @@ -67,7 +67,7 @@ static PyObject *py_talloc_total_blocks(PyObject *self, PyObject *args) static PyMethodDef talloc_methods[] = { { "report_full", (PyCFunction)py_talloc_report_full, METH_VARARGS, "show a talloc tree for an object"}, - { "enable_null_tracking", (PyCFunction)py_talloc_enable_null_tracking, METH_VARARGS, + { "enable_null_tracking", (PyCFunction)py_talloc_enable_null_tracking, METH_NOARGS, "enable tracking of the NULL object"}, { "total_blocks", (PyCFunction)py_talloc_total_blocks, METH_VARARGS, "return talloc block count"}, |