From 75ec2acb6163b4f71921e6efbaca088fa8ed16a9 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 26 Sep 2017 11:12:18 +0100 Subject: 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 --- libvirt-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libvirt-utils.c') 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)) { -- cgit v1.2.1