summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2019-06-22 13:34:21 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2019-06-22 13:36:45 -0500
commit18a0d95aa21f5007a330c00d7d25412695525bf1 (patch)
tree2a3fac0986e6238083d892d251de9310a0cb12c8
parenta6f0eadb51aae5351a0cfd6b9da3dcba6b134e1a (diff)
downloadgvdb-18a0d95aa21f5007a330c00d7d25412695525bf1.tar.gz
Fix -Wsign-compare warning
[23/236] Compiling C object 'lib/76b5a...isc@sha/contrib_gvdb_gvdb-reader.c.o'. ../../../../Projects/epiphany/lib/contrib/gvdb/gvdb-reader.c: In function ‘gvdb_table_get_names’: ../../../../Projects/epiphany/lib/contrib/gvdb/gvdb-reader.c:428:27: warning: comparison of integer expressions of different signedness: ‘guint32’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Wsign-compare] 428 | else if (parent < n_names && names[parent] != NULL) | ^ To fix this, we have to change n_names to guint, and then also change the types of everything it's compared against. This seems to be safe since none of these should ever be negative.
-rw-r--r--gvdb-reader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gvdb-reader.c b/gvdb-reader.c
index ccae40e..2dbb5b4 100644
--- a/gvdb-reader.c
+++ b/gvdb-reader.c
@@ -351,10 +351,10 @@ gvdb_table_get_names (GvdbTable *table,
gsize *length)
{
gchar **names;
- gint n_names;
- gint filled;
- gint total;
- gint i;
+ guint n_names;
+ guint filled;
+ guint total;
+ guint i;
/* We generally proceed by iterating over the list of items in the
* hash table (in order of appearance) recording them into an array.