Navigation Menu

Skip to content

Commit

Permalink
Fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 21, 2007
1 parent d8e586c commit 526a995
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
36 changes: 19 additions & 17 deletions effect_position.c
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}


Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions effects_internal.h
Expand Up @@ -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++ */
Expand Down
4 changes: 3 additions & 1 deletion mixer.c
Expand Up @@ -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)
Expand Down Expand Up @@ -262,13 +262,15 @@ 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),
(fmt->format&0x8000) ? "signed" : "unsigned",
(fmt->channels > 2) ? "surround" :
(fmt->channels > 1) ? "stereo" : "mono", fmt->freq);
}
#endif


/* Open the mixer with a certain desired audio format */
Expand Down

0 comments on commit 526a995

Please sign in to comment.