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_dbsrx.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'host/lib/usrp/dboard/db_dbsrx.cpp') diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index a55e5fc70..09690a3d1 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -491,11 +490,11 @@ static int gain_to_gc2_vga_reg(double& gain) // Half dB steps from 0-5dB, 1dB steps from 5-24dB if (gain < 5) { - reg = boost::math::iround(31.0 - gain / 0.5); - gain = double(boost::math::iround(gain) * 0.5); + reg = static_cast(std::lround(31.0 - gain / 0.5)); + gain = std::round(gain) * 0.5; } else { - reg = boost::math::iround(22.0 - (gain - 4.0)); - gain = double(boost::math::iround(gain)); + reg = static_cast(std::lround(22.0 - (gain - 4.0))); + gain = std::round(gain); } UHD_LOGGER_TRACE("DBSRX") << boost::format("DBSRX GC2 Gain: %f dB, reg: %d") % gain -- cgit v1.2.3