diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2013-06-15 12:34:11 -0700 |
---|---|---|
committer | Nicholas Corgan <nick.corgan@ettus.com> | 2013-06-15 12:34:11 -0700 |
commit | 6dcf96dfb0c398d86b983c9062cecef71f0d80ca (patch) | |
tree | 77584946b3b171275d6afa8ed6ca34cc541a7542 /gr-analog | |
parent | 1d453860e9407f112169b05e592efca76799124f (diff) |
analog: fixed agc3_cc_impl GCC assumption
Diffstat (limited to 'gr-analog')
-rw-r--r-- | gr-analog/lib/agc3_cc_impl.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gr-analog/lib/agc3_cc_impl.cc b/gr-analog/lib/agc3_cc_impl.cc index a6a85caf10..6ba6814ad1 100644 --- a/gr-analog/lib/agc3_cc_impl.cc +++ b/gr-analog/lib/agc3_cc_impl.cc @@ -24,6 +24,8 @@ #include "config.h" #endif +#include <vector> + #include "agc3_cc_impl.h" #include <gnuradio/io_signature.h> #include <volk/volk.h> @@ -68,12 +70,15 @@ namespace gr { // Compute magnitude of each sample #ifdef __GNUC__ float mags[noutput_items] __attribute__ ((aligned (16))); + volk_32fc_magnitude_32f(mags, &in[0], noutput_items); + // Compute a linear average on reset (no expected) + if(__builtin_expect(d_reset, false)) { #else - float mags[noutput_items]; + std::vector<float> mags(noutput_items); + volk_32fc_magnitude_32f(&mags[0], &in[0], noutput_items); + // Compute a linear average on reset (no expected) + if(!d_reset) { #endif - volk_32fc_magnitude_32f(mags, &in[0], noutput_items); - // Compute a linear average on reset (no expected) - if(__builtin_expect(d_reset, false)) { float mag; for(int i=0; i<noutput_items; i++) { mag += mags[i]; |