aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/gain_group_test.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/tests/gain_group_test.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/tests/gain_group_test.cpp')
-rw-r--r--host/tests/gain_group_test.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/host/tests/gain_group_test.cpp b/host/tests/gain_group_test.cpp
index 98a2516b8..f5239788c 100644
--- a/host/tests/gain_group_test.cpp
+++ b/host/tests/gain_group_test.cpp
@@ -6,13 +6,11 @@
//
#include <uhd/utils/gain_group.hpp>
-#include <boost/math/special_functions/round.hpp>
#include <boost/test/unit_test.hpp>
+#include <cmath>
#include <functional>
#include <iostream>
-#define rint(x) boost::math::iround(x)
-
using namespace uhd;
/***********************************************************************
@@ -34,7 +32,7 @@ public:
void set_value(double gain)
{
double step = get_range().step();
- _gain = step * rint(gain / step);
+ _gain = step * std::round(gain / step);
}
private:
@@ -57,7 +55,7 @@ public:
void set_value(double gain)
{
double step = get_range().step();
- _gain = step * rint(gain / step);
+ _gain = step * std::round(gain / step);
}
private: