From 188fbb17cfd18c87f60ec56f62476f97ef2779bb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 19 Jun 2021 00:06:52 +0200 Subject: 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. --- host/lib/rfnoc/ddc_block_control.cpp | 4 ++-- host/lib/rfnoc/duc_block_control.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib/rfnoc') 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 #include #include -#include +#include #include #include @@ -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 #include #include -#include +#include #include #include @@ -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(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); -- cgit v1.2.3