Fixed compiler warnings
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Jul 2007 06:37:58 +0000
changeset 3736271eafc6e70
parent 372 4bc4ba77f1a1
child 374 9f79d3a5eda1
Fixed compiler warnings
effect_position.c
effects_internal.h
mixer.c
     1.1 --- a/effect_position.c	Sat Jul 21 05:54:10 2007 +0000
     1.2 +++ b/effect_position.c	Sat Jul 21 06:37:58 2007 +0000
     1.3 @@ -387,16 +387,17 @@
     1.4  
     1.5      for (i = 0; i < len; i += sizeof (Uint32)) {
     1.6  #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
     1.7 -        *(p++) = (d[l[(*p & 0xFF000000) >> 24]] << 24) |
     1.8 -                 (d[r[(*p & 0x00FF0000) >> 16]] << 16) |
     1.9 -                 (d[l[(*p & 0x0000FF00) >>  8]] <<  8) |
    1.10 -                 (d[r[(*p & 0x000000FF)      ]]      ) ;
    1.11 +        *p = (d[l[(*p & 0xFF000000) >> 24]] << 24) |
    1.12 +             (d[r[(*p & 0x00FF0000) >> 16]] << 16) |
    1.13 +             (d[l[(*p & 0x0000FF00) >>  8]] <<  8) |
    1.14 +             (d[r[(*p & 0x000000FF)      ]]      ) ;
    1.15  #else
    1.16 -        *(p++) = (d[r[(*p & 0xFF000000) >> 24]] << 24) |
    1.17 -                 (d[l[(*p & 0x00FF0000) >> 16]] << 16) |
    1.18 -                 (d[r[(*p & 0x0000FF00) >>  8]] <<  8) |
    1.19 -                 (d[l[(*p & 0x000000FF)      ]]      ) ;
    1.20 +        *p = (d[r[(*p & 0xFF000000) >> 24]] << 24) |
    1.21 +             (d[l[(*p & 0x00FF0000) >> 16]] << 16) |
    1.22 +             (d[r[(*p & 0x0000FF00) >>  8]] <<  8) |
    1.23 +             (d[l[(*p & 0x000000FF)      ]]      ) ;
    1.24  #endif
    1.25 +        ++p;
    1.26      }
    1.27  }
    1.28  
    1.29 @@ -577,16 +578,17 @@
    1.30  
    1.31      for (i = 0; i < len; i += sizeof (Uint32)) {
    1.32  #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
    1.33 -        *(p++) = (d[l[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
    1.34 -                 (d[r[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
    1.35 -                 (d[l[((Sint16)(Sint8)((*p & 0x0000FF00) >>  8))+128]] <<  8) |
    1.36 -                 (d[r[((Sint16)(Sint8)((*p & 0x000000FF)      ))+128]]      ) ;
    1.37 +        *p = (d[l[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
    1.38 +             (d[r[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
    1.39 +             (d[l[((Sint16)(Sint8)((*p & 0x0000FF00) >>  8))+128]] <<  8) |
    1.40 +             (d[r[((Sint16)(Sint8)((*p & 0x000000FF)      ))+128]]      ) ;
    1.41  #else
    1.42 -        *(p++) = (d[r[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
    1.43 -                 (d[l[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
    1.44 -                 (d[r[((Sint16)(Sint8)((*p & 0x0000FF00) >>  8))+128]] <<  8) |
    1.45 -                 (d[l[((Sint16)(Sint8)((*p & 0x000000FF)      ))+128]]      ) ;
    1.46 +        *p = (d[r[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) |
    1.47 +             (d[l[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) |
    1.48 +             (d[r[((Sint16)(Sint8)((*p & 0x0000FF00) >>  8))+128]] <<  8) |
    1.49 +             (d[l[((Sint16)(Sint8)((*p & 0x000000FF)      ))+128]]      ) ;
    1.50  #endif
    1.51 +        ++p;
    1.52      }
    1.53  
    1.54  
    1.55 @@ -1519,7 +1521,7 @@
    1.56      Uint16 format;
    1.57      int channels;
    1.58      position_args *args = NULL;
    1.59 -    Sint16 room_angle;
    1.60 +    Sint16 room_angle = 0;
    1.61  
    1.62      Mix_QuerySpec(NULL, &format, &channels);
    1.63      f = get_position_effect_func(format, channels);
     2.1 --- a/effects_internal.h	Sat Jul 21 05:54:10 2007 +0000
     2.2 +++ b/effects_internal.h	Sat Jul 21 06:37:58 2007 +0000
     2.3 @@ -41,6 +41,8 @@
     2.4  void *_Eff_build_volume_table_u8(void);
     2.5  void *_Eff_build_volume_table_s8(void);
     2.6  
     2.7 +void _Mix_InitEffects(void);
     2.8 +void _Mix_DeinitEffects(void);
     2.9  void _Eff_PositionDeinit(void);
    2.10  
    2.11  /* Set up for C function definitions, even when using C++ */
     3.1 --- a/mixer.c	Sat Jul 21 05:54:10 2007 +0000
     3.2 +++ b/mixer.c	Sat Jul 21 06:37:58 2007 +0000
     3.3 @@ -158,7 +158,7 @@
     3.4  static void mix_channels(void *udata, Uint8 *stream, int len)
     3.5  {
     3.6  	Uint8 *mix_input;
     3.7 -	int i, mixable, volume;
     3.8 +	int i, mixable, volume = SDL_MIX_MAXVOLUME;
     3.9  	Uint32 sdl_ticks;
    3.10  
    3.11  #if SDL_VERSION_ATLEAST(1, 3, 0)
    3.12 @@ -262,6 +262,7 @@
    3.13  	}
    3.14  }
    3.15  
    3.16 +#if 0
    3.17  static void PrintFormat(char *title, SDL_AudioSpec *fmt)
    3.18  {
    3.19  	printf("%s: %d bit %s audio (%s) at %u Hz\n", title, (fmt->format&0xFF),
    3.20 @@ -269,6 +270,7 @@
    3.21  			(fmt->channels > 2) ? "surround" :
    3.22  			(fmt->channels > 1) ? "stereo" : "mono", fmt->freq);
    3.23  }
    3.24 +#endif
    3.25  
    3.26  
    3.27  /* Open the mixer with a certain desired audio format */