diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2017-09-26 11:12:18 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2017-09-26 11:12:18 +0100 |
commit | 75ec2acb6163b4f71921e6efbaca088fa8ed16a9 (patch) | |
tree | 644f192bab3fc80a0fad3bd5a0337f13dca6fbff /libvirt-utils.c | |
parent | f70939fc3e2882aa55ad358617d4eaad7b5f5291 (diff) | |
download | libvirt-python-75ec2acb6163b4f71921e6efbaca088fa8ed16a9.tar.gz |
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>
Diffstat (limited to 'libvirt-utils.c')
-rw-r--r-- | libvirt-utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libvirt-utils.c b/libvirt-utils.c index 727397d..b8ac5e9 100644 --- a/libvirt-utils.c +++ b/libvirt-utils.c @@ -221,7 +221,7 @@ getPyVirTypedParameter(const virTypedParameter *params, int nparams) { PyObject *key, *val, *info; - size_t i; + ssize_t i; if ((info = PyDict_New()) == NULL) return NULL; @@ -295,7 +295,7 @@ setPyVirTypedParameter(PyObject *info, #endif virTypedParameterPtr temp = NULL, ret = NULL; Py_ssize_t size; - size_t i; + ssize_t i; if ((size = PyDict_Size(info)) < 0) return NULL; @@ -412,7 +412,7 @@ virPyDictToTypedParamOne(virTypedParameterPtr *params, PyObject *value) { int rv = -1, type = -1; - size_t i; + ssize_t i; for (i = 0; i < nhints; i++) { if (STREQ(hints[i].name, keystr)) { @@ -605,7 +605,7 @@ virPyCpumapConvert(int cpunum, int *cpumaplen) { int tuple_size; - size_t i; + ssize_t i; *cpumapptr = NULL; if (!PyTuple_Check(pycpumap)) { |