[glib: 4/8] Fix signedness warnings in glib/tests/shell.c
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 4/8] Fix signedness warnings in glib/tests/shell.c
- Date: Tue, 17 Nov 2020 17:20:02 +0000 (UTC)
commit 82be350f59186df23128fe8ebca4ce80f7a7afc7
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Sat Nov 14 13:21:11 2020 +0100
Fix signedness warnings in glib/tests/shell.c
glib/tests/shell.c: In function ‘main’:
glib/tests/shell.c:194:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka
‘int’} and ‘long unsigned int’
194 | for (i = 0; i < G_N_ELEMENTS (cmdline_tests); i++)
| ^
glib/tests/shell.c:201:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka
‘int’} and ‘long unsigned int’
201 | for (i = 0; i < G_N_ELEMENTS (quote_tests); i++)
| ^
glib/tests/shell.c:208:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka
‘int’} and ‘long unsigned int’
208 | for (i = 0; i < G_N_ELEMENTS (unquote_tests); i++)
| ^
glib/tests/shell.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/shell.c b/glib/tests/shell.c
index 1ed356e15..5cde37119 100644
--- a/glib/tests/shell.c
+++ b/glib/tests/shell.c
@@ -186,28 +186,28 @@ do_unquote_test (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 (cmdline_tests); i++)
{
- path = g_strdup_printf ("/shell/cmdline/%d", i);
+ path = g_strdup_printf ("/shell/cmdline/%" G_GSIZE_FORMAT, i);
g_test_add_data_func (path, &cmdline_tests[i], do_cmdline_test);
g_free (path);
}
for (i = 0; i < G_N_ELEMENTS (quote_tests); i++)
{
- path = g_strdup_printf ("/shell/quote/%d", i);
+ path = g_strdup_printf ("/shell/quote/%" G_GSIZE_FORMAT, i);
g_test_add_data_func (path, "e_tests[i], do_quote_test);
g_free (path);
}
for (i = 0; i < G_N_ELEMENTS (unquote_tests); i++)
{
- path = g_strdup_printf ("/shell/unquote/%d", i);
+ path = g_strdup_printf ("/shell/unquote/%" G_GSIZE_FORMAT, i);
g_test_add_data_func (path, &unquote_tests[i], do_unquote_test);
g_free (path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]