src/audio/SDL_audiocvt.c
changeset 2049 5f6550e5184f
parent 2042 3908e1f808e1
child 2078 f932ac47a331
     1.1 --- a/src/audio/SDL_audiocvt.c	Sun Oct 01 16:10:41 2006 +0000
     1.2 +++ b/src/audio/SDL_audiocvt.c	Tue Oct 17 09:15:21 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          }