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/convert/convert_with_tables.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/convert') diff --git a/host/lib/convert/convert_with_tables.cpp b/host/lib/convert/convert_with_tables.cpp index 3df510092..3443e02c7 100644 --- a/host/lib/convert/convert_with_tables.cpp +++ b/host/lib/convert/convert_with_tables.cpp @@ -7,7 +7,7 @@ #include "convert_common.hpp" #include -#include +#include #include using namespace uhd::convert; @@ -30,7 +30,7 @@ public: { for (size_t i = 0; i < sc16_table_len; i++) { const int16_t val = uint16_t(i); - _table[i] = int8_t(boost::math::iround(val * scalar / 32767.)); + _table[i] = int8_t(std::lround(val * scalar / 32767.)); } } @@ -120,7 +120,7 @@ public: static type conv(const int8_t& num, const double scalar) { if (sizeof(type) == sizeof(s16_t)) { - return type(boost::math::iround(num * scalar * 32767)); + return type(std::lround(num * scalar * 32767)); } return type(num * scalar); } -- cgit v1.2.3