diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2019-11-18 14:39:12 +0530 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2020-01-09 09:18:25 -0800 |
commit | 708840002eef7104d930e2b25f0d9ca203c5d507 (patch) | |
tree | 3b19d154d445b18813e8facadd01479a17070423 /host/lib/include/uhdlib/transport/udp_common.hpp | |
parent | d1398bbab629042bf62d4fda93ed503e54cadc7d (diff) | |
download | uhd-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/transport/udp_common.hpp')
-rw-r--r-- | host/lib/include/uhdlib/transport/udp_common.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 <uhd/types/device_addr.hpp> #include <uhd/utils/log.hpp> #include <uhdlib/transport/links.hpp> +#include <uhdlib/utils/narrow.hpp> #include <boost/asio.hpp> #include <boost/format.hpp> #include <thread> @@ -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<ssize_t>(::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<ssize_t>(::send(sock_fd, (const char*)mem, len, 0)); if (ret == ssize_t(len)) break; if (ret == -1 and errno == ENOBUFS) { |