From cd5a85036d00fcffef63d6c7dac4f95b960ddf2e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 13 Nov 2008 11:41:25 +0000 Subject: Fixed compiling of MT32 emulator with -O2 and -Werror. svn-id: r35040 --- sound/softsynth/mt32/freeverb.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sound/softsynth') diff --git a/sound/softsynth/mt32/freeverb.h b/sound/softsynth/mt32/freeverb.h index 53c5307c5a..8310aca3e3 100644 --- a/sound/softsynth/mt32/freeverb.h +++ b/sound/softsynth/mt32/freeverb.h @@ -33,7 +33,12 @@ #ifndef FREEVERB_H #define FREEVERB_H -#define undenormalise(sample) if (((*(unsigned int*)&sample) & 0x7f800000) == 0) sample = 0.0f +// FIXME: Fix this really ugly hack +inline float undenormalise(void *sample) { + if (((*(unsigned int*)sample) & 0x7f800000) == 0) + return 0.0f; + return *(float*)sample; +} // Comb filter class declaration @@ -64,10 +69,10 @@ inline float comb::process(float input) { float output; output = buffer[bufidx]; - undenormalise(output); + undenormalise(&output); filterstore = (output * damp2) + (filterstore * damp1); - undenormalise(filterstore); + undenormalise(&filterstore); buffer[bufidx] = input + (filterstore * feedback); @@ -102,7 +107,7 @@ inline float allpass::process(float input) { float bufout; bufout = buffer[bufidx]; - undenormalise(bufout); + undenormalise(&bufout); output = -input + bufout; buffer[bufidx] = input + (bufout * feedback); -- cgit v1.2.3