diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-06-19 00:06:52 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-24 12:00:49 -0500 |
commit | 188fbb17cfd18c87f60ec56f62476f97ef2779bb (patch) | |
tree | e88b9fb8436aa42f3ecbdc0403751a3e68bbbac8 /host/lib/usrp/dboard/db_dbsrx2.cpp | |
parent | 78ec29b6becd53f79a0ae282ae22c38bedb887d1 (diff) | |
download | uhd-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_dbsrx2.cpp')
-rw-r--r-- | host/lib/usrp/dboard/db_dbsrx2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 7635327b1..16a418417 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -19,8 +19,8 @@ #include <uhd/utils/static.hpp> #include <boost/assign/list_of.hpp> #include <boost/format.hpp> -#include <boost/math/special_functions/round.hpp> #include <boost/thread.hpp> +#include <cmath> #include <functional> #include <utility> @@ -258,7 +258,7 @@ double dbsrx2::set_lo_freq(double target_freq) N = (target_freq * R * ext_div) / (ref_freq); // actual spec range is (19, 251) intdiv = int(std::floor(N)); // if (intdiv < 19 or intdiv > 251) continue; - fracdiv = boost::math::iround((N - intdiv) * double(1 << 20)); + fracdiv = static_cast<int>(std::lround((N - intdiv) * double(1 << 20))); // calculate the actual freq from the values above N = double(intdiv) + double(fracdiv) / double(1 << 20); @@ -305,7 +305,7 @@ double dbsrx2::set_lo_freq(double target_freq) */ static int gain_to_bbg_vga_reg(double& gain) { - int reg = boost::math::iround(dbsrx2_gain_ranges["BBG"].clip(gain)); + int reg = static_cast<int>(std::lround(dbsrx2_gain_ranges["BBG"].clip(gain))); gain = double(reg); |