[pulseaudio-commits] 2 commits - src/pulsecore src/tests

Tanu Kaskinen tanuk at kemper.freedesktop.org
Sun Aug 10 02:24:31 PDT 2014


 src/pulsecore/endianmacros.h |    4 ++--
 src/tests/mix-test.c         |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit a39a3b3f7df3ece773bb74b8c6baa599272704e0
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date:   Wed Aug 6 11:47:34 2014 +0200

    endianmacros: Fix PA_MAYBE_INT16_SWAP() macro
    
    PA_MAYBE_INT16_SWAP() should call PA_INT16_SWAP(), not PA_INT32_SWAP
    
    PA_MAYBE_INT16_SWAP() is not used (yet), so no big deal :)
    
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/pulsecore/endianmacros.h b/src/pulsecore/endianmacros.h
index 2b18cf8..4822fc4 100644
--- a/src/pulsecore/endianmacros.h
+++ b/src/pulsecore/endianmacros.h
@@ -82,8 +82,8 @@ static inline float PA_FLOAT32_SWAP(float x) {
     return t.f;
 }
 
-#define PA_MAYBE_INT16_SWAP(c,x) ((c) ? PA_INT32_SWAP(x) : (x))
-#define PA_MAYBE_UINT16_SWAP(c,x) ((c) ? PA_UINT32_SWAP(x) : (x))
+#define PA_MAYBE_INT16_SWAP(c,x) ((c) ? PA_INT16_SWAP(x) : (x))
+#define PA_MAYBE_UINT16_SWAP(c,x) ((c) ? PA_UINT16_SWAP(x) : (x))
 
 #define PA_MAYBE_INT32_SWAP(c,x) ((c) ? PA_INT32_SWAP(x) : (x))
 #define PA_MAYBE_UINT32_SWAP(c,x) ((c) ? PA_UINT32_SWAP(x) : (x))

commit e14863334b7e9267b3b3bbab08edf4a019411e89
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date:   Wed Aug 6 11:47:33 2014 +0200

    tests: Cleanup mix-test
    
    indentation and use of fabsf() for floats
    
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 9e5a0cc..c0cd559 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -202,7 +202,7 @@ static void compare_block(const pa_sample_spec *ss, const pa_memchunk *chunk, in
 
             for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
                 float uu = ss->format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u);
-                fail_unless(fabs(uu - *v) <= 1e-6, NULL);
+                fail_unless(fabsf(uu - *v) <= 1e-6f, NULL);
                 ++u;
                 ++v;
             }
@@ -215,7 +215,7 @@ static void compare_block(const pa_sample_spec *ss, const pa_memchunk *chunk, in
 
             for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
                 float uu = ss->format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u);
-                fail_unless(fabs(uu - *v) <= 1e-6, NULL);
+                fail_unless(fabsf(uu - *v) <= 1e-6f, NULL);
                 ++u;
                 ++v;
             }
@@ -385,7 +385,7 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
                 for (i = 0; i < 10; i++)
                     u[i] = PA_FLOAT32_SWAP(float_samples[i]);
             } else
-              memcpy(d, float_samples, sizeof(float_samples));
+                memcpy(d, float_samples, sizeof(float_samples));
 
             break;
         }



More information about the pulseaudio-commits mailing list