mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
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.
This commit is contained in:
parent
a6f0eadb51
commit
18a0d95aa2
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user