summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-10-15 13:30:19 +0200
committerEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-11-13 10:12:16 +0100
commitcc041eb74201449a554ea4fc0d36f55b191fe007 (patch)
treeace7e3672359e08e83b7eecfb8834a83841ea5ea
parent101a6043300a7187c8e83f0683e267e363d57ccf (diff)
downloadglib-cc041eb74201449a554ea4fc0d36f55b191fe007.tar.gz
Fix signedness warning in glib/tests/regex.c
glib/tests/regex.c: In function ‘test_match_all’: glib/tests/regex.c:1317:19: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} 1317 | if (match_count != g_slist_length (data->expected)) | ^~
-rw-r--r--glib/tests/regex.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/glib/tests/regex.c b/glib/tests/regex.c
index 1ea6f9288..d86d32f9b 100644
--- a/glib/tests/regex.c
+++ b/glib/tests/regex.c
@@ -1305,8 +1305,7 @@ test_match_all (gconstpointer d)
GMatchInfo *match_info;
GSList *l_exp;
gboolean match_ok;
- gint match_count;
- gint i;
+ guint i, match_count;
regex = g_regex_new (data->pattern, 0, 0, NULL);
match_ok = g_regex_match_all (regex, data->string, 0, &match_info);
@@ -1331,7 +1330,7 @@ test_match_all (gconstpointer d)
matched_string = g_match_info_fetch (match_info, i);
g_match_info_fetch_pos (match_info, i, &start, &end);
- g_message ("%d. %d-%d '%s'", i, start, end, matched_string);
+ g_message ("%u. %d-%d '%s'", i, start, end, matched_string);
g_free (matched_string);
}
@@ -1342,11 +1341,11 @@ test_match_all (gconstpointer d)
{
Match *exp = l_exp->data;
- g_message ("%d. %d-%d '%s'", i, exp->start, exp->end, exp->string);
+ g_message ("%u. %d-%d '%s'", i, exp->start, exp->end, exp->string);
i++;
}
- g_error ("match_count not as expected: %d != %d",
+ g_error ("match_count not as expected: %u != %d",
match_count, g_slist_length (data->expected));
}