From 8d0263a088734c80e5c1fdd959933d615745396f Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 28 May 2015 18:02:26 +0200 Subject: [PATCH] tests: fix conformance to C90 --- tests/test_internal.c | 4 +++- tests/test_stl_io.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_internal.c b/tests/test_internal.c index ac23d2a..63288d2 100644 --- a/tests/test_internal.c +++ b/tests/test_internal.c @@ -203,12 +203,14 @@ const char* test_internal__string_parse() const char* test_internal__string_utils() { + char c; /* for loop counter */ + UTEST_ASSERT(gmio_clocale_isspace(' ')); UTEST_ASSERT(gmio_clocale_isspace('\t')); UTEST_ASSERT(gmio_clocale_isspace('\n')); UTEST_ASSERT(gmio_clocale_isspace('\r')); - for (char c = 0; c >= 0 && c <= 127; ++c) { + for (c = 0; c >= 0 && c <= 127; ++c) { if (65 <= c && c <= 90) { UTEST_ASSERT(gmio_clocale_isupper(c)); } diff --git a/tests/test_stl_io.c b/tests/test_stl_io.c index 8db07bd..67678f3 100644 --- a/tests/test_stl_io.c +++ b/tests/test_stl_io.c @@ -25,6 +25,9 @@ static void add_triangle( void* cookie, uint32_t tri_id, const gmio_stl_triangle_t* triangle) { + GMIO_UNUSED(cookie); + GMIO_UNUSED(tri_id); + GMIO_UNUSED(triangle); } struct filepath_errorcode @@ -49,11 +52,12 @@ const char* test_stl_read() }; const size_t expected_count = sizeof(expected) / sizeof(filepath_errorcode_t); + size_t i; /* for loop counter */ gmio_stl_mesh_creator_t meshc = {0}; meshc.add_triangle_func = &add_triangle; - for (size_t i = 0; i < expected_count; ++i) { + for (i = 0; i < expected_count; ++i) { const int err = gmio_stl_read_file(expected[i].filepath, &meshc, NULL); if (err != expected[i].errorcode) { printf("\nfilepath : %s\n"