Skip to content

Commit

Permalink
Fixed compiling on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 21, 2017
1 parent 8315bab commit 1a207a6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions effect_position.c
Expand Up @@ -1405,7 +1405,7 @@ static void _Eff_position_f32sys_c4(int chan, void *stream, int len, void *udata
float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
switch (args->room_angle) {
switch (args->room_angle) {
case 0:
*(ptr++) = swapl;
*(ptr++) = swapr;
Expand All @@ -1430,7 +1430,7 @@ static void _Eff_position_f32sys_c4(int chan, void *stream, int len, void *udata
*(ptr++) = swaprr;
*(ptr++) = swapr;
break;
}
}
}
}
static void _Eff_position_f32sys_c6(int chan, void *stream, int len, void *udata)
Expand Down
32 changes: 16 additions & 16 deletions effect_stereoreverse.c
Expand Up @@ -59,13 +59,13 @@ static void _Eff_reversestereo32(int chan, void *stream, int len, void *udata)
{
/* 16 bits * 2 channels. */
Uint32 *ptr = (Uint32 *) stream;
Uint32 tmp;
Uint32 tmp;
int i;

for (i = 0; i < len; i += 2 * sizeof (Uint32), ptr += 2) {
tmp = ptr[0];
ptr[0] = ptr[1];
ptr[1] = tmp;
tmp = ptr[0];
ptr[0] = ptr[1];
ptr[1] = tmp;
}
}

Expand Down Expand Up @@ -111,18 +111,18 @@ int Mix_SetReverseStereo(int channel, int flip)
Mix_QuerySpec(NULL, &format, &channels);

if (channels == 2) {
int bits = (format & 0xFF);
switch (bits) {
case 8:
int bits = (format & 0xFF);
switch (bits) {
case 8:
f = _Eff_reversestereo8;
break;
case 16:
break;
case 16:
f = _Eff_reversestereo16;
break;
case 32:
break;
case 32:
f = _Eff_reversestereo32;
break;
default:
break;
default:
Mix_SetError("Unsupported audio format");
return(0);
}
Expand All @@ -133,9 +133,9 @@ int Mix_SetReverseStereo(int channel, int flip)
return(Mix_RegisterEffect(channel, f, NULL, NULL));
}
} else {
Mix_SetError("Trying to reverse stereo on a non-stereo stream");
return(0);
}
Mix_SetError("Trying to reverse stereo on a non-stereo stream");
return(0);
}

return(1);
}
Expand Down
2 changes: 1 addition & 1 deletion mixer.c
Expand Up @@ -592,7 +592,7 @@ static SDL_AudioSpec *Mix_LoadMusic_RW(Mix_MusicType music_type, SDL_RWops *src,

if (interface->Play) {
interface->Play(music, 1);
}
}
playing = SDL_TRUE;

while (playing) {
Expand Down
2 changes: 1 addition & 1 deletion music_flac.c
Expand Up @@ -250,7 +250,7 @@ static FLAC__StreamDecoderWriteStatus flac_write_music_cb(
{
FLAC_Music *music = (FLAC_Music *)client_data;
Sint16 *data;
int i, j, channels;
unsigned int i, j, channels;
int shift_amount = 0;

if (!music->stream) {
Expand Down
2 changes: 1 addition & 1 deletion music_mikmod.c
Expand Up @@ -247,7 +247,7 @@ typedef struct

int LMM_Seek(struct MREADER *mr,long to,int dir)
{
Sint64 offset = to;
Sint64 offset = to;
LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
if (dir == SEEK_SET) {
offset += lmmmr->offset;
Expand Down
17 changes: 5 additions & 12 deletions music_ogg.c
Expand Up @@ -92,20 +92,13 @@ static int OGG_Load(void)
FUNCTION_LOADER(ov_comment, vorbis_comment *(*)(OggVorbis_File *,int))
FUNCTION_LOADER(ov_open_callbacks, int (*)(void *, OggVorbis_File *, const char *, long, ov_callbacks))
FUNCTION_LOADER(ov_pcm_total, ogg_int64_t (*)(OggVorbis_File *,int))
FUNCTION_LOADER(ov_read,
#ifdef OGG_USE_TREMOR
long (*)(OggVorbis_File *,char *,int,int *)
FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int *))
FUNCTION_LOADER(ov_time_seek, long (*)(OggVorbis_File *,ogg_int64_t))
#else
long (*)(OggVorbis_File *,char *,int,int,int,int,int *)
FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int,int,int,int *))
FUNCTION_LOADER(ov_time_seek, int (*)(OggVorbis_File *,double))
#endif
)
FUNCTION_LOADER(ov_time_seek,
#ifdef OGG_USE_TREMOR
long (*)(OggVorbis_File *,ogg_int64_t)
#else
int (*)(OggVorbis_File *,double)
#endif
)
FUNCTION_LOADER(ov_pcm_seek, int (*)(OggVorbis_File *,ogg_int64_t))
FUNCTION_LOADER(ov_pcm_tell, ogg_int64_t (*)(OggVorbis_File *))
}
Expand Down Expand Up @@ -365,7 +358,7 @@ static int OGG_GetSome(void *context, void *data, int bytes, SDL_bool *done)

pcmPos = vorbis.ov_pcm_tell(&music->vf);
if ((music->loop == 1) && (pcmPos >= music->loop_end)) {
amount -= ((pcmPos - music->loop_end) * music->channels) * (long)sizeof(Sint16);
amount -= (int)((pcmPos - music->loop_end) * music->channels) * sizeof(Sint16);
result = vorbis.ov_pcm_seek(&music->vf, music->loop_start);
if (result < 0) {
set_ov_error("ov_pcm_seek", result);
Expand Down
5 changes: 4 additions & 1 deletion music_wav.c
Expand Up @@ -184,7 +184,10 @@ static int WAV_Play(void *context, int play_count)
loop->current_play_count = loop->initial_play_count;
}
music->play_count = play_count;
return SDL_RWseek(music->src, music->start, RW_SEEK_SET);
if (SDL_RWseek(music->src, music->start, RW_SEEK_SET) < 0) {
return -1;
}
return 0;
}

/* Play some of a stream previously started with WAV_Play() */
Expand Down

0 comments on commit 1a207a6

Please sign in to comment.