From 5d324c6b94876e067876b2c924796e543a0f654e Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 7 Oct 2013 23:04:23 +0100 Subject: various: fix mixing declarations and code compiler warnings [smatch] Signed-off-by: Sami Kerola --- libmount/python/pylibmount.c | 3 ++- libmount/python/tab.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'libmount/python') diff --git a/libmount/python/pylibmount.c b/libmount/python/pylibmount.c index 1403bfe3c..c538bb543 100644 --- a/libmount/python/pylibmount.c +++ b/libmount/python/pylibmount.c @@ -90,6 +90,7 @@ PyObject *PyObjectResultInt(int i) PyObject *PyObjectResultStr(const char *s) { + PyObject *result; if (!s) /* TODO: maybe lie about it and return "": * which would allow for @@ -97,7 +98,7 @@ PyObject *PyObjectResultStr(const char *s) * fs.comment += "comment" return Py_BuildValue("s", ""); */ Py_RETURN_NONE; - PyObject *result = Py_BuildValue("s", s); + result = Py_BuildValue("s", s); if (!result) PyErr_SetString(PyExc_RuntimeError, CONSTRUCT_ERR); return result; diff --git a/libmount/python/tab.c b/libmount/python/tab.c index 9ea6924c0..6f255aef7 100644 --- a/libmount/python/tab.c +++ b/libmount/python/tab.c @@ -600,9 +600,10 @@ static int Table_init(TableObject *self, PyObject *args, PyObject *kwds) self->iter = mnt_new_iter(MNT_ITER_FORWARD); if (errcb) { + PyObject *tmp; if (!PyCallable_Check(errcb)) return -1; - PyObject *tmp = self->errcb; + tmp = self->errcb; Py_INCREF(errcb); self->errcb = errcb; Py_XDECREF(tmp); -- cgit v1.2.3-55-g7522