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);
      |   ^~~~~~~~~
This commit is contained in:
Emmanuel Fleury 2020-11-08 21:40:43 +01:00
parent 24c60cee6c
commit 7ea05283ac

View File

@ -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); \
} \