Fixed compiling on Windows
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Oct 2017 01:32:12 -0700
changeset 800cc4aef7fef64
parent 799 82dcc7ce6d20
child 801 46acd70caa6a
Fixed compiling on Windows
effect_position.c
effect_stereoreverse.c
mixer.c
music_flac.c
music_mikmod.c
music_ogg.c
music_wav.c
     1.1 --- a/effect_position.c	Sat Oct 21 09:04:55 2017 +0300
     1.2 +++ b/effect_position.c	Sat Oct 21 01:32:12 2017 -0700
     1.3 @@ -1405,7 +1405,7 @@
     1.4          float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
     1.5          float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
     1.6          float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
     1.7 -		switch (args->room_angle) {
     1.8 +        switch (args->room_angle) {
     1.9          case 0:
    1.10                  *(ptr++) = swapl;
    1.11                  *(ptr++) = swapr;
    1.12 @@ -1430,7 +1430,7 @@
    1.13                  *(ptr++) = swaprr;
    1.14                  *(ptr++) = swapr;
    1.15              break;
    1.16 -		}
    1.17 +        }
    1.18      }
    1.19  }
    1.20  static void _Eff_position_f32sys_c6(int chan, void *stream, int len, void *udata)
     2.1 --- a/effect_stereoreverse.c	Sat Oct 21 09:04:55 2017 +0300
     2.2 +++ b/effect_stereoreverse.c	Sat Oct 21 01:32:12 2017 -0700
     2.3 @@ -59,13 +59,13 @@
     2.4  {
     2.5      /* 16 bits * 2 channels. */
     2.6      Uint32 *ptr = (Uint32 *) stream;
     2.7 -	Uint32 tmp;
     2.8 +    Uint32 tmp;
     2.9      int i;
    2.10  
    2.11      for (i = 0; i < len; i += 2 * sizeof (Uint32), ptr += 2) {
    2.12 -		tmp = ptr[0];
    2.13 -		ptr[0] = ptr[1];
    2.14 -		ptr[1] = tmp;
    2.15 +        tmp = ptr[0];
    2.16 +        ptr[0] = ptr[1];
    2.17 +        ptr[1] = tmp;
    2.18      }
    2.19  }
    2.20  
    2.21 @@ -111,18 +111,18 @@
    2.22      Mix_QuerySpec(NULL, &format, &channels);
    2.23  
    2.24      if (channels == 2) {
    2.25 -		int bits = (format & 0xFF);
    2.26 -		switch (bits) {
    2.27 -		case 8:
    2.28 +        int bits = (format & 0xFF);
    2.29 +        switch (bits) {
    2.30 +        case 8:
    2.31              f = _Eff_reversestereo8;
    2.32 -			break;
    2.33 -		case 16:
    2.34 +            break;
    2.35 +        case 16:
    2.36              f = _Eff_reversestereo16;
    2.37 -			break;
    2.38 -		case 32:
    2.39 +            break;
    2.40 +        case 32:
    2.41              f = _Eff_reversestereo32;
    2.42 -			break;
    2.43 -		default:
    2.44 +            break;
    2.45 +        default:
    2.46              Mix_SetError("Unsupported audio format");
    2.47              return(0);
    2.48          }
    2.49 @@ -133,9 +133,9 @@
    2.50              return(Mix_RegisterEffect(channel, f, NULL, NULL));
    2.51          }
    2.52      } else {
    2.53 -		Mix_SetError("Trying to reverse stereo on a non-stereo stream");
    2.54 -		return(0);
    2.55 -	}
    2.56 +        Mix_SetError("Trying to reverse stereo on a non-stereo stream");
    2.57 +        return(0);
    2.58 +    }
    2.59  
    2.60      return(1);
    2.61  }
     3.1 --- a/mixer.c	Sat Oct 21 09:04:55 2017 +0300
     3.2 +++ b/mixer.c	Sat Oct 21 01:32:12 2017 -0700
     3.3 @@ -592,7 +592,7 @@
     3.4  
     3.5      if (interface->Play) {
     3.6          interface->Play(music, 1);
     3.7 -	}
     3.8 +    }
     3.9      playing = SDL_TRUE;
    3.10  
    3.11      while (playing) {
     4.1 --- a/music_flac.c	Sat Oct 21 09:04:55 2017 +0300
     4.2 +++ b/music_flac.c	Sat Oct 21 01:32:12 2017 -0700
     4.3 @@ -250,7 +250,7 @@
     4.4  {
     4.5      FLAC_Music *music = (FLAC_Music *)client_data;
     4.6      Sint16 *data;
     4.7 -    int i, j, channels;
     4.8 +    unsigned int i, j, channels;
     4.9      int shift_amount = 0;
    4.10  
    4.11      if (!music->stream) {
     5.1 --- a/music_mikmod.c	Sat Oct 21 09:04:55 2017 +0300
     5.2 +++ b/music_mikmod.c	Sat Oct 21 01:32:12 2017 -0700
     5.3 @@ -247,7 +247,7 @@
     5.4  
     5.5  int LMM_Seek(struct MREADER *mr,long to,int dir)
     5.6  {
     5.7 -	Sint64 offset = to;
     5.8 +    Sint64 offset = to;
     5.9      LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
    5.10      if (dir == SEEK_SET) {
    5.11          offset += lmmmr->offset;
     6.1 --- a/music_ogg.c	Sat Oct 21 09:04:55 2017 +0300
     6.2 +++ b/music_ogg.c	Sat Oct 21 01:32:12 2017 -0700
     6.3 @@ -92,20 +92,13 @@
     6.4          FUNCTION_LOADER(ov_comment, vorbis_comment *(*)(OggVorbis_File *,int))
     6.5          FUNCTION_LOADER(ov_open_callbacks, int (*)(void *, OggVorbis_File *, const char *, long, ov_callbacks))
     6.6          FUNCTION_LOADER(ov_pcm_total, ogg_int64_t (*)(OggVorbis_File *,int))
     6.7 -        FUNCTION_LOADER(ov_read,
     6.8  #ifdef OGG_USE_TREMOR
     6.9 -            long (*)(OggVorbis_File *,char *,int,int *)
    6.10 +        FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int *))
    6.11 +        FUNCTION_LOADER(ov_time_seek, long (*)(OggVorbis_File *,ogg_int64_t))
    6.12  #else
    6.13 -            long (*)(OggVorbis_File *,char *,int,int,int,int,int *)
    6.14 +        FUNCTION_LOADER(ov_read, long (*)(OggVorbis_File *,char *,int,int,int,int,int *))
    6.15 +        FUNCTION_LOADER(ov_time_seek, int (*)(OggVorbis_File *,double))
    6.16  #endif
    6.17 -        )
    6.18 -        FUNCTION_LOADER(ov_time_seek,
    6.19 -#ifdef OGG_USE_TREMOR
    6.20 -            long (*)(OggVorbis_File *,ogg_int64_t)
    6.21 -#else
    6.22 -            int (*)(OggVorbis_File *,double)
    6.23 -#endif
    6.24 -        )
    6.25          FUNCTION_LOADER(ov_pcm_seek, int (*)(OggVorbis_File *,ogg_int64_t))
    6.26          FUNCTION_LOADER(ov_pcm_tell, ogg_int64_t (*)(OggVorbis_File *))
    6.27      }
    6.28 @@ -365,7 +358,7 @@
    6.29  
    6.30      pcmPos = vorbis.ov_pcm_tell(&music->vf);
    6.31      if ((music->loop == 1) && (pcmPos >= music->loop_end)) {
    6.32 -        amount -= ((pcmPos - music->loop_end) * music->channels) * (long)sizeof(Sint16);
    6.33 +        amount -= (int)((pcmPos - music->loop_end) * music->channels) * sizeof(Sint16);
    6.34          result = vorbis.ov_pcm_seek(&music->vf, music->loop_start);
    6.35          if (result < 0) {
    6.36              set_ov_error("ov_pcm_seek", result);
     7.1 --- a/music_wav.c	Sat Oct 21 09:04:55 2017 +0300
     7.2 +++ b/music_wav.c	Sat Oct 21 01:32:12 2017 -0700
     7.3 @@ -184,7 +184,10 @@
     7.4          loop->current_play_count = loop->initial_play_count;
     7.5      }
     7.6      music->play_count = play_count;
     7.7 -    return SDL_RWseek(music->src, music->start, RW_SEEK_SET);
     7.8 +    if (SDL_RWseek(music->src, music->start, RW_SEEK_SET) < 0) {
     7.9 +        return -1;
    7.10 +    }
    7.11 +    return 0;
    7.12  }
    7.13  
    7.14  /* Play some of a stream previously started with WAV_Play() */