Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Patched to build on pre-C99 compilers.

  • Loading branch information
icculus committed Oct 8, 2006
1 parent 8f255a7 commit 8eeea5c0c463739ee3776d58e7acfb83c3b5b297
Showing with 8 additions and 10 deletions.
  1. +8 −10 src/audio/SDL_audiocvt.c
@@ -159,21 +159,19 @@ SDL_ConvertMono(SDL_AudioCVT * cvt, SDL_AudioFormat format)
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);
}
}
}

0 comments on commit 8eeea5c

Please sign in to comment.