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/usrp/usrp1/io_impl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib/usrp/usrp1/io_impl.cpp') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index b93cfa094..5d7b4a77b 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -17,11 +17,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -517,7 +517,7 @@ uhd::meta_range_t usrp1_impl::get_tx_dsp_host_rates(void) double usrp1_impl::update_rx_samp_rate(size_t dspno, const double samp_rate) { const size_t div = this->has_rx_halfband() ? 2 : 1; - const size_t rate = boost::math::iround( + const size_t rate = std::lround( _master_clock_rate / this->get_rx_dsp_host_rates().clip(samp_rate, true)); if (rate < 8 and this->has_rx_halfband()) @@ -548,7 +548,7 @@ double usrp1_impl::update_rx_samp_rate(size_t dspno, const double samp_rate) double usrp1_impl::update_tx_samp_rate(size_t dspno, const double samp_rate) { const size_t div = this->has_tx_halfband() ? 4 : 2; // doubled for codec interp - const size_t rate = boost::math::iround( + const size_t rate = std::lround( _master_clock_rate / this->get_tx_dsp_host_rates().clip(samp_rate, true)); if (dspno == 0) { // only care if dsp0 is set since its homogeneous @@ -591,7 +591,7 @@ double usrp1_impl::update_rx_dsp_freq(const size_t dspno, const double freq_) UHD_ASSERT_THROW(std::abs(freq) <= _master_clock_rate / 2.0); static const double scale_factor = std::pow(2.0, 32); const int32_t freq_word = - int32_t(boost::math::round((freq / _master_clock_rate) * scale_factor)); + int32_t(std::lround((freq / _master_clock_rate) * scale_factor)); static const uint32_t dsp_index_to_reg_val[4] = { FR_RX_FREQ_0, FR_RX_FREQ_1, FR_RX_FREQ_2, FR_RX_FREQ_3}; -- cgit v1.2.3