From acdf8aa622c56b4f939b964dda974e725be4db3d Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 25 Jan 2019 11:20:44 +0000 Subject: [PATCH] Fixed some mistakes Cppcheck pointed out --- src/Draw.cpp | 4 ++-- src/Ending.cpp | 2 +- src/Sound.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Draw.cpp b/src/Draw.cpp index 08592788..f240ffb9 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -316,7 +316,7 @@ void Surface2Surface(int x, int y, RECT *rect, int to, int from) //Target surface if (!surf[to].texture) { - printf("Tried to draw to surface %s, which doesn't exist\n", to); + printf("Tried to draw to surface %d, which doesn't exist\n", to); return; } @@ -350,7 +350,7 @@ void CortBox2(RECT *rect, uint32_t col, int surf_no) //Target surface if (!surf[surf_no].texture) { - printf("Tried to draw a rectangle to surface %s, which doesn't exist\n", surf_no); + printf("Tried to draw a rectangle to surface %d, which doesn't exist\n", surf_no); return; } diff --git a/src/Ending.cpp b/src/Ending.cpp index 05c70be9..2be53f6b 100644 --- a/src/Ending.cpp +++ b/src/Ending.cpp @@ -123,7 +123,7 @@ void PutIllust() void ReloadIllust(int a) { char name[16]; - sprintf(name, "CREDIT%02ld", a); + sprintf(name, "CREDIT%02d", a); ReloadBitmap_Resource(name, SURFACE_ID_CREDITS_IMAGE); } diff --git a/src/Sound.cpp b/src/Sound.cpp index 3b403a10..e5763a9b 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -31,6 +31,7 @@ SOUNDBUFFER::SOUNDBUFFER(size_t bufSize) playing = false; looping = false; + looped = false; frequency = 0.0; volume = 1.0; @@ -274,7 +275,7 @@ bool InitDirectSound() uint8_t *buf = nullptr; size_t len; - for (size_t n = 0; n < SOUND_NO; n++) + for (unsigned int n = 0; n < SOUND_NO; n++) { sprintf(path, "%2.2X.pxt", n);