aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types
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/types
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/types')
-rw-r--r--host/lib/types/ranges.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/host/lib/types/ranges.cpp b/host/lib/types/ranges.cpp
index f7fbc0f92..16edeccca 100644
--- a/host/lib/types/ranges.cpp
+++ b/host/lib/types/ranges.cpp
@@ -7,8 +7,8 @@
#include <uhd/exception.hpp>
#include <uhd/types/ranges.hpp>
-#include <boost/math/special_functions/round.hpp>
#include <algorithm>
+#include <cmath>
#include <sstream>
using namespace uhd;
@@ -148,8 +148,7 @@ double meta_range_t::clip(double value, bool clip_step) const
if (value <= r.stop()) {
if (not clip_step or r.step() == 0)
return value;
- return boost::math::round((value - r.start()) / r.step()) * r.step()
- + r.start();
+ return std::round((value - r.start()) / r.step()) * r.step() + r.start();
}
// continue on to the next range
last_stop = r.stop();