aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-06-19 00:06:52 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-06-24 12:00:49 -0500
commit188fbb17cfd18c87f60ec56f62476f97ef2779bb (patch)
treee88b9fb8436aa42f3ecbdc0403751a3e68bbbac8 /host/lib/usrp/dboard/db_dbsrx.cpp
parent78ec29b6becd53f79a0ae282ae22c38bedb887d1 (diff)
downloaduhd-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/usrp/dboard/db_dbsrx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp9
1 files changed, 4 insertions, 5 deletions
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 <uhd/utils/static.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
-#include <boost/math/special_functions/round.hpp>
#include <chrono>
#include <cmath>
#include <functional>
@@ -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<int>(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<int>(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