From 526a995aef7b61d117c64fc8001505056486983e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 21 Jul 2007 06:37:58 +0000 Subject: [PATCH] Fixed compiler warnings --- effect_position.c | 36 +++++++++++++++++++----------------- effects_internal.h | 2 ++ mixer.c | 4 +++- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/effect_position.c b/effect_position.c index 23deed83..d5f4237f 100644 --- a/effect_position.c +++ b/effect_position.c @@ -387,16 +387,17 @@ static void _Eff_position_table_u8(int chan, void *stream, int len, void *udata) for (i = 0; i < len; i += sizeof (Uint32)) { #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - *(p++) = (d[l[(*p & 0xFF000000) >> 24]] << 24) | - (d[r[(*p & 0x00FF0000) >> 16]] << 16) | - (d[l[(*p & 0x0000FF00) >> 8]] << 8) | - (d[r[(*p & 0x000000FF) ]] ) ; + *p = (d[l[(*p & 0xFF000000) >> 24]] << 24) | + (d[r[(*p & 0x00FF0000) >> 16]] << 16) | + (d[l[(*p & 0x0000FF00) >> 8]] << 8) | + (d[r[(*p & 0x000000FF) ]] ) ; #else - *(p++) = (d[r[(*p & 0xFF000000) >> 24]] << 24) | - (d[l[(*p & 0x00FF0000) >> 16]] << 16) | - (d[r[(*p & 0x0000FF00) >> 8]] << 8) | - (d[l[(*p & 0x000000FF) ]] ) ; + *p = (d[r[(*p & 0xFF000000) >> 24]] << 24) | + (d[l[(*p & 0x00FF0000) >> 16]] << 16) | + (d[r[(*p & 0x0000FF00) >> 8]] << 8) | + (d[l[(*p & 0x000000FF) ]] ) ; #endif + ++p; } } @@ -577,16 +578,17 @@ static void _Eff_position_table_s8(int chan, void *stream, int len, void *udata) for (i = 0; i < len; i += sizeof (Uint32)) { #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - *(p++) = (d[l[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) | - (d[r[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) | - (d[l[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) | - (d[r[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ; + *p = (d[l[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) | + (d[r[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) | + (d[l[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) | + (d[r[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ; #else - *(p++) = (d[r[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) | - (d[l[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) | - (d[r[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) | - (d[l[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ; + *p = (d[r[((Sint16)(Sint8)((*p & 0xFF000000) >> 24))+128]] << 24) | + (d[l[((Sint16)(Sint8)((*p & 0x00FF0000) >> 16))+128]] << 16) | + (d[r[((Sint16)(Sint8)((*p & 0x0000FF00) >> 8))+128]] << 8) | + (d[l[((Sint16)(Sint8)((*p & 0x000000FF) ))+128]] ) ; #endif + ++p; } @@ -1519,7 +1521,7 @@ int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance) Uint16 format; int channels; position_args *args = NULL; - Sint16 room_angle; + Sint16 room_angle = 0; Mix_QuerySpec(NULL, &format, &channels); f = get_position_effect_func(format, channels); diff --git a/effects_internal.h b/effects_internal.h index fe5fe464..8bbaa304 100644 --- a/effects_internal.h +++ b/effects_internal.h @@ -41,6 +41,8 @@ extern void *_Eff_volume_table; void *_Eff_build_volume_table_u8(void); void *_Eff_build_volume_table_s8(void); +void _Mix_InitEffects(void); +void _Mix_DeinitEffects(void); void _Eff_PositionDeinit(void); /* Set up for C function definitions, even when using C++ */ diff --git a/mixer.c b/mixer.c index de4073dc..73e6eb9f 100644 --- a/mixer.c +++ b/mixer.c @@ -158,7 +158,7 @@ static void *Mix_DoEffects(int chan, void *snd, int len) static void mix_channels(void *udata, Uint8 *stream, int len) { Uint8 *mix_input; - int i, mixable, volume; + int i, mixable, volume = SDL_MIX_MAXVOLUME; Uint32 sdl_ticks; #if SDL_VERSION_ATLEAST(1, 3, 0) @@ -262,6 +262,7 @@ static void mix_channels(void *udata, Uint8 *stream, int len) } } +#if 0 static void PrintFormat(char *title, SDL_AudioSpec *fmt) { printf("%s: %d bit %s audio (%s) at %u Hz\n", title, (fmt->format&0xFF), @@ -269,6 +270,7 @@ static void PrintFormat(char *title, SDL_AudioSpec *fmt) (fmt->channels > 2) ? "surround" : (fmt->channels > 1) ? "stereo" : "mono", fmt->freq); } +#endif /* Open the mixer with a certain desired audio format */