[Scummvm-cvs-logs] SF.net SVN: scummvm:[35040] scummvm/trunk/sound/softsynth/mt32/freeverb.h
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Nov 13 12:41:25 CET 2008
Revision: 35040
http://scummvm.svn.sourceforge.net/scummvm/?rev=35040&view=rev
Author: lordhoto
Date: 2008-11-13 11:41:25 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Fixed compiling of MT32 emulator with -O2 and -Werror.
Modified Paths:
--------------
scummvm/trunk/sound/softsynth/mt32/freeverb.h
Modified: scummvm/trunk/sound/softsynth/mt32/freeverb.h
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/freeverb.h 2008-11-13 11:36:37 UTC (rev 35039)
+++ scummvm/trunk/sound/softsynth/mt32/freeverb.h 2008-11-13 11:41:25 UTC (rev 35040)
@@ -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 @@
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 @@
float bufout;
bufout = buffer[bufidx];
- undenormalise(bufout);
+ undenormalise(&bufout);
output = -input + bufout;
buffer[bufidx] = input + (bufout * feedback);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list