src/audio/SDL_audiocvt.c
changeset 2049 5f6550e5184f
parent 2042 3908e1f808e1
child 2078 f932ac47a331
--- 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);
                 }
             }
         }