diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-06-19 00:06:52 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-24 12:00:49 -0500 |
commit | 188fbb17cfd18c87f60ec56f62476f97ef2779bb (patch) | |
tree | e88b9fb8436aa42f3ecbdc0403751a3e68bbbac8 /host/lib/rfnoc | |
parent | 78ec29b6becd53f79a0ae282ae22c38bedb887d1 (diff) | |
download | uhd-188fbb17cfd18c87f60ec56f62476f97ef2779bb.tar.gz uhd-188fbb17cfd18c87f60ec56f62476f97ef2779bb.tar.bz2 uhd-188fbb17cfd18c87f60ec56f62476f97ef2779bb.zip |
uhd: Remove all occurences of boost::math::*round()
Its behaviour is almost identical to std::lround, which we use instead.
The only downside of std::lround is that it always returns a long, which
we don't always need. We thus add some casts for those cases to make the
compiler happy.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/ddc_block_control.cpp | 4 | ||||
-rw-r--r-- | host/lib/rfnoc/duc_block_control.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/rfnoc/ddc_block_control.cpp b/host/lib/rfnoc/ddc_block_control.cpp index 91c53a5e9..3326d4e46 100644 --- a/host/lib/rfnoc/ddc_block_control.cpp +++ b/host/lib/rfnoc/ddc_block_control.cpp @@ -16,7 +16,7 @@ #include <uhdlib/usrp/cores/dsp_core_utils.hpp> #include <uhdlib/utils/compat_check.hpp> #include <uhdlib/utils/math.hpp> -#include <boost/math/special_functions/round.hpp> +#include <cmath> #include <set> #include <string> @@ -520,7 +520,7 @@ private: const double compensation_factor = 1. / dsp_gain; // Convert to fixpoint const double target_factor = FIXPOINT_SCALING * compensation_factor; - const int32_t actual_factor = boost::math::iround(target_factor); + const int32_t actual_factor = std::lround(target_factor); // Write DDC with scaling correction for CIC and DDS that maximizes // dynamic range _ddc_reg_iface.poke32(SR_SCALE_IQ_ADDR, actual_factor, chan); diff --git a/host/lib/rfnoc/duc_block_control.cpp b/host/lib/rfnoc/duc_block_control.cpp index 87f6500a2..12937ac21 100644 --- a/host/lib/rfnoc/duc_block_control.cpp +++ b/host/lib/rfnoc/duc_block_control.cpp @@ -16,7 +16,7 @@ #include <uhdlib/usrp/cores/dsp_core_utils.hpp> #include <uhdlib/utils/compat_check.hpp> #include <uhdlib/utils/math.hpp> -#include <boost/math/special_functions/round.hpp> +#include <cmath> #include <set> #include <string> @@ -504,7 +504,7 @@ private: const double compensation_factor = 1. / dsp_gain; // Convert to fixpoint const double target_factor = FIXPOINT_SCALING * compensation_factor; - const int32_t actual_factor = boost::math::iround(target_factor); + const int32_t actual_factor = static_cast<int32_t>(std::lround(target_factor)); // Write DUC with scaling correction for CIC and DDS that maximizes // dynamic range _duc_reg_iface.poke32(SR_SCALE_IQ_ADDR, actual_factor, chan); |