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

Peter Meerwald pmeerw at pmeerw.net
Wed Sep 10 07:40:14 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 4e7848d..428ebe0 100644
--- a/src/tests/cpu-sconv-test.c
+++ b/src/tests/cpu-sconv-test.c
@@ -94,8 +94,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;
@@ -114,7 +114,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.9.1



More information about the pulseaudio-discuss mailing list