From 708840002eef7104d930e2b25f0d9ca203c5d507 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Mon, 18 Nov 2019 14:39:12 +0530 Subject: 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 --- host/lib/usrp/dboard/db_tvrx.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/dboard/db_tvrx.cpp') diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 5235b1bfe..cd238ddc8 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -1,6 +1,7 @@ // // Copyright 2010-2012 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 // @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -264,7 +266,9 @@ static double gain_interp(double gain, const boost::array& db_vector uint8_t gain_step = 0; //find which bin we're in for(size_t i = 0; i < db_vector.size()-1; i++) { - if(gain >= db_vector[i] && gain <= db_vector[i+1]) gain_step = i; + if (gain >= db_vector[i] && gain <= db_vector[i+1]) { + gain_step = uhd::narrow_cast(i); + } } //find the current slope for linear interpolation -- cgit v1.2.3