Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Patched to build on pre-C99 compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 8, 2006
1 parent 8f255a7 commit 8eeea5c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/audio/SDL_audiocvt.c
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 8eeea5c

Please sign in to comment.