[pulseaudio-discuss] [PATCH 12/13] tests: Use float constants in cpu-sconv-test

Peter Meerwald pmeerw at pmeerw.net
Thu Apr 24 09:51:04 PDT 2014


Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/tests/cpu-sconv-test.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/tests/cpu-sconv-test.c b/src/tests/cpu-sconv-test.c
index 6899b72..5cb8a3c 100644
--- a/src/tests/cpu-sconv-test.c
+++ b/src/tests/cpu-sconv-test.c
@@ -89,8 +89,8 @@ static void run_conv_test_s16_to_float(
         bool correct,
         bool perf) {
 
-    PA_DECLARE_ALIGNED(8, float, f[SAMPLES]) = { 0 };
-    PA_DECLARE_ALIGNED(8, float, f_ref[SAMPLES]) = { 0 };
+    PA_DECLARE_ALIGNED(8, float, f[SAMPLES]) = { 0.0f };
+    PA_DECLARE_ALIGNED(8, float, f_ref[SAMPLES]) = { 0.0f };
     PA_DECLARE_ALIGNED(8, int16_t, s[SAMPLES]);
     float *floats, *floats_ref;
     int16_t *samples;
@@ -109,7 +109,7 @@ static void run_conv_test_s16_to_float(
         func(nsamples, samples, floats);
 
         for (i = 0; i < nsamples; i++) {
-            if (fabsf(floats[i] - floats_ref[i]) > 0.0001) {
+            if (fabsf(floats[i] - floats_ref[i]) > 0.0001f) {
                 pa_log_debug("Correctness test failed: align=%d", align);
                 pa_log_debug("%d: %.24f != %.24f (%d)\n", i, floats[i], floats_ref[i], samples[i]);
                 fail();
-- 
1.7.9.5



More information about the pulseaudio-discuss mailing list