Fixed build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 49abe1d..3d0e22e 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -722,7 +722,7 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format
int paddingsamples;
float *padding;
- if (requestedpadding < INT32_MAX / chans) {
+ if (requestedpadding < SDL_MAX_SINT32 / chans) {
paddingsamples = requestedpadding * chans;
} else {
paddingsamples = 0;
@@ -899,9 +899,9 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
return SDL_SetError("Source rate is equal to or less than zero");
} else if (dst_rate <= 0) {
return SDL_SetError("Destination rate is equal to or less than zero");
- } else if (src_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
+ } else if (src_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
return SDL_SetError("Source rate is too high");
- } else if (dst_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
+ } else if (dst_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
return SDL_SetError("Destination rate is too high");
}
diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c
index 5c3b964..ac2dfc1 100644
--- a/src/audio/SDL_wave.c
+++ b/src/audio/SDL_wave.c
@@ -641,7 +641,9 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
size_t bytesleft, outputsize;
WaveChunk *chunk = &file->chunk;
ADPCM_DecoderState state = {0};
- MS_ADPCM_ChannelState cstate[2] = {0};
+ MS_ADPCM_ChannelState cstate[2];
+
+ SDL_memset(cstate, 0, sizeof(cstate));
if (chunk->size != chunk->length) {
/* Could not read everything. Recalculate number of sample frames. */
@@ -2075,7 +2077,9 @@ SDL_AudioSpec *
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
{
int result;
- WaveFile file = {0};
+ WaveFile file;
+
+ SDL_zero(file);
/* Make sure we are passed a valid data source */
if (src == NULL) {