1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-06 00:23:47 +03:00

Fix comparisons between signed & unsigned integers

When python3 builds C modules, it adds the -Wsign-compare flag to GCC.
This creates lots of warnings where we compare a 'size_t' value against
an 'int' value due to signed/unsigned difference.  Change all the size_t
types to ssize_t to address this.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2017-09-26 11:12:18 +01:00
parent f70939fc3e
commit 75ec2acb61
4 changed files with 60 additions and 60 deletions

View File

@@ -319,7 +319,7 @@ libvirt_ulonglongUnwrap(PyObject *obj,
PyErr_SetString(PyExc_TypeError, "an integer is required");
}
if ((ullong_val == -1) && PyErr_Occurred())
if ((ullong_val == (unsigned long long)-1) && PyErr_Occurred())
return -1;
*val = ullong_val;