From 76b84c5f6604c94bb0d13a5b6cad6873112a898b Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 15 Oct 2020 11:44:43 +0200 Subject: [PATCH] Fix signedness warnings in glib/tests/pattern.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/tests/pattern.c: In function ‘main’: glib/tests/pattern.c:218:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 218 | for (i = 0; i < G_N_ELEMENTS (compile_tests); i++) | ^ glib/tests/pattern.c:225:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 225 | for (i = 0; i < G_N_ELEMENTS (match_tests); i++) | ^ glib/tests/pattern.c:232:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 232 | for (i = 0; i < G_N_ELEMENTS (equal_tests); i++) | ^ --- glib/tests/pattern.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glib/tests/pattern.c b/glib/tests/pattern.c index 2f3f9e887..70553a882 100644 --- a/glib/tests/pattern.c +++ b/glib/tests/pattern.c @@ -210,28 +210,28 @@ test_equal (gconstpointer d) int main (int argc, char** argv) { - gint i; + gsize i; gchar *path; g_test_init (&argc, &argv, NULL); for (i = 0; i < G_N_ELEMENTS (compile_tests); i++) { - path = g_strdup_printf ("/pattern/compile/%d", i); + path = g_strdup_printf ("/pattern/compile/%" G_GSIZE_FORMAT, i); g_test_add_data_func (path, &compile_tests[i], test_compilation); g_free (path); } for (i = 0; i < G_N_ELEMENTS (match_tests); i++) { - path = g_strdup_printf ("/pattern/match/%d", i); + path = g_strdup_printf ("/pattern/match/%" G_GSIZE_FORMAT, i); g_test_add_data_func (path, &match_tests[i], test_match); g_free (path); } for (i = 0; i < G_N_ELEMENTS (equal_tests); i++) { - path = g_strdup_printf ("/pattern/equal/%d", i); + path = g_strdup_printf ("/pattern/equal/%" G_GSIZE_FORMAT, i); g_test_add_data_func (path, &equal_tests[i], test_equal); g_free (path); }