mirror of
https://github.com/thepigeongenerator/sdl_template.git
synced 2025-12-17 05:55:47 +01:00
update build system to provide more warnings
This commit is contained in:
2
makefile
2
makefile
@@ -4,7 +4,7 @@ NAME = sdl_template
|
|||||||
CC := clang
|
CC := clang
|
||||||
STD := c17
|
STD := c17
|
||||||
LANG = c
|
LANG = c
|
||||||
CFLAGS := $(shell pkg-config --cflags sdl2) -Wall -g -pedantic
|
CFLAGS := $(shell pkg-config --cflags sdl2) -O3 -g -Wall -Wall -Wextra -Wpedantic -Wno-pointer-arith
|
||||||
LDFLAGS := $(shell pkg-config --libs sdl2) -lm
|
LDFLAGS := $(shell pkg-config --libs sdl2) -lm
|
||||||
|
|
||||||
# dirs
|
# dirs
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ static void audio_mixer(void* userdata, uint8_t* stream, int32_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the length of which we shall be mixing
|
// get the length of which we shall be mixing
|
||||||
uint32_t mix_length = SDL_min(audio[i].length, len);
|
uint32_t mix_length = SDL_min(audio[i].length, (uint32_t)len);
|
||||||
|
|
||||||
// mix the audio with the stream
|
// mix the audio with the stream
|
||||||
SDL_MixAudioFormat(stream, audio[i].buffer, device->format, mix_length, SDL_MIX_MAXVOLUME);
|
SDL_MixAudioFormat(stream, audio[i].buffer, device->format, mix_length, SDL_MIX_MAXVOLUME);
|
||||||
@@ -78,7 +78,7 @@ AudioDevice* audio_device_init(const int32_t freq, const SDL_AudioFormat format,
|
|||||||
AudioDevice* audio_device = malloc(sizeof(AudioDevice));
|
AudioDevice* audio_device = malloc(sizeof(AudioDevice));
|
||||||
|
|
||||||
// define the audio specification
|
// define the audio specification
|
||||||
SDL_AudioSpec spec = {freq, format, channels, samples};
|
SDL_AudioSpec spec = {freq, format, channels, 0, samples, 0, 0, NULL, NULL};
|
||||||
spec.callback = audio_mixer;
|
spec.callback = audio_mixer;
|
||||||
spec.userdata = audio_device;
|
spec.userdata = audio_device;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user