[glib: 7/8] Fix several signedness warnings in gio/tests/network-address.c




commit d936ff10e69cceeae6eab6b9467a4a9900b7030e
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Wed Nov 18 21:11:22 2020 +0100

    Fix several signedness warnings in gio/tests/network-address.c
    
    gio/tests/network-address.c: In function ‘main’:
    gio/tests/network-address.c:1194:17: error: comparison of integer expressions of different signedness: 
‘gint’ {aka ‘int’} and ‘long unsigned int’
     1194 |   for (i = 0; i < G_N_ELEMENTS (host_tests); i++)
          |                 ^
    gio/tests/network-address.c:1201:17: error: comparison of integer expressions of different signedness: 
‘gint’ {aka ‘int’} and ‘long unsigned int’
     1201 |   for (i = 0; i < G_N_ELEMENTS (uri_tests); i++)
          |                 ^
    gio/tests/network-address.c:1208:17: error: comparison of integer expressions of different signedness: 
‘gint’ {aka ‘int’} and ‘long unsigned int’
     1208 |   for (i = 0; i < G_N_ELEMENTS (address_tests); i++)
          |                 ^
    gio/tests/network-address.c:1215:17: error: comparison of integer expressions of different signedness: 
‘gint’ {aka ‘int’} and ‘long unsigned int’
     1215 |   for (i = 0; i < G_N_ELEMENTS (address_tests); i++)
          |                 ^

 gio/tests/network-address.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gio/tests/network-address.c b/gio/tests/network-address.c
index cbebb6c9f..3426e8c06 100644
--- a/gio/tests/network-address.c
+++ b/gio/tests/network-address.c
@@ -1183,7 +1183,7 @@ test_happy_eyeballs_both_error_delays_3 (HappyEyeballsFixture *fixture,
 int
 main (int argc, char *argv[])
 {
-  gint i;
+  gsize i;
   gchar *path;
 
   g_test_init (&argc, &argv, NULL);
@@ -1193,28 +1193,28 @@ main (int argc, char *argv[])
 
   for (i = 0; i < G_N_ELEMENTS (host_tests); i++)
     {
-      path = g_strdup_printf ("/network-address/parse-host/%d", i);
+      path = g_strdup_printf ("/network-address/parse-host/%" G_GSIZE_FORMAT, i);
       g_test_add_data_func (path, &host_tests[i], test_parse_host);
       g_free (path);
     }
 
   for (i = 0; i < G_N_ELEMENTS (uri_tests); i++)
     {
-      path = g_strdup_printf ("/network-address/parse-uri/%d", i);
+      path = g_strdup_printf ("/network-address/parse-uri/%" G_GSIZE_FORMAT, i);
       g_test_add_data_func (path, &uri_tests[i], test_parse_uri);
       g_free (path);
     }
 
   for (i = 0; i < G_N_ELEMENTS (address_tests); i++)
     {
-      path = g_strdup_printf ("/network-address/resolve-address/%d", i);
+      path = g_strdup_printf ("/network-address/resolve-address/%" G_GSIZE_FORMAT, i);
       g_test_add_data_func (path, &address_tests[i], test_resolve_address);
       g_free (path);
     }
 
   for (i = 0; i < G_N_ELEMENTS (address_tests); i++)
     {
-      path = g_strdup_printf ("/gresolver/resolve-address/%d", i);
+      path = g_strdup_printf ("/gresolver/resolve-address/%" G_GSIZE_FORMAT, i);
       g_test_add_data_func (path, &address_tests[i], test_resolve_address_gresolver);
       g_free (path);
     }


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