Also patched to compile on C89 compilers.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 05 Nov 2016 03:56:55 -0400
changeset 10577eb503d320787
parent 10576 4f6ab0d2cc3b
child 10578 131cefc2d86d
Also patched to compile on C89 compilers.
src/audio/SDL_audiocvt.c
     1.1 --- a/src/audio/SDL_audiocvt.c	Sat Nov 05 03:53:59 2016 -0400
     1.2 +++ b/src/audio/SDL_audiocvt.c	Sat Nov 05 03:56:55 2016 -0400
     1.3 @@ -295,6 +295,8 @@
     1.4      int retval = 0;  /* 0 == no conversion necessary. */
     1.5  
     1.6      if (!SDL_AUDIO_ISFLOAT(dst_fmt)) {
     1.7 +        const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt);
     1.8 +        const Uint16 src_bitsize = 32;
     1.9          SDL_AudioFilter filter = NULL;
    1.10          switch (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN) {
    1.11              case AUDIO_S8: filter = SDL_Convert_F32_to_S8; break;
    1.12 @@ -308,8 +310,6 @@
    1.13              return SDL_SetError("No conversion available for these formats");
    1.14          }
    1.15  
    1.16 -        const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt);
    1.17 -        const Uint16 src_bitsize = 32;
    1.18          cvt->filters[cvt->filter_index++] = filter;
    1.19          if (src_bitsize < dst_bitsize) {
    1.20              const int mult = (dst_bitsize / src_bitsize);