Fixed some mistakes Cppcheck pointed out

This commit is contained in:
Clownacy 2019-01-25 11:20:44 +00:00
parent b734bed63f
commit acdf8aa622
3 changed files with 5 additions and 4 deletions

View file

@ -316,7 +316,7 @@ void Surface2Surface(int x, int y, RECT *rect, int to, int from)
//Target surface //Target surface
if (!surf[to].texture) 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; return;
} }
@ -350,7 +350,7 @@ void CortBox2(RECT *rect, uint32_t col, int surf_no)
//Target surface //Target surface
if (!surf[surf_no].texture) 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; return;
} }

View file

@ -123,7 +123,7 @@ void PutIllust()
void ReloadIllust(int a) void ReloadIllust(int a)
{ {
char name[16]; char name[16];
sprintf(name, "CREDIT%02ld", a); sprintf(name, "CREDIT%02d", a);
ReloadBitmap_Resource(name, SURFACE_ID_CREDITS_IMAGE); ReloadBitmap_Resource(name, SURFACE_ID_CREDITS_IMAGE);
} }

View file

@ -31,6 +31,7 @@ SOUNDBUFFER::SOUNDBUFFER(size_t bufSize)
playing = false; playing = false;
looping = false; looping = false;
looped = false;
frequency = 0.0; frequency = 0.0;
volume = 1.0; volume = 1.0;
@ -274,7 +275,7 @@ bool InitDirectSound()
uint8_t *buf = nullptr; uint8_t *buf = nullptr;
size_t len; 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); sprintf(path, "%2.2X.pxt", n);