Fix some format specifier warnings

The warnings were produced by GCC 9.2.x for x86_64-linux-gnu or
i386-pc-msdosdjgpp targets.

Most of the fixes involve changing the type of a variable rather than
the format specifier. For many of the affected test conuter variables,
a basic int seems sufficient.

Some format specifier warnings still remain for cases where changing
type or casting seemed inappropriate. Those warnings will probably
require some new format specifier macros (e.g. SDL_PRIu32).
This commit is contained in:
Jay Petacat
2020-03-25 01:34:15 -04:00
parent dad73b1f0c
commit c760c02c6c
5 changed files with 16 additions and 16 deletions

View File

@@ -36,10 +36,10 @@
#define SDLTEST_ASSERT_SUMMARY_FORMAT "Assert Summary: Total=%d Passed=%d Failed=%d"
/* ! \brief counts the failed asserts */
static Uint32 SDLTest_AssertsFailed = 0;
static int SDLTest_AssertsFailed = 0;
/* ! \brief counts the passed asserts */
static Uint32 SDLTest_AssertsPassed = 0;
static int SDLTest_AssertsPassed = 0;
/*
* Assert that logs and break execution flow on failures (i.e. for harness errors).
@@ -122,7 +122,7 @@ void SDLTest_ResetAssertSummary()
*/
void SDLTest_LogAssertSummary()
{
Uint32 totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed;
int totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed;
if (SDLTest_AssertsFailed == 0)
{
SDLTest_Log(SDLTEST_ASSERT_SUMMARY_FORMAT, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed);