# HG changeset patch # User chainsaw # Date 1134786318 28800 # Node ID e35b0290f77cd6922a1fcd2c69e8e559deb1a7ed # Parent 0235eaed75fe5279521e7b14f2f14ea4afc1e564 [svn] Squash 3 warnings by compiling as C99 code. Remove round_trick kludge. diff -r 0235eaed75fe -r e35b0290f77c Plugins/Input/wma/Makefile.am --- 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 diff -r 0235eaed75fe -r e35b0290f77c Plugins/Input/wma/iir.c --- 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 -#include +#include /* 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; } - - diff -r 0235eaed75fe -r e35b0290f77c Plugins/Input/wma/wma.c --- a/Plugins/Input/wma/wma.c Fri Dec 16 18:02:41 2005 -0800 +++ b/Plugins/Input/wma/wma.c Fri Dec 16 18:25:18 2005 -0800 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include