Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Compile with -Wpedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
cyxx committed Jun 28, 2018
1 parent 52d201a commit 7e93af7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -4,7 +4,7 @@ SDL_LIBS = `sdl2-config --libs` -lSDL2_mixer -lGL

DEFINES = -DBYPASS_PROTECTION

CXXFLAGS := -g -O -MMD -Wall $(SDL_CFLAGS) $(DEFINES)
CXXFLAGS := -g -O -MMD -Wall -Wpedantic $(SDL_CFLAGS) $(DEFINES)

SRCS = aifcplayer.cpp bitmap.cpp file.cpp engine.cpp graphics_gl.cpp graphics_soft.cpp \
script.cpp mixer.cpp pak.cpp resource.cpp resource_mac.cpp resource_nth.cpp \
Expand Down
4 changes: 2 additions & 2 deletions mixer.cpp
Expand Up @@ -172,8 +172,8 @@ struct Mixer_impl {

static void mixSfxPlayer(void *data, uint8_t *s16buf, int len) {
len /= 2;
int8_t s8buf[len];
memset(s8buf, 0, sizeof(s8buf));
int8_t *s8buf = (int8_t *)alloca(len);
memset(s8buf, 0, len);
((SfxPlayer *)data)->readSamples(s8buf, len / 2);
for (int i = 0; i < len; ++i) {
*(int16_t *)&s16buf[i * 2] = 256 * (int16_t)s8buf[i];
Expand Down
2 changes: 1 addition & 1 deletion sfxplayer.cpp
Expand Up @@ -143,7 +143,7 @@ void SfxPlayer::readSamples(int8_t *buf, int len) {
if (_delay == 0) {
memset(buf, 0, len * 2);
} else {
int8_t bufin[len * 2];
int8_t *bufin = (int8_t *)alloca(len * 2);
mixSamples(bufin, len);
nr(bufin, len, buf);
}
Expand Down

0 comments on commit 7e93af7

Please sign in to comment.