Mercurial > sdl-ios-xcode
changeset 3835:84aa539627c8 SDL-ryan-multiple-audio-device
Patched to build on pre-C99 compilers.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 08 Oct 2006 00:05:22 +0000 |
parents | 93326d2ceedb |
children | 7dc7327cd626 |
files | src/audio/SDL_audiocvt.c |
diffstat | 1 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audio/SDL_audiocvt.c Sun Oct 08 00:01:16 2006 +0000 +++ b/src/audio/SDL_audiocvt.c Sun Oct 08 00:05:22 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); } } }