[glib: 2/4] Fix several signedness warnings in glib/tests/uri.c
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/4] Fix several signedness warnings in glib/tests/uri.c
- Date: Wed, 18 Nov 2020 11:54:00 +0000 (UTC)
commit e457df8b8b08ecfb4194f11886558539c3328b7f
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Sat Nov 14 14:26:47 2020 +0100
Fix several signedness warnings in glib/tests/uri.c
glib/tests/uri.c: In function ‘run_file_to_uri_tests’:
glib/tests/uri.c:172:17: error: comparison of integer expressions of different signedness: ‘int’ and
‘long unsigned int’
172 | for (i = 0; i < G_N_ELEMENTS (file_to_uri_tests); i++)
| ^
glib/tests/uri.c: In function ‘run_file_from_uri_tests’:
glib/tests/uri.c:197:17: error: comparison of integer expressions of different signedness: ‘int’ and
‘long unsigned int’
197 | for (i = 0; i < G_N_ELEMENTS (file_from_uri_tests); i++)
| ^
glib/tests/uri.c: In function ‘run_file_roundtrip_tests’:
glib/tests/uri.c:276:17: error: comparison of integer expressions of different signedness: ‘int’ and
‘long unsigned int’
276 | for (i = 0; i < G_N_ELEMENTS (file_to_uri_tests); i++)
| ^
glib/tests/uri.c: In function ‘test_uri_parse_params’:
glib/tests/uri.c:1594:25: error: comparison of integer expressions of different signedness: ‘gsize’ {aka
‘long unsigned int’} and ‘gssize’ {aka ‘const long int’}
1594 | for (j = 0; j < params_tests[i].expected_n_params; j += 2)
| ^
glib/tests/uri.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/uri.c b/glib/tests/uri.c
index b7c187dc4..d2ac498c3 100644
--- a/glib/tests/uri.c
+++ b/glib/tests/uri.c
@@ -165,7 +165,7 @@ file_from_uri_tests[] = {
static void
run_file_to_uri_tests (void)
{
- int i;
+ gsize i;
gchar *res;
GError *error;
@@ -189,7 +189,7 @@ run_file_to_uri_tests (void)
static void
run_file_from_uri_tests (void)
{
- int i;
+ gsize i;
gchar *res;
gchar *hostname;
GError *error;
@@ -269,7 +269,7 @@ safe_strcmp_hostname (const gchar *a, const gchar *b)
static void
run_file_roundtrip_tests (void)
{
- int i;
+ gsize i;
gchar *uri, *hostname, *res;
GError *error;
@@ -1591,7 +1591,7 @@ test_uri_parse_params (gconstpointer test_data)
g_assert_no_error (err);
g_assert_cmpint (g_hash_table_size (params), ==, params_tests[i].expected_n_params);
- for (j = 0; j < params_tests[i].expected_n_params; j += 2)
+ for (j = 0; j < (gsize) params_tests[i].expected_n_params; j += 2)
g_assert_cmpstr (g_hash_table_lookup (params, params_tests[i].expected_param_key_values[j]), ==,
params_tests[i].expected_param_key_values[j + 1]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]