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/dboard/db_dbsrx2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/dboard/db_dbsrx2.cpp') diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 7635327b1..16a418417 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -19,8 +19,8 @@ #include #include #include -#include #include +#include #include #include @@ -258,7 +258,7 @@ double dbsrx2::set_lo_freq(double target_freq) N = (target_freq * R * ext_div) / (ref_freq); // actual spec range is (19, 251) intdiv = int(std::floor(N)); // if (intdiv < 19 or intdiv > 251) continue; - fracdiv = boost::math::iround((N - intdiv) * double(1 << 20)); + fracdiv = static_cast(std::lround((N - intdiv) * double(1 << 20))); // calculate the actual freq from the values above N = double(intdiv) + double(fracdiv) / double(1 << 20); @@ -305,7 +305,7 @@ double dbsrx2::set_lo_freq(double target_freq) */ static int gain_to_bbg_vga_reg(double& gain) { - int reg = boost::math::iround(dbsrx2_gain_ranges["BBG"].clip(gain)); + int reg = static_cast(std::lround(dbsrx2_gain_ranges["BBG"].clip(gain))); gain = double(reg); -- cgit v1.2.3