[glib: 8/15] Fix signedness warnings in glib/tests/pattern.c




commit 76b84c5f6604c94bb0d13a5b6cad6873112a898b
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Thu Oct 15 11:44:43 2020 +0200

    Fix signedness warnings in glib/tests/pattern.c
    
    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);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]