Mercurial > audlegacy
changeset 300:e35b0290f77c trunk
[svn] Squash 3 warnings by compiling as C99 code. Remove round_trick kludge.
author | chainsaw |
---|---|
date | Fri, 16 Dec 2005 18:25:18 -0800 |
parents | 0235eaed75fe |
children | 08e4eb900f21 |
files | Plugins/Input/wma/Makefile.am Plugins/Input/wma/iir.c Plugins/Input/wma/wma.c |
diffstat | 3 files changed, 3 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugins/Input/wma/Makefile.am Fri Dec 16 18:02:41 2005 -0800 +++ b/Plugins/Input/wma/Makefile.am Fri Dec 16 18:25:18 2005 -0800 @@ -12,4 +12,4 @@ libwma_la_SOURCES = wma.c iir.c -INCLUDES = $(GTK_CFLAGS) -I$(top_builddir)/intl -I$(top_srcdir) -I./libffwma +INCLUDES = $(GTK_CFLAGS) -I$(top_builddir)/intl -I$(top_srcdir) -I./libffwma -std=c99
--- a/Plugins/Input/wma/iir.c Fri Dec 16 18:02:41 2005 -0800 +++ b/Plugins/Input/wma/iir.c Fri Dec 16 18:25:18 2005 -0800 @@ -23,7 +23,7 @@ /* IIR filter coefficients */ #include "iir.h" #include <math.h> -#include <tgmath.h> +#include <strings.h> /* History for two filters */ static sXYData data_history[EQ_MAX_BANDS][EQ_CHANNELS] __attribute__((aligned)); @@ -50,24 +50,6 @@ { (2.4201241845e-01), (3.7899379077e-01), (-8.0847117831e-01) }, /* 16000.0 Hz */ }; -int round_trick(float floatvalue_to_round); - -/* Round function provided by Frank Klemm which saves around 100K - * CPU cycles in my PIII for each call to the IIR function - */ -__inline__ int round_trick(float floatvalue_to_round) -{ - float floattmp ; - int rounded_value ; - - floattmp = (int) 0x00FD8000L + (floatvalue_to_round); - rounded_value = *(int*)(&floattmp) - (int)0x4B7D8000L; - - if ( rounded_value != (short) rounded_value ) - rounded_value = ( rounded_value >> 31 ) ^ 0x7FFF; - return rounded_value; -} - /* Init the filter */ void init_iir() { @@ -170,11 +152,7 @@ out[channel] += (data[index+channel]>>2); /* Round and convert to integer */ -#ifdef __i386__ - tempgint = round_trick(out[channel]); -#else tempgint = (int)lroundf(out[channel]); -#endif /* Limit the output */ if (tempgint < -32768) @@ -197,5 +175,3 @@ return length; } - -