Patched to build on pre-C99 compilers. SDL-ryan-multiple-audio-device
authorRyan C. Gordon <icculus@icculus.org>
Sun, 08 Oct 2006 00:05:22 +0000
branchSDL-ryan-multiple-audio-device
changeset 383584aa539627c8
parent 3834 93326d2ceedb
child 3836 7dc7327cd626
Patched to build on pre-C99 compilers.
src/audio/SDL_audiocvt.c
     1.1 --- a/src/audio/SDL_audiocvt.c	Sun Oct 08 00:01:16 2006 +0000
     1.2 +++ b/src/audio/SDL_audiocvt.c	Sun Oct 08 00:05:22 2006 +0000
     1.3 @@ -159,21 +159,19 @@
     1.4              float *dst = (float *) cvt->buf;
     1.5              if (SDL_AUDIO_ISBIGENDIAN(format)) {
     1.6                  for (i = cvt->len_cvt / 8; i; --i, src += 2) {
     1.7 -                    float src1, src2;
     1.8 -                    src1 = SDL_SwapFloatBE(src[0]);
     1.9 -                    src2 = SDL_SwapFloatBE(src[1]);
    1.10 +                    const float src1 = SDL_SwapFloatBE(src[0]);
    1.11 +                    const float src2 = SDL_SwapFloatBE(src[1]);
    1.12                      const double added = ((double) src1) + ((double) src2);
    1.13 -                    src1 = (float) (added * 0.5);
    1.14 -                    *(dst++) = SDL_SwapFloatBE(src1);
    1.15 +                    const float halved = (float) (added * 0.5);
    1.16 +                    *(dst++) = SDL_SwapFloatBE(halved);
    1.17                  }
    1.18              } else {
    1.19                  for (i = cvt->len_cvt / 8; i; --i, src += 2) {
    1.20 -                    float src1, src2;
    1.21 -                    src1 = SDL_SwapFloatLE(src[0]);
    1.22 -                    src2 = SDL_SwapFloatLE(src[1]);
    1.23 +                    const float src1 = SDL_SwapFloatLE(src[0]);
    1.24 +                    const float src2 = SDL_SwapFloatLE(src[1]);
    1.25                      const double added = ((double) src1) + ((double) src2);
    1.26 -                    src1 = (float) (added * 0.5);
    1.27 -                    *(dst++) = SDL_SwapFloatLE(src1);
    1.28 +                    const float halved = (float) (added * 0.5);
    1.29 +                    *(dst++) = SDL_SwapFloatLE(halved);
    1.30                  }
    1.31              }
    1.32          }