summaryrefslogtreecommitdiffstats
path: root/libmount/python
diff options
context:
space:
mode:
authorSami Kerola2013-10-08 00:04:23 +0200
committerKarel Zak2013-10-08 15:47:59 +0200
commit5d324c6b94876e067876b2c924796e543a0f654e (patch)
tree337a16397507954d26be6cfd196ed71168163ccf /libmount/python
parentdocs: improve grammar and wording of the release-schedule text (diff)
downloadkernel-qcow2-util-linux-5d324c6b94876e067876b2c924796e543a0f654e.tar.gz
kernel-qcow2-util-linux-5d324c6b94876e067876b2c924796e543a0f654e.tar.xz
kernel-qcow2-util-linux-5d324c6b94876e067876b2c924796e543a0f654e.zip
various: fix mixing declarations and code compiler warnings [smatch]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libmount/python')
-rw-r--r--libmount/python/pylibmount.c3
-rw-r--r--libmount/python/tab.c3
2 files changed, 4 insertions, 2 deletions
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);