aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/usrp/common/adf435x.hpp
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2019-11-18 14:39:12 +0530
committerBrent Stapleton <brent.stapleton@ettus.com>2020-01-09 09:18:25 -0800
commit708840002eef7104d930e2b25f0d9ca203c5d507 (patch)
tree3b19d154d445b18813e8facadd01479a17070423 /host/lib/include/uhdlib/usrp/common/adf435x.hpp
parentd1398bbab629042bf62d4fda93ed503e54cadc7d (diff)
downloaduhd-708840002eef7104d930e2b25f0d9ca203c5d507.tar.gz
uhd-708840002eef7104d930e2b25f0d9ca203c5d507.tar.bz2
uhd-708840002eef7104d930e2b25f0d9ca203c5d507.zip
uhd: fixing MSVC warnings
Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
Diffstat (limited to 'host/lib/include/uhdlib/usrp/common/adf435x.hpp')
-rw-r--r--host/lib/include/uhdlib/usrp/common/adf435x.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/include/uhdlib/usrp/common/adf435x.hpp b/host/lib/include/uhdlib/usrp/common/adf435x.hpp
index 886c8d335..7989420dd 100644
--- a/host/lib/include/uhdlib/usrp/common/adf435x.hpp
+++ b/host/lib/include/uhdlib/usrp/common/adf435x.hpp
@@ -1,6 +1,7 @@
//
// Copyright 2015 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
+// Copyright 2019 Ettus Research, A National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
@@ -15,6 +16,7 @@
#include <uhd/types/ranges.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/utils/math.hpp>
+#include <uhdlib/utils/narrow.hpp>
#include <functional>
#include <boost/math/special_functions/round.hpp>
#include <boost/thread.hpp>
@@ -112,7 +114,8 @@ public:
virtual void set_charge_pump_current(charge_pump_current_t cp_current) = 0;
- virtual double set_charge_pump_current(double current, bool flush = false) = 0;
+ virtual double set_charge_pump_current(
+ const double current, const bool flush = false) = 0;
virtual uhd::meta_range_t get_charge_pump_current_range() = 0;
@@ -321,7 +324,8 @@ public:
const auto cp_range = get_charge_pump_current_range();
const auto coerced_current = cp_range.clip(current, true);
- const int current_step = std::round((coerced_current / cp_range.step()) - 1);
+ const int current_step =
+ uhd::narrow_cast<int>(std::round((coerced_current / cp_range.step()) - 1));
UHD_ASSERT_THROW(current_step >= 0 and current_step < 16);
set_charge_pump_current(