summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-11-08 21:40:43 +0100
committerEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-11-13 10:13:49 +0100
commit7ea05283acf5def437a576983c5920d34e9cbeb8 (patch)
tree011268ac64b7bdd0d074447f848f480018d60fea
parent24c60cee6c5de50b38c535e00e9741becf28c76c (diff)
downloadglib-7ea05283acf5def437a576983c5920d34e9cbeb8.tar.gz
Fix signedness warnings in glib/tests/markup-subparser.c
glib/tests/markup-subparser.c: In function ‘main’: glib/tests/markup-subparser.c:362:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ 362 | __add_tests_i < G_N_ELEMENTS (array); \ | ^ glib/tests/markup-subparser.c:378:3: note: in expansion of macro ‘add_tests’ 378 | add_tests (test, "/glib/markup/subparser/success", test_cases); | ^~~~~~~~~ glib/tests/markup-subparser.c:362:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ 362 | __add_tests_i < G_N_ELEMENTS (array); \ | ^ glib/tests/markup-subparser.c:379:3: note: in expansion of macro ‘add_tests’ 379 | add_tests (test, "/glib/markup/subparser/failure", error_cases); | ^~~~~~~~~
-rw-r--r--glib/tests/markup-subparser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/glib/tests/markup-subparser.c b/glib/tests/markup-subparser.c
index d1ceffb00..41eb06c14 100644
--- a/glib/tests/markup-subparser.c
+++ b/glib/tests/markup-subparser.c
@@ -356,7 +356,7 @@ TestCase error_cases[] = /* error cases */
#define add_tests(func, basename, array) \
G_STMT_START { \
- int __add_tests_i; \
+ gsize __add_tests_i; \
\
for (__add_tests_i = 0; \
__add_tests_i < G_N_ELEMENTS (array); \
@@ -364,7 +364,8 @@ TestCase error_cases[] = /* error cases */
{ \
char *testname; \
\
- testname = g_strdup_printf ("%s/%d", basename, __add_tests_i); \
+ testname = g_strdup_printf ("%s/%" G_GSIZE_FORMAT, \
+ basename, __add_tests_i); \
g_test_add_data_func (testname, &array[__add_tests_i], func); \
g_free (testname); \
} \