diff options
author | Josh Blum | 2011-10-08 13:43:32 -0700 |
---|---|---|
committer | Josh Blum | 2011-10-08 13:43:32 -0700 |
commit | 63b87bf4e6e9a2f1112c17c57796b69b3b8a2b3e (patch) | |
tree | 9ee830618e5d8253af8e8cec72dcec8925092dda | |
parent | 369834c83e26ac090dbac48c8c8e885ba210665a (diff) | |
download | gnuradio-63b87bf4e6e9a2f1112c17c57796b69b3b8a2b3e.tar.gz gnuradio-63b87bf4e6e9a2f1112c17c57796b69b3b8a2b3e.tar.bz2 gnuradio-63b87bf4e6e9a2f1112c17c57796b69b3b8a2b3e.zip |
gr: minor tweaks for MSVC compatibility
-rw-r--r-- | gnuradio-core/src/lib/general/gr_cpm.cc | 8 | ||||
-rw-r--r-- | gr-digital/include/digital_constellation.h | 2 | ||||
-rw-r--r-- | gr-digital/include/digital_constellation_receiver_cb.h | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/gnuradio-core/src/lib/general/gr_cpm.cc b/gnuradio-core/src/lib/general/gr_cpm.cc index a00526b52..94a428c58 100644 --- a/gnuradio-core/src/lib/general/gr_cpm.cc +++ b/gnuradio-core/src/lib/general/gr_cpm.cc @@ -28,6 +28,10 @@ #include <cfloat> #include <gr_cpm.h> +//gives us erf on compilers without it +#include <boost/math/special_functions/erf.hpp> +namespace bm = boost::math; + #ifndef M_TWOPI # define M_TWOPI (2*M_PI) #endif @@ -178,8 +182,8 @@ generate_cpm_gaussian_taps(unsigned samples_per_sym, unsigned L, double bt) double alpha = 5.336446256636997 * bt; for (unsigned i = 0; i < samples_per_sym * L; i++) { double k = i - Ls/2; // Causal to acausal - taps_d[i] = (erf(alpha * (k / samples_per_sym + 0.5)) - - erf(alpha * (k / samples_per_sym - 0.5))) + taps_d[i] = (bm::erf(alpha * (k / samples_per_sym + 0.5)) - + bm::erf(alpha * (k / samples_per_sym - 0.5))) * 0.5 / samples_per_sym; taps[i] = (float) taps_d[i]; } diff --git a/gr-digital/include/digital_constellation.h b/gr-digital/include/digital_constellation.h index 9b2a58588..3de350532 100644 --- a/gr-digital/include/digital_constellation.h +++ b/gr-digital/include/digital_constellation.h @@ -86,7 +86,7 @@ public: unsigned int dimensionality() {return d_dimensionality;} unsigned int bits_per_symbol () { - return floor(log(d_constellation.size())/d_dimensionality/log(2)); + return floor(log(1.0*d_constellation.size())/d_dimensionality/log(2.0)); } unsigned int arity () { diff --git a/gr-digital/include/digital_constellation_receiver_cb.h b/gr-digital/include/digital_constellation_receiver_cb.h index d33be8958..59b2d2785 100644 --- a/gr-digital/include/digital_constellation_receiver_cb.h +++ b/gr-digital/include/digital_constellation_receiver_cb.h @@ -26,6 +26,7 @@ #include <digital_api.h> #include <gr_block.h> #include <digital_constellation.h> +#include <gruel/attributes.h> #include <gri_control_loop.h> #include <gr_complex.h> #include <math.h> @@ -102,7 +103,7 @@ private: static const unsigned int DLLEN = 8; //! delay line plus some length for overflow protection - gr_complex d_dl[2*DLLEN] __attribute__ ((aligned(8))); + __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN]; //! index to delay line unsigned int d_dl_idx; |