<div dir="ltr">On Tue, Apr 15, 2014 at 12:33 PM, Peter Meerwald <span dir="ltr"><<a href="mailto:pmeerw@pmeerw.net" target="_blank">pmeerw@pmeerw.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Peter Meerwald <<a href="mailto:pmeerw@pmeerw.net">pmeerw@pmeerw.net</a>><br>
---<br>
libspeexdsp/resample.c | 14 +++++++-------<br>
1 file changed, 7 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c<br>
index e32ca45..a19b997 100644<br>
--- a/libspeexdsp/resample.c<br>
+++ b/libspeexdsp/resample.c<br>
@@ -85,7 +85,7 @@ static void speex_free (void *ptr) {free(ptr);}<br>
#ifdef FIXED_POINT<br>
#define WORD2INT(x) ((x) < -32767 ? -32768 : ((x) > 32766 ? 32767 : (x)))<br>
#else<br>
-#define WORD2INT(x) ((x) < -32767.5f ? -32768 : ((x) > 32766.5f ? 32767 : floor(.5+(x))))<br>
+#define WORD2INT(x) ((x) < -32767.5f ? -32768 : ((x) > 32766.5f ? 32767 : floorf(.5+(x))))<br>
#endif<br>
<br>
#define IMAX(a,b) ((a) > (b) ? (a) : (b))<br>
@@ -273,12 +273,12 @@ static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_fu<br>
{<br>
/*fprintf (stderr, "%f ", x);*/<br>
float xx = x * cutoff;<br>
- if (fabs(x)<1e-6f)<br>
+ if (fabsf(x)<1e-6f)<br>
return WORD2INT(32768.*cutoff);<br>
- else if (fabs(x) > .5f*N)<br>
+ else if (fabsf(x) > .5f*N)<br>
return 0;<br>
/*FIXME: Can it really be any slower than this? */<br>
- return WORD2INT(32768.*cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabs(2.*x/N), window_func));<br>
+ return WORD2INT(32768.*cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabsf(2.*x/N), window_func));<br>
}<br>
#else<br>
/* The slow way of computing a sinc for the table. Should improve that some day */<br>
@@ -286,12 +286,12 @@ static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_fu<br>
{<br>
/*fprintf (stderr, "%f ", x);*/<br>
float xx = x * cutoff;<br>
- if (fabs(x)<1e-6)<br>
+ if (fabsf(x)<1e-6f)<br>
return cutoff;<br>
- else if (fabs(x) > .5*N)<br>
+ else if (fabsf(x) > .5f*N)<br>
return 0;<br>
/*FIXME: Can it really be any slower than this? */<br>
- return cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabs(2.*x/N), window_func);<br>
+ return cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabsf(2.*x/N), window_func);<br>
}<br>
#endif<br></blockquote><div><br></div><div>Seems fine, fabsf is supported everywhere fabs is?<br><br>Best,<br>Tristan<br> </div></div><br></div></div>