aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-13 11:41:25 +0000
committerJohannes Schickel2008-11-13 11:41:25 +0000
commitcd5a85036d00fcffef63d6c7dac4f95b960ddf2e (patch)
treeb6e11888c05962966e8d35a3c7c518eaf52afc07
parentcca19671d5e4e83b424bdd30ff59e094231378e9 (diff)
downloadscummvm-rg350-cd5a85036d00fcffef63d6c7dac4f95b960ddf2e.tar.gz
scummvm-rg350-cd5a85036d00fcffef63d6c7dac4f95b960ddf2e.tar.bz2
scummvm-rg350-cd5a85036d00fcffef63d6c7dac4f95b960ddf2e.zip
Fixed compiling of MT32 emulator with -O2 and -Werror.
svn-id: r35040
-rw-r--r--sound/softsynth/mt32/freeverb.h13
1 files changed, 9 insertions, 4 deletions
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);