diff options
Diffstat (limited to 'host')
33 files changed, 212 insertions, 204 deletions
diff --git a/host/examples/test_clock_synch.cpp b/host/examples/test_clock_synch.cpp index 7a4226345..50a1444f8 100644 --- a/host/examples/test_clock_synch.cpp +++ b/host/examples/test_clock_synch.cpp @@ -35,14 +35,14 @@ using namespace uhd::usrp_clock; using namespace uhd::usrp; void wait_for_pps(multi_usrp::sptr usrp, size_t chan, double timeout){ - boost::uint32_t last_pps_time = usrp->get_time_last_pps(chan).get_full_secs(); - boost::uint32_t system_time = uhd::time_spec_t::get_system_time().get_full_secs(); - boost::uint32_t exit_time = system_time + timeout; + time_t last_pps_time = usrp->get_time_last_pps(chan).get_full_secs(); + time_t system_time = uhd::time_spec_t::get_system_time().get_full_secs(); + time_t exit_time = system_time + timeout; bool detected_pps = false; //Otherwise, this would hang if the USRP doesn't detect any PPS while(uhd::time_spec_t::get_system_time().get_full_secs() < exit_time){ - boost::uint32_t time_now = usrp->get_time_last_pps(chan).get_full_secs(); + time_t time_now = usrp->get_time_last_pps(chan).get_full_secs(); if(last_pps_time < time_now){ detected_pps = true; break; diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index d98c5187d..7dc3bd9c2 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -137,7 +137,7 @@ template<typename samp_type> void recv_to_file( UHD_ASSERT_THROW(outfiles.size() == buffs.size()); UHD_ASSERT_THROW(buffs.size() == rx_channel_nums.size()); bool overflow_message = true; - float timeout = settling_time + 0.1; //expected settling time + padding for first recv + float timeout = settling_time + 0.1f; //expected settling time + padding for first recv //setup streaming uhd::stream_cmd_t stream_cmd((num_requested_samples == 0)? @@ -151,7 +151,7 @@ template<typename samp_type> void recv_to_file( while(not stop_signal_called and (num_requested_samples != num_total_samps or num_requested_samples == 0)){ size_t num_rx_samps = rx_stream->recv(buff_ptrs, samps_per_buff, md, timeout); - timeout = 0.1; //small timeout for subsequent recv + timeout = 0.1f; //small timeout for subsequent recv if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) { std::cout << boost::format("Timeout while streaming") << std::endl; diff --git a/host/include/uhd/transport/nirio/nirio_fifo.h b/host/include/uhd/transport/nirio/nirio_fifo.h index c424275fc..5a2e29631 100644 --- a/host/include/uhd/transport/nirio/nirio_fifo.h +++ b/host/include/uhd/transport/nirio/nirio_fifo.h @@ -59,8 +59,8 @@ public: inline const std::string& get_name() const { return _name; } inline uint32_t get_channel() const { return _fifo_channel; } - inline uint32_t get_direction() const { return _fifo_direction; } - inline uint32_t get_scalar_type() const { return _datatype_info.scalar_type; } + inline fifo_direction_t get_direction() const { return _fifo_direction; } + inline nirio_scalar_type_t get_scalar_type() const { return _datatype_info.scalar_type; } nirio_status start(); diff --git a/host/include/uhd/transport/nirio/nirio_fifo.ipp b/host/include/uhd/transport/nirio/nirio_fifo.ipp index ca6486e30..49ce43888 100644 --- a/host/include/uhd/transport/nirio/nirio_fifo.ipp +++ b/host/include/uhd/transport/nirio/nirio_fifo.ipp @@ -15,9 +15,11 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#ifdef __clang__ - #pragma GCC diagnostic push ignored "-Wmissing-field-initializers" -#elif defined(__GNUC__) +// "push" and "pop" introduced in GCC 4.6; works with all clang +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) + #pragma GCC diagnostic push +#endif +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif @@ -375,6 +377,6 @@ inline datatype_info_t nirio_fifo<uint64_t>::_get_datatype_info() return datatype_info_t(RIO_SCALAR_TYPE_UQ, 8); } -#ifdef __GNUC__ +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) #pragma GCC diagnostic pop #endif diff --git a/host/include/uhd/transport/vrt_if_packet.hpp b/host/include/uhd/transport/vrt_if_packet.hpp index 8bc65cdf1..1e54607c1 100644 --- a/host/include/uhd/transport/vrt_if_packet.hpp +++ b/host/include/uhd/transport/vrt_if_packet.hpp @@ -46,7 +46,7 @@ namespace vrt{ { LINK_TYPE_NONE = 0x0, LINK_TYPE_CHDR = 0x1, - LINK_TYPE_VRLP = 0x2, + LINK_TYPE_VRLP = 0x2 } link_type; //packet type @@ -63,7 +63,7 @@ namespace vrt{ PACKET_TYPE_ACK = 0x1, // Flow control (ack) PACKET_TYPE_CMD = 0x2, // Command PACKET_TYPE_RESP = 0x3, // Command response - PACKET_TYPE_ERROR = 0x3, // Command response: Error (the EOB bit is raised in this case) + PACKET_TYPE_ERROR = 0x3 // Command response: Error (the EOB bit is raised in this case) } packet_type; //size fields diff --git a/host/include/uhd/types/clock_config.hpp b/host/include/uhd/types/clock_config.hpp index 27b312245..6d5d01ec2 100644 --- a/host/include/uhd/types/clock_config.hpp +++ b/host/include/uhd/types/clock_config.hpp @@ -47,12 +47,12 @@ namespace uhd{ REF_AUTO = int('a'), //automatic (device specific) REF_INT = int('i'), //internal reference REF_SMA = int('s'), //external sma port - REF_MIMO = int('m'), //reference from mimo cable + REF_MIMO = int('m') //reference from mimo cable } ref_source; enum pps_source_t { PPS_INT = int('i'), //there is no internal PPS_SMA = int('s'), //external sma port - PPS_MIMO = int('m'), //time sync from mimo cable + PPS_MIMO = int('m') //time sync from mimo cable } pps_source; enum pps_polarity_t { PPS_NEG = int('n'), //negative edge diff --git a/host/include/uhd/utils/fp_compare_delta.ipp b/host/include/uhd/utils/fp_compare_delta.ipp index 092ade6e9..49cbc281b 100644 --- a/host/include/uhd/utils/fp_compare_delta.ipp +++ b/host/include/uhd/utils/fp_compare_delta.ipp @@ -100,8 +100,8 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator==(fp_compare_delta<float_t> lhs, double rhs) { - float_t delta = fp_compare_select_delta(double(lhs._delta), - DOUBLE_PRECISION_DELTA); + float_t delta = float_t(fp_compare_select_delta(double(lhs._delta), + DOUBLE_PRECISION_DELTA)); return (std::fabs(lhs._value - rhs) < delta); } @@ -112,8 +112,8 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator<(fp_compare_delta<float_t> lhs, double rhs) { - float_t delta = fp_compare_select_delta(double(lhs._delta), - DOUBLE_PRECISION_DELTA); + float_t delta = float_t(fp_compare_select_delta(double(lhs._delta), + DOUBLE_PRECISION_DELTA)); return ((rhs - lhs._value) > delta); } @@ -124,8 +124,8 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator>(fp_compare_delta<float_t> lhs, double rhs) { - float_t delta = fp_compare_select_delta(double(lhs._delta), - DOUBLE_PRECISION_DELTA); + float_t delta = float_t(fp_compare_select_delta(double(lhs._delta), + DOUBLE_PRECISION_DELTA)); return ((lhs._value - rhs) > delta); } @@ -148,8 +148,8 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator<(double lhs, fp_compare_delta<float_t> rhs) { - float_t delta = fp_compare_select_delta(DOUBLE_PRECISION_DELTA, - double(rhs._delta)); + float_t delta = float_t(fp_compare_select_delta(DOUBLE_PRECISION_DELTA, + double(rhs._delta))); return ((rhs._value - lhs) > delta); } @@ -160,8 +160,8 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator>(double lhs, fp_compare_delta<float_t> rhs) { - float_t delta = fp_compare_select_delta(DOUBLE_PRECISION_DELTA, - double(rhs._delta)); + float_t delta = float_t(fp_compare_select_delta(DOUBLE_PRECISION_DELTA, + double(rhs._delta))); return ((lhs - rhs._value) > delta); } diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp index 5baa00108..106c0d9d5 100644 --- a/host/include/uhd/utils/log.hpp +++ b/host/include/uhd/utils/log.hpp @@ -76,7 +76,7 @@ namespace uhd{ namespace _log{ regularly = 3, rarely = 4, very_rarely = 5, - never = 6, + never = 6 }; //! Internal logging object (called by UHD_LOG macros) @@ -101,12 +101,12 @@ namespace uhd{ namespace _log{ // General insertion overload template <typename T> - INSERTION_OVERLOAD(T val); + INSERTION_OVERLOAD(T val) // Insertion overloads for std::ostream manipulators - INSERTION_OVERLOAD(std::ostream& (*val)(std::ostream&)); - INSERTION_OVERLOAD(std::ios& (*val)(std::ios&)); - INSERTION_OVERLOAD(std::ios_base& (*val)(std::ios_base&)); + INSERTION_OVERLOAD(std::ostream& (*val)(std::ostream&)) + INSERTION_OVERLOAD(std::ios& (*val)(std::ios&)) + INSERTION_OVERLOAD(std::ios_base& (*val)(std::ios_base&)) private: std::ostringstream _ss; diff --git a/host/include/uhd/utils/math.hpp b/host/include/uhd/utils/math.hpp index 275a94f72..46a1cf7e4 100644 --- a/host/include/uhd/utils/math.hpp +++ b/host/include/uhd/utils/math.hpp @@ -60,7 +60,7 @@ namespace math { * values, a custom epsilon should be defined for those computations. This * use-case is provided for in the `fp_compare_epsilon` class constructor. */ - static const float SINGLE_PRECISION_EPSILON = 1.19e-7; + static const float SINGLE_PRECISION_EPSILON = 1.19e-7f; static const double DOUBLE_PRECISION_EPSILON = 2.22e-16; namespace fp_compare { @@ -155,7 +155,7 @@ namespace fp_compare { * These are the default deltas used by the 'fp_compare_delta' class for * single and double-precision floating point comparisons. */ - static const float SINGLE_PRECISION_DELTA = 1e-3; + static const float SINGLE_PRECISION_DELTA = 1e-3f; static const double DOUBLE_PRECISION_DELTA = 1e-5; /*! Floating-point delta to use for frequency comparisons. */ diff --git a/host/lib/transport/nirio/nirio_driver_iface_unsupported.cpp b/host/lib/transport/nirio/nirio_driver_iface_unsupported.cpp index 1a1142525..d265efa63 100644 --- a/host/lib/transport/nirio/nirio_driver_iface_unsupported.cpp +++ b/host/lib/transport/nirio/nirio_driver_iface_unsupported.cpp @@ -19,43 +19,43 @@ namespace nirio_driver_iface { nirio_status rio_open( - const std::string& device_path, - rio_dev_handle_t& device_handle) + const std::string& /* device_path */, + rio_dev_handle_t& /* device_handle */) { return NiRio_Status_FeatureNotSupported; } -void rio_close(rio_dev_handle_t& device_handle) +void rio_close(rio_dev_handle_t& /* device_handle */) { } -bool rio_isopen(rio_dev_handle_t device_handle) +bool rio_isopen(rio_dev_handle_t /* device_handle */) { return false; } nirio_status rio_ioctl( - rio_dev_handle_t device_handle, - uint32_t ioctl_code, - const void *write_buf, - size_t write_buf_len, - void *read_buf, - size_t read_buf_len) + rio_dev_handle_t /* device_handle */, + uint32_t /* ioctl_code */, + const void* /* write_buf */, + size_t /* write_buf_len */, + void* /* read_buf */, + size_t /* read_buf_len */) { return NiRio_Status_FeatureNotSupported; } nirio_status rio_mmap( - rio_dev_handle_t device_handle, - uint16_t memory_type, - size_t size, - bool writable, - rio_mmap_t &map) + rio_dev_handle_t /* device_handle */, + uint16_t /* memory_type */, + size_t /* size */, + bool /* writable */, + rio_mmap_t& /* map */) { return NiRio_Status_FeatureNotSupported; } -nirio_status rio_munmap(rio_mmap_t &map) +nirio_status rio_munmap(rio_mmap_t& /* map */) { return NiRio_Status_FeatureNotSupported; } diff --git a/host/lib/transport/nirio/nirio_resource_manager.cpp b/host/lib/transport/nirio/nirio_resource_manager.cpp index e56670de0..d62f5c40d 100644 --- a/host/lib/transport/nirio/nirio_resource_manager.cpp +++ b/host/lib/transport/nirio/nirio_resource_manager.cpp @@ -15,12 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // - #include <uhd/transport/nirio/nirio_resource_manager.h> -#ifdef __clang__ - #pragma GCC diagnostic push ignored "-Wmissing-field-initializers" -#elif defined(__GNUC__) +// "push" and "pop" introduced in GCC 4.6; works with all clang +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) + #pragma GCC diagnostic push +#endif +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif @@ -100,6 +101,6 @@ nirio_fifo_info_t* nirio_resource_manager::_lookup_fifo_info(const char* fifo_na }} -#ifdef __GNUC__ +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) #pragma GCC diagnostic pop #endif diff --git a/host/lib/transport/nirio/niriok_proxy.cpp b/host/lib/transport/nirio/niriok_proxy.cpp index cc2daba22..0cc13efb8 100644 --- a/host/lib/transport/nirio/niriok_proxy.cpp +++ b/host/lib/transport/nirio/niriok_proxy.cpp @@ -20,9 +20,11 @@ #include <uhd/transport/nirio/niriok_proxy_impl_v2.h> #include <cstring> -#ifdef __clang__ - #pragma GCC diagnostic push ignored "-Wmissing-field-initializers" -#elif defined(__GNUC__) +// "push" and "pop" introduced in GCC 4.6; works with all clang +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) + #pragma GCC diagnostic push +#endif +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif @@ -73,6 +75,6 @@ namespace uhd { namespace niusrprio } }} -#ifdef __GNUC__ +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) #pragma GCC diagnostic pop #endif diff --git a/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp b/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp index f4a8e4ff5..f0ffe2ffc 100644 --- a/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp +++ b/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp @@ -15,13 +15,14 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // - #include <uhd/transport/nirio/niriok_proxy_impl_v1.h> #include <cstring> -#ifdef __clang__ - #pragma GCC diagnostic push ignored "-Wmissing-field-initializers" -#elif defined(__GNUC__) +// "push" and "pop" introduced in GCC 4.6; works with all clang +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) + #pragma GCC diagnostic push +#endif +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif @@ -490,6 +491,6 @@ namespace uhd { namespace niusrprio }} -#ifdef __GNUC__ +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) #pragma GCC diagnostic pop #endif diff --git a/host/lib/transport/nirio/niriok_proxy_impl_v2.cpp b/host/lib/transport/nirio/niriok_proxy_impl_v2.cpp index 8fb82708e..748db5cf8 100644 --- a/host/lib/transport/nirio/niriok_proxy_impl_v2.cpp +++ b/host/lib/transport/nirio/niriok_proxy_impl_v2.cpp @@ -19,9 +19,11 @@ #include <uhd/transport/nirio/niriok_proxy_impl_v2.h> #include <cstring> -#ifdef __clang__ - #pragma GCC diagnostic push ignored "-Wmissing-field-initializers" -#elif defined(__GNUC__) +// "push" and "pop" introduced in GCC 4.6; works with all clang +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) + #pragma GCC diagnostic push +#endif +#if defined(__clang__) || defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif @@ -642,6 +644,6 @@ namespace uhd { namespace niusrprio }} -#ifdef __GNUC__ +#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5) #pragma GCC diagnostic pop #endif diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 5c84327a4..c3c2b8e97 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -147,7 +147,7 @@ public: */ void set_xport_chan_get_buff(const size_t xport_chan, const get_buff_type &get_buff, const bool flush = false){ if (flush){ - while (get_buff(0.0)); + while (get_buff(0.0)) {}; } _props.at(xport_chan).get_buff = get_buff; } diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index c22eb86bc..647c64695 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -1122,6 +1122,6 @@ sensor_value_t b200_impl::get_ref_locked(void) sensor_value_t b200_impl::get_fe_pll_locked(const bool is_tx) { const boost::uint32_t st = _local_ctrl->peek32(RB32_CORE_PLL); - const bool locked = is_tx ? st & 0x1 : st & 0x2; + const bool locked = is_tx ? bool(st & 0x1) : bool(st & 0x2); return sensor_value_t("LO", locked, "locked", "unlocked"); } diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_synth_lut.h b/host/lib/usrp/common/ad9361_driver/ad9361_synth_lut.h index cb320e1f4..0475a5eb1 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_synth_lut.h +++ b/host/lib/usrp/common/ad9361_driver/ad9361_synth_lut.h @@ -6,20 +6,20 @@ #define INCLUDED_AD9361_SYNTH_LUT_HPP -double vco_index[53] = {12605000000, 12245000000, 11906000000, 11588000000, - 11288000000, 11007000000, 10742000000, 10492000000, - 10258000000, 10036000000, 9827800000, 9631100000, - 9445300000, 9269800000, 9103600000, 8946300000, - 8797000000, 8655300000, 8520600000, 8392300000, - 8269900000, 8153100000, 8041400000, 7934400000, - 7831800000, 7733200000, 7638400000, 7547100000, - 7459000000, 7374000000, 7291900000, 7212400000, - 7135500000, 7061000000, 6988700000, 6918600000, - 6850600000, 6784600000, 6720500000, 6658200000, - 6597800000, 6539200000, 6482300000, 6427000000, - 6373400000, 6321400000, 6270900000, 6222000000, - 6174500000, 6128400000, 6083600000, 6040100000, - 5997700000}; +double vco_index[53] = {12605000000.0, 12245000000.0, 11906000000.0, 11588000000.0, + 11288000000.0, 11007000000.0, 10742000000.0, 10492000000.0, + 10258000000.0, 10036000000.0, 9827800000.0, 9631100000.0, + 9445300000.0, 9269800000.0, 9103600000.0, 8946300000.0, + 8797000000.0, 8655300000.0, 8520600000.0, 8392300000.0, + 8269900000.0, 8153100000.0, 8041400000.0, 7934400000.0, + 7831800000.0, 7733200000.0, 7638400000.0, 7547100000.0, + 7459000000.0, 7374000000.0, 7291900000.0, 7212400000.0, + 7135500000.0, 7061000000.0, 6988700000.0, 6918600000.0, + 6850600000.0, 6784600000.0, 6720500000.0, 6658200000.0, + 6597800000.0, 6539200000.0, 6482300000.0, 6427000000.0, + 6373400000.0, 6321400000.0, 6270900000.0, 6222000000.0, + 6174500000.0, 6128400000.0, 6083600000.0, 6040100000.0, + 5997700000.0}; int synth_cal_lut[53][12] = { {10, 0, 4, 0, 15, 8, 8, 13, 4, 13, 15, 9}, {10, 0, 4, 0, 15, 8, 9, 13, 4, 13, 15, 9}, diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp index 13d69920a..8a131ffb4 100644 --- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp @@ -72,7 +72,7 @@ public: { UHD_SAFE_CALL ( - //NOP + ;//NOP ) } diff --git a/host/lib/usrp/cores/time_core_3000.cpp b/host/lib/usrp/cores/time_core_3000.cpp index aa5d5593d..ffae5dc0d 100644 --- a/host/lib/usrp/cores/time_core_3000.cpp +++ b/host/lib/usrp/cores/time_core_3000.cpp @@ -50,7 +50,7 @@ struct time_core_3000_impl : time_core_3000 { UHD_SAFE_CALL ( - //NOP + ;//NOP ) } @@ -71,8 +71,8 @@ struct time_core_3000_impl : time_core_3000 UHD_MSG(status) << ((test_fail)? " fail" : "pass") << std::endl; //useful warning for debugging actual rate - const size_t ticks_elapsed = _tick_rate*approx_secs; - const size_t appox_rate = ticks_elapsed/(sleep_millis/1e3); + const size_t ticks_elapsed = size_t(_tick_rate*approx_secs); + const size_t appox_rate = size_t(ticks_elapsed/(sleep_millis/1e3)); if (test_fail) UHD_MSG(warning) << "Expecting clock rate: " << (_tick_rate/1e6) << " MHz\n" << "Appoximate clock rate: " << (appox_rate/1e6) << " MHz\n" diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp index db7f84932..ad255460e 100644 --- a/host/lib/usrp/dboard/db_cbx.cpp +++ b/host/lib/usrp/dboard/db_cbx.cpp @@ -142,7 +142,7 @@ double sbx_xcvr::cbx::set_lo_freq(dboard_iface::unit_t unit, double target_freq) } //keep pfd freq low enough to achieve 50kHz BS clock - BS = std::ceil(pfd_freq / 50e3); + BS = int(std::ceil(pfd_freq / 50e3)); if(BS <= 1023) break; } diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index b6cc1421c..5184d2ecb 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -84,7 +84,7 @@ protected: // Get only regs with changes try { changed_regs = get_changed_addrs(); - } catch (uhd::runtime_error& e) { + } catch (uhd::runtime_error&) { // No saved state - write all regs for (int addr = 5; addr >= 0; addr--) changed_regs.insert(boost::uint32_t(addr)); diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 570c67875..1866255c9 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -848,7 +848,7 @@ public: * If device is in AGC mode it will ignore the setting. */ try { return rx_gain_group(chan)->set_value(gain, name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,rx); } } @@ -882,7 +882,7 @@ public: double get_rx_gain(const std::string &name, size_t chan){ try { return rx_gain_group(chan)->get_value(name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,rx); } } @@ -905,7 +905,7 @@ public: gain_range_t get_rx_gain_range(const std::string &name, size_t chan){ try { return rx_gain_group(chan)->get_range(name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,rx); } } @@ -1188,7 +1188,7 @@ public: void set_tx_gain(double gain, const std::string &name, size_t chan){ try { return tx_gain_group(chan)->set_value(gain, name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,tx); } } @@ -1207,7 +1207,7 @@ public: double get_tx_gain(const std::string &name, size_t chan){ try { return tx_gain_group(chan)->get_value(name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,tx); } } @@ -1230,7 +1230,7 @@ public: gain_range_t get_tx_gain_range(const std::string &name, size_t chan){ try { return tx_gain_group(chan)->get_range(name); - } catch (uhd::key_error &e) { + } catch (uhd::key_error &) { THROW_GAIN_NAME_ERROR(name,chan,tx); } } @@ -1352,7 +1352,7 @@ public: { if (_tree->exists(mb_root(mboard) / "gpio" / bank)) { - return _tree->access<boost::uint64_t>(mb_root(mboard) / "gpio" / bank / attr).get(); + return boost::uint32_t(_tree->access<boost::uint64_t>(mb_root(mboard) / "gpio" / bank / attr).get()); } if (bank.size() > 2 and bank[1] == 'X') { diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp index d55fab10e..b98d95725 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp @@ -417,7 +417,7 @@ std::string octoclock_impl::_get_images_help_message(const std::string &addr){ try{ image_location = uhd::find_image_path(image_name); } - catch(const std::exception &e){ + catch(const std::exception &){ return str(boost::format("Could not find %s in your images path.\n%s") % image_name % uhd::print_utility_error("uhd_images_downloader.py")); diff --git a/host/tests/chdr_test.cpp b/host/tests/chdr_test.cpp index 8893e12e5..ed6c690f9 100644 --- a/host/tests/chdr_test.cpp +++ b/host/tests/chdr_test.cpp @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(test_with_chdr){ if_packet_info.eob = false; if_packet_info.packet_count = 7; if_packet_info.has_tsf = true; - if_packet_info.tsf = 0x1234567890ABCDEF; + if_packet_info.tsf = 0x1234567890ABCDEFull; if_packet_info.sid = 0xAABBCCDD; if_packet_info.num_payload_words32 = 24; if_packet_info.num_payload_bytes = 95; @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(test_with_chdr_fc){ if_packet_info.eob = false; if_packet_info.packet_count = 19; if_packet_info.has_tsf = false; - if_packet_info.tsf = 0x1234567890ABCDEF; + if_packet_info.tsf = 0x1234567890ABCDEFull; if_packet_info.sid = 0xAABBCCDD; if_packet_info.num_payload_words32 = 4; if_packet_info.num_payload_bytes = 16; @@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(test_with_chdr_cmd){ if_packet_info.packet_type = if_packet_info_t::PACKET_TYPE_CMD; if_packet_info.packet_count = 19; if_packet_info.has_tsf = true; - if_packet_info.tsf = 0x1234567890ABCDEF; + if_packet_info.tsf = 0x1234567890ABCDEFull; if_packet_info.sid = 0xAABBCCDD; if_packet_info.num_payload_words32 = 4; if_packet_info.num_payload_bytes = 16; @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(test_with_chdr_resp){ if_packet_info.packet_type = if_packet_info_t::PACKET_TYPE_RESP; if_packet_info.packet_count = 123; if_packet_info.has_tsf = false; - if_packet_info.tsf = 0x1234567890ABCDEF; + if_packet_info.tsf = 0x1234567890ABCDEFull; if_packet_info.sid = 0xAABBCCDD; if_packet_info.num_payload_words32 = 4; if_packet_info.num_payload_bytes = 16; @@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(test_with_chdr_err){ if_packet_info.eob = false; if_packet_info.error = false; // Needs to be set explicitly if_packet_info.has_tsf = false; - if_packet_info.tsf = 0x1234567890ABCDEF; + if_packet_info.tsf = 0x1234567890ABCDEFull; if_packet_info.sid = 0xAABBCCDD; if_packet_info.num_payload_words32 = 4; if_packet_info.num_payload_bytes = 16; diff --git a/host/tests/fp_compare_delta_test.cpp b/host/tests/fp_compare_delta_test.cpp index 9b009a79d..36ff14756 100644 --- a/host/tests/fp_compare_delta_test.cpp +++ b/host/tests/fp_compare_delta_test.cpp @@ -101,8 +101,8 @@ BOOST_AUTO_TEST_CASE(double_equality_operators) { BOOST_AUTO_TEST_CASE(float_inequality_operators) { // Test inequality operator, which is based on equality operator - fp_compare_delta<float> alpha = fp_compare_delta<float>(127.0); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 1.19e-3); + fp_compare_delta<float> alpha = fp_compare_delta<float>(127.0f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 1.19e-3f); BOOST_CHECK(alpha != beta); BOOST_CHECK(alpha != float(alpha._value + 1.19e-3)); @@ -119,17 +119,17 @@ BOOST_AUTO_TEST_CASE(double_inequality_operators) { BOOST_AUTO_TEST_CASE(float_lessthan_operators) { // Test less-than operator - fp_compare_delta<float> alpha = fp_compare_delta<float>(274192.7); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value - 0.2); + fp_compare_delta<float> alpha = fp_compare_delta<float>(274192.7f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value - 0.2f); BOOST_CHECK(beta < alpha); BOOST_CHECK(float(alpha._value - 0.2) < alpha); // Confirm false less-than case - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2f); BOOST_CHECK(not (alpha < charlie)); - BOOST_CHECK(not (alpha < float(alpha._value - 1.2))); + BOOST_CHECK(not (alpha < float(alpha._value - 1.2f))); } BOOST_AUTO_TEST_CASE(double_lessthan_operators) { @@ -149,14 +149,14 @@ BOOST_AUTO_TEST_CASE(double_lessthan_operators) { BOOST_AUTO_TEST_CASE(float_lessthanequals_operators) { // Test that <= correctly reports for equal values - fp_compare_delta<float> alpha = fp_compare_delta<float>(827.3); + fp_compare_delta<float> alpha = fp_compare_delta<float>(827.3f); fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value); BOOST_CHECK(alpha <= beta); BOOST_CHECK(alpha <= float(alpha._value)); // Test that <= correctly reports for less-than values - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value - 1.2f); BOOST_CHECK(charlie <= alpha); BOOST_CHECK(float(alpha._value - 1.2) <= alpha); @@ -179,14 +179,14 @@ BOOST_AUTO_TEST_CASE(double_lessthanequals_operators) { BOOST_AUTO_TEST_CASE(float_greaterthan_operators) { // Test basic greater-than functionality - fp_compare_delta<float> alpha = fp_compare_delta<float>(98325.4); - fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 0.15); + fp_compare_delta<float> alpha = fp_compare_delta<float>(98325.4f); + fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value + 0.15f); BOOST_CHECK(beta > alpha); BOOST_CHECK(float(alpha._value + 0.15) > alpha); // Test false greater-than case - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 1.2); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 1.2f); BOOST_CHECK(not (alpha > charlie)); BOOST_CHECK(not (alpha > float(alpha._value + 1.2))); @@ -209,14 +209,14 @@ BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { BOOST_AUTO_TEST_CASE(float_greaterthanequals_operators) { // Test that >= correctly reports for equal values - fp_compare_delta<float> alpha = fp_compare_delta<float>(7834.89); + fp_compare_delta<float> alpha = fp_compare_delta<float>(7834.89f); fp_compare_delta<float> beta = fp_compare_delta<float>(alpha._value); BOOST_CHECK(alpha >= beta); BOOST_CHECK(alpha >= float(alpha._value)); // Test that >= correctly reports for greater-than values - fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 4.8); + fp_compare_delta<float> charlie = fp_compare_delta<float>(alpha._value + 4.8f); BOOST_CHECK(charlie >= alpha); BOOST_CHECK(float(alpha._value + 4.8) >= alpha); @@ -239,12 +239,12 @@ BOOST_AUTO_TEST_CASE(double_greaterthanequals_operators) { BOOST_AUTO_TEST_CASE(frequency_compare_function) { - BOOST_CHECK(uhd::math::frequencies_are_equal(6817333232, 6817333232)); - BOOST_CHECK(!uhd::math::frequencies_are_equal(6817333233, 6817333232)); + BOOST_CHECK(uhd::math::frequencies_are_equal(6817333232.0, 6817333232.0)); + BOOST_CHECK(!uhd::math::frequencies_are_equal(6817333233.0, 6817333232.0)); BOOST_CHECK(uhd::math::frequencies_are_equal(6817333232.1, 6817333232.1)); BOOST_CHECK(!uhd::math::frequencies_are_equal(6817333232.5, 6817333232.6)); BOOST_CHECK(uhd::math::frequencies_are_equal(16.8173332321e9, 16.8173332321e9)); BOOST_CHECK(!uhd::math::frequencies_are_equal(16.8173332322e9, 16.8173332321e9)); BOOST_CHECK(!uhd::math::frequencies_are_equal(5.0, 4.0)); - BOOST_CHECK(uhd::math::frequencies_are_equal(48750000, 48749999.9946)); + BOOST_CHECK(uhd::math::frequencies_are_equal(48750000.0, 48749999.9946)); } diff --git a/host/tests/fp_compare_epsilon_test.cpp b/host/tests/fp_compare_epsilon_test.cpp index 5790318c2..45687ad26 100644 --- a/host/tests/fp_compare_epsilon_test.cpp +++ b/host/tests/fp_compare_epsilon_test.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(fp_compare_epsilon_constructors) { // Test constructor with specified epsilon fp_compare_epsilon<float> foxtrot = fp_compare_epsilon<float>(alpha._value, uhd::math::SINGLE_PRECISION_EPSILON); - fp_compare_epsilon<float> gamma = fp_compare_epsilon<float>(alpha._value, 2.0e-1); + fp_compare_epsilon<float> gamma = fp_compare_epsilon<float>(alpha._value, 2.0e-1f); BOOST_CHECK_EQUAL(alpha._epsilon, foxtrot._epsilon); BOOST_CHECK(not (alpha._epsilon == gamma._epsilon)); @@ -102,10 +102,10 @@ BOOST_AUTO_TEST_CASE(double_equality_operators) { BOOST_AUTO_TEST_CASE(float_inequality_operators) { // Test inequality operator, which is based on equality operator fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(127.0); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 1.19e-5); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 1.19e-5f); BOOST_CHECK(alpha != beta); - BOOST_CHECK(alpha != float(alpha._value + 1.19e-5)); + BOOST_CHECK(alpha != float(alpha._value + 1.19e-5f)); } BOOST_AUTO_TEST_CASE(double_inequality_operators) { @@ -119,17 +119,17 @@ BOOST_AUTO_TEST_CASE(double_inequality_operators) { BOOST_AUTO_TEST_CASE(float_lessthan_operators) { // Test less-than operator - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(274192.7); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value - 0.15); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(274192.7f); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value - 0.15f); BOOST_CHECK(beta < alpha); BOOST_CHECK(float(alpha._value - 0.15) < alpha); // Confirm false less-than case - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2f); BOOST_CHECK(not (alpha < charlie)); - BOOST_CHECK(not (alpha < float(alpha._value - 1.2))); + BOOST_CHECK(not (alpha < float(alpha._value - 1.2f))); } BOOST_AUTO_TEST_CASE(double_lessthan_operators) { @@ -149,14 +149,14 @@ BOOST_AUTO_TEST_CASE(double_lessthan_operators) { BOOST_AUTO_TEST_CASE(float_lessthanequals_operators) { // Test that <= correctly reports for equal values - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(827.3); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(827.3f); fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value); BOOST_CHECK(alpha <= beta); BOOST_CHECK(alpha <= float(alpha._value)); // Test that <= correctly reports for less-than values - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value - 1.2f); BOOST_CHECK(charlie <= alpha); BOOST_CHECK(float(alpha._value - 1.2) <= alpha); @@ -179,17 +179,17 @@ BOOST_AUTO_TEST_CASE(double_lessthanequals_operators) { BOOST_AUTO_TEST_CASE(float_greaterthan_operators) { // Test basic greater-than functionality - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(98325.4); - fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 0.15); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(98325.4f); + fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value + 0.15f); BOOST_CHECK(beta > alpha); BOOST_CHECK(float(alpha._value + 0.15) > alpha); // Test false greater-than case - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 1.2); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 1.2f); BOOST_CHECK(not (alpha > charlie)); - BOOST_CHECK(not (alpha > float(alpha._value + 1.2))); + BOOST_CHECK(not (alpha > float(alpha._value + 1.2f))); } BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { @@ -209,17 +209,17 @@ BOOST_AUTO_TEST_CASE(double_greaterthan_operators) { BOOST_AUTO_TEST_CASE(float_greaterthanequals_operators) { // Test that >= correctly reports for equal values - fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(7834.89); + fp_compare_epsilon<float> alpha = fp_compare_epsilon<float>(7834.89f); fp_compare_epsilon<float> beta = fp_compare_epsilon<float>(alpha._value); BOOST_CHECK(alpha >= beta); BOOST_CHECK(alpha >= float(alpha._value)); // Test that >= correctly reports for greater-than values - fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 4.8); + fp_compare_epsilon<float> charlie = fp_compare_epsilon<float>(alpha._value + 4.8f); BOOST_CHECK(charlie >= alpha); - BOOST_CHECK(float(alpha._value + 4.8) >= alpha); + BOOST_CHECK(float(alpha._value + 4.8f) >= alpha); } BOOST_AUTO_TEST_CASE(double_greaterthanequals_operators) { diff --git a/host/tests/sid_t_test.cpp b/host/tests/sid_t_test.cpp index 71ab2c213..b5cdeb3d8 100644 --- a/host/tests/sid_t_test.cpp +++ b/host/tests/sid_t_test.cpp @@ -30,12 +30,12 @@ BOOST_AUTO_TEST_CASE(test_sid_t) { BOOST_CHECK_EQUAL(sid.is_set(), true); BOOST_CHECK_EQUAL(sid.to_pp_string(), "1.2>3.16"); BOOST_CHECK_EQUAL(sid.to_pp_string_hex(), "01:02>03:10"); - BOOST_CHECK_EQUAL(sid.get_src(), 0x0102); - BOOST_CHECK_EQUAL(sid.get_dst(), 0x0310); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x01); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x02); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x03); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x10); + BOOST_CHECK_EQUAL(sid.get_src(), (uint32_t)0x0102); + BOOST_CHECK_EQUAL(sid.get_dst(), (uint32_t)0x0310); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x01); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x10); BOOST_CHECK_EQUAL(sid == sid, true); BOOST_CHECK_EQUAL(sid == sid_value, true); @@ -68,88 +68,88 @@ BOOST_AUTO_TEST_CASE(test_sid_t_set) { sid_t sid(sid_value); sid.set(0x01020304); - BOOST_CHECK_EQUAL(sid.get(), 0x01020304); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x01); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x02); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x03); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x04); - BOOST_CHECK_EQUAL(sid.get_dst_xbarport(), 0x0); - BOOST_CHECK_EQUAL(sid.get_dst_blockport(), 0x4); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x01020304); + BOOST_CHECK_EQUAL(sid.get_src_addr(),(uint32_t)0x01); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04); + BOOST_CHECK_EQUAL(sid.get_dst_xbarport(), (uint32_t)0x0); + BOOST_CHECK_EQUAL(sid.get_dst_blockport(), (uint32_t)0x4); sid.set_src_addr(0x0a); - BOOST_CHECK_EQUAL(sid.get(), 0x0a020304); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x02); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x03); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x04); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a020304); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04); sid.set_src_endpoint(0x0b); - BOOST_CHECK_EQUAL(sid.get(), 0x0a0b0304); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x0b); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x03); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x04); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0304); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04); sid.set_dst_addr(0x0c); - BOOST_CHECK_EQUAL(sid.get(), 0x0a0b0c04); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x0b); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x0c); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x04); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0c04); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04); sid.set_dst_endpoint(0x0d); - BOOST_CHECK_EQUAL(sid.get(), 0x0a0b0c0d); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x0b); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x0c); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0x0d); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0c0d); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x0d); sid.set_dst_xbarport(0xb); - BOOST_CHECK_EQUAL(sid.get(), 0x0a0b0cbd); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x0b); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x0c); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0xbd); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0cbd); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0xbd); sid.set_dst_blockport(0xc); - BOOST_CHECK_EQUAL(sid.get(), 0x0a0b0cbc); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 0x0a); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 0x0b); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 0x0c); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 0xbc); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0cbc); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0xbc); sid_t flipped_sid = sid.reversed(); - BOOST_CHECK_EQUAL(flipped_sid.get(), 0x0cbc0a0b); + BOOST_CHECK_EQUAL(flipped_sid.get(), (uint32_t)0x0cbc0a0b); // In-place sid.reverse(); - BOOST_CHECK_EQUAL(sid.get(), 0x0cbc0a0b); + BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0cbc0a0b); } BOOST_AUTO_TEST_CASE(test_sid_t_from_str) { sid_t sid("1.2>3.4"); - BOOST_CHECK_EQUAL(sid.get_src_addr(), 1); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 2); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 3); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 4); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)4); sid = "01:02>03:10"; - BOOST_CHECK_EQUAL(sid.get_src_addr(), 1); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 2); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 3); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 16); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16); sid = "01:06/03:10"; - BOOST_CHECK_EQUAL(sid.get_src_addr(), 1); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 6); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 3); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 16); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)6); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16); sid = "01:02:04:10"; - BOOST_CHECK_EQUAL(sid.get_src_addr(), 1); - BOOST_CHECK_EQUAL(sid.get_src_endpoint(), 2); - BOOST_CHECK_EQUAL(sid.get_dst_addr(), 4); - BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), 16); + BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1); + BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2); + BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)4); + BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16); BOOST_REQUIRE_THROW(sid_t fail_sid("foobar"), uhd::value_error); BOOST_REQUIRE_THROW(sid_t fail_sid("01:02:03:4"), uhd::value_error); diff --git a/host/tests/sph_recv_test.cpp b/host/tests/sph_recv_test.cpp index 5dd0761db..e8c51b847 100644 --- a/host/tests/sph_recv_test.cpp +++ b/host/tests/sph_recv_test.cpp @@ -675,7 +675,7 @@ BOOST_AUTO_TEST_CASE(test_sph_recv_multi_channel_fragment){ BOOST_CHECK_EQUAL(metadata.error_code, uhd::rx_metadata_t::ERROR_CODE_NONE); BOOST_CHECK(metadata.has_time_spec); BOOST_CHECK_TS_CLOSE(metadata.time_spec, uhd::time_spec_t::from_ticks(num_accum_samps, SAMP_RATE)); - BOOST_CHECK_EQUAL(num_samps_ret, 10); + BOOST_CHECK_EQUAL(num_samps_ret, (size_t)10); num_accum_samps += num_samps_ret; if (not metadata.more_fragments) continue; @@ -685,7 +685,7 @@ BOOST_AUTO_TEST_CASE(test_sph_recv_multi_channel_fragment){ ); BOOST_CHECK_EQUAL(metadata.error_code, uhd::rx_metadata_t::ERROR_CODE_NONE); BOOST_CHECK(not metadata.more_fragments); - BOOST_CHECK_EQUAL(metadata.fragment_offset, 10); + BOOST_CHECK_EQUAL(metadata.fragment_offset, (size_t)10); BOOST_CHECK(metadata.has_time_spec); BOOST_CHECK_TS_CLOSE(metadata.time_spec, uhd::time_spec_t::from_ticks(num_accum_samps, SAMP_RATE)); BOOST_CHECK_EQUAL(num_samps_ret, i%10); diff --git a/host/tests/sph_send_test.cpp b/host/tests/sph_send_test.cpp index 603b36c85..58d47c76d 100644 --- a/host/tests/sph_send_test.cpp +++ b/host/tests/sph_send_test.cpp @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(test_sph_send_one_channel_full_buffer_mode){ for (size_t i = 0; i < NUM_PKTS_TO_TEST; i++){ std::cout << "data check " << i << std::endl; dummy_send_xport.pop_front_packet(ifpi); - BOOST_CHECK_EQUAL(ifpi.num_payload_words32, 20); + BOOST_CHECK_EQUAL(ifpi.num_payload_words32, (size_t)20); BOOST_CHECK(ifpi.has_tsf); BOOST_CHECK_EQUAL(ifpi.tsf, num_accum_samps*TICK_RATE/SAMP_RATE); BOOST_CHECK_EQUAL(ifpi.sob, i == 0); diff --git a/host/tests/time_spec_test.cpp b/host/tests/time_spec_test.cpp index c9b9652f9..b98bea7d9 100644 --- a/host/tests/time_spec_test.cpp +++ b/host/tests/time_spec_test.cpp @@ -112,8 +112,8 @@ BOOST_AUTO_TEST_CASE(test_time_large_ticks_to_time_spec) BOOST_AUTO_TEST_CASE(test_time_error_irrational_rate) { - static const double rate = 1625e3/6; - const long long tick_in = 23423436291667; + static const double rate = 1625e3/6.0; + const long long tick_in = 23423436291667ll; const uhd::time_spec_t ts = uhd::time_spec_t::from_ticks(tick_in, rate); const long long tick_out = ts.to_ticks(rate); const long long err = tick_in - tick_out; diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index 081141048..bc14932f1 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -186,7 +186,7 @@ uhd::transport::usb_device_handle::sptr open_device(const boost::uint16_t vid, c if (!handle) std::cerr << "Cannot open device" << std::endl; } - catch(const std::exception &e) { + catch(const std::exception &) { std::cerr << "Failed to communicate with the device!" << std::endl; #ifdef UHD_PLATFORM_WIN32 std::cerr << "The necessary drivers are not installed. Read the UHD Transport Application Notes for details:\nhttp://files.ettus.com/manual/page_transport.html" << std::endl; @@ -208,7 +208,7 @@ b200_iface::sptr make_b200_iface(const uhd::transport::usb_device_handle::sptr & if (!b200) std::cerr << "Cannot create device interface" << std::endl; } - catch(const std::exception &e) { + catch(const std::exception &) { std::cerr << "Failed to communicate with the device!" << std::endl; #ifdef UHD_PLATFORM_WIN32 std::cerr << "The necessary drivers are not installed. Read the UHD Transport Application Notes for details:\nhttp://files.ettus.com/manual/page_transport.html" << std::endl; diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp index 05f918eb4..9a40d2b42 100644 --- a/host/utils/query_gpsdo_sensors.cpp +++ b/host/utils/query_gpsdo_sensors.cpp @@ -118,7 +118,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::sensor_value_t rmc_string = usrp->get_mboard_sensor("gps_gprmc"); std::cout << boost::format("Printing available NMEA strings:\n"); std::cout << boost::format("%s\n%s\n%s\n") % gga_string.to_pp_string() % rmc_string.to_pp_string() % gps_time.to_pp_string(); - } catch (std::exception &e) { + } catch (std::exception &) { std::cout << "NMEA strings not implemented for this device." << std::endl; } std::cout << boost::format("UHD Device time: %.0f seconds\n") % (last_pps_time.get_real_secs()); diff --git a/host/utils/usrp_cal_utils.hpp b/host/utils/usrp_cal_utils.hpp index c027a4785..ccdb0a61d 100644 --- a/host/utils/usrp_cal_utils.hpp +++ b/host/utils/usrp_cal_utils.hpp @@ -249,7 +249,7 @@ static void capture_samples( // Right after the stream is started, there will be transient data. // That transient data is discarded and only "good" samples are returned. - size_t nsamps_to_discard = usrp->get_rx_rate() * 0.001; // 1ms to be discarded + size_t nsamps_to_discard = size_t(usrp->get_rx_rate() * 0.001); // 1ms to be discarded std::vector<samp_type> discard_buff(nsamps_to_discard); uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE); |