Mercurial > sdl-ios-xcode
diff src/audio/SDL_audiocvt.c @ 2049:5f6550e5184f
Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 17 Oct 2006 09:15:21 +0000 |
parents | 3908e1f808e1 |
children | f932ac47a331 |
line wrap: on
line diff
--- a/src/audio/SDL_audiocvt.c Sun Oct 01 16:10:41 2006 +0000 +++ b/src/audio/SDL_audiocvt.c Tue Oct 17 09:15:21 2006 +0000 @@ -159,21 +159,19 @@ float *dst = (float *) cvt->buf; if (SDL_AUDIO_ISBIGENDIAN(format)) { for (i = cvt->len_cvt / 8; i; --i, src += 2) { - float src1, src2; - src1 = SDL_SwapFloatBE(src[0]); - src2 = SDL_SwapFloatBE(src[1]); + const float src1 = SDL_SwapFloatBE(src[0]); + const float src2 = SDL_SwapFloatBE(src[1]); const double added = ((double) src1) + ((double) src2); - src1 = (float) (added * 0.5); - *(dst++) = SDL_SwapFloatBE(src1); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatBE(halved); } } else { for (i = cvt->len_cvt / 8; i; --i, src += 2) { - float src1, src2; - src1 = SDL_SwapFloatLE(src[0]); - src2 = SDL_SwapFloatLE(src[1]); + const float src1 = SDL_SwapFloatLE(src[0]); + const float src2 = SDL_SwapFloatLE(src[1]); const double added = ((double) src1) + ((double) src2); - src1 = (float) (added * 0.5); - *(dst++) = SDL_SwapFloatLE(src1); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatLE(halved); } } }