commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 05/09: volk/rotator: Fix the volk_32fc_s32f


From: git
Subject: [Commit-gnuradio] [gnuradio] 05/09: volk/rotator: Fix the volk_32fc_s32fc_x2_rotator_32fc_generic kernel
Date: Tue, 28 Jan 2014 20:10:56 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 796dcf960bc8fd630e1f0ca0cb5ea5861769b611
Author: Sylvain Munaut <address@hidden>
Date:   Sat Jan 25 22:55:34 2014 +0100

    volk/rotator: Fix the volk_32fc_s32fc_x2_rotator_32fc_generic kernel
    
    abs() is an int function ...
    
    Call the right one depending on the language now.
    
    Note that I explicitely did the selection here rather than add a lv_abs()
    function in volk_complex.h because there is no GCC extension for abs() that
    would return the right type, so I'd have to stick to the cabs() function
    which would force a double cast back and forth.
    
    Signed-off-by: Sylvain Munaut <address@hidden>
---
 volk/kernels/volk/volk_32fc_s32fc_x2_rotator_32fc.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/volk/kernels/volk/volk_32fc_s32fc_x2_rotator_32fc.h 
b/volk/kernels/volk/volk_32fc_s32fc_x2_rotator_32fc.h
index e25d2a4..84fe39f 100644
--- a/volk/kernels/volk/volk_32fc_s32fc_x2_rotator_32fc.h
+++ b/volk/kernels/volk/volk_32fc_s32fc_x2_rotator_32fc.h
@@ -26,7 +26,11 @@ static inline void 
volk_32fc_s32fc_x2_rotator_32fc_generic(lv_32fc_t* outVector,
             *outVector++ = *inVector++ * (*phase);
             (*phase) *= phase_inc;
         }
-        (*phase) /= abs((*phase));
+#ifdef __cplusplus
+        (*phase) /= std::abs((*phase));
+#else
+        (*phase) /= cabsf((*phase));
+#endif
     }
     for(i = 0; i < num_points%ROTATOR_RELOAD; ++i) {
         *outVector++ = *inVector++ * (*phase);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]