1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-02 04:21:59 +03:00

build: Fix build warning on libvirt-python

On compiling libvirt-python, we get such a warning:

libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
libvirt-qemu-override.c:304: warning: suggest explicit braces to avoid ambiguous ‘else’

Py_DECREF is a macro using if/else on older Python releases.
The solution is to add braces.
Python 2.7 and newer has the macro wrapped in a do { } while(0) block.

Signed-off-by: Mo Yuxiang <Moyuxiang@huawei.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Mo Yuxiang
2014-08-08 17:55:37 +08:00
committed by Ján Tomko
parent 86ee51ce97
commit 2175f4f3da

View File

@ -301,8 +301,9 @@ libvirt_qemu_virConnectDomainQemuMonitorEventRegister(PyObject *self ATTRIBUTE_U
flags);
LIBVIRT_END_ALLOW_THREADS;
if (ret < 0)
if (ret < 0) {
Py_DECREF(pyobj_cbData);
}
py_retval = libvirt_intWrap(ret);
return py_retval;