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/include/uhdlib/transport/udp_common.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'host/lib/include/uhdlib/transport/udp_common.hpp') diff --git a/host/lib/include/uhdlib/transport/udp_common.hpp b/host/lib/include/uhdlib/transport/udp_common.hpp index 6c87ef498..c094fb142 100644 --- a/host/lib/include/uhdlib/transport/udp_common.hpp +++ b/host/lib/include/uhdlib/transport/udp_common.hpp @@ -1,6 +1,7 @@ // // Copyright 2011 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 // @@ -14,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -110,7 +112,7 @@ UHD_INLINE size_t recv_udp_packet( #endif if (wait_for_recv_ready(sock_fd, timeout_ms)) { - len = ::recv(sock_fd, (char*)mem, frame_size, 0); + len = uhd::narrow_cast(::recv(sock_fd, (char*)mem, frame_size, 0)); if (len == 0) { throw uhd::io_error("socket closed"); } @@ -130,7 +132,7 @@ UHD_INLINE void send_udp_packet(int sock_fd, void* mem, size_t len) // This is known to occur at least on some OSX systems. // But it should be safe to always check for the error. while (true) { - const ssize_t ret = ::send(sock_fd, (const char*)mem, len, 0); + const ssize_t ret = uhd::narrow_cast(::send(sock_fd, (const char*)mem, len, 0)); if (ret == ssize_t(len)) break; if (ret == -1 and errno == ENOBUFS) { -- cgit v1.2.3