diff options
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/ascii_art_dft.hpp | 6 | ||||
-rw-r--r-- | host/examples/benchmark_rate.cpp | 12 | ||||
-rw-r--r-- | host/examples/gpio.cpp | 2 | ||||
-rw-r--r-- | host/examples/replay_samples_from_file.cpp | 2 | ||||
-rw-r--r-- | host/examples/rfnoc-example/lib/gain_block_control.cpp | 5 | ||||
-rw-r--r-- | host/examples/test_messages.cpp | 2 | ||||
-rw-r--r-- | host/examples/txrx_loopback_to_file.cpp | 2 | ||||
-rw-r--r-- | host/examples/wavetable.hpp | 3 |
8 files changed, 17 insertions, 17 deletions
diff --git a/host/examples/ascii_art_dft.hpp b/host/examples/ascii_art_dft.hpp index 84c008bbf..7dddad42e 100644 --- a/host/examples/ascii_art_dft.hpp +++ b/host/examples/ascii_art_dft.hpp @@ -65,13 +65,15 @@ namespace { /*anon*/ static const double pi = double(std::acos(-1.0)); //! Round a floating-point value to the nearest integer -template <typename T> int iround(T val) +template <typename T> +int iround(T val) { return (val > 0) ? int(val + 0.5) : int(val - 0.5); } //! Pick the closest number that is nice to display -template <typename T> T to_clean_num(const T num) +template <typename T> +T to_clean_num(const T num) { if (num == 0) return 0; diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp index da90c19bd..3db5b88a0 100644 --- a/host/examples/benchmark_rate.cpp +++ b/host/examples/benchmark_rate.cpp @@ -81,10 +81,10 @@ void benchmark_rx_rate(uhd::usrp::multi_usrp::sptr usrp, } // print pre-test summary - auto time_stamp = NOW(); - auto rx_rate = usrp->get_rx_rate() / 1e6; + auto time_stamp = NOW(); + auto rx_rate = usrp->get_rx_rate() / 1e6; auto num_channels = rx_stream->get_num_channels(); - std::cout << boost::format("[%s] Testing receive rate %f Msps on %u channels\n") + std::cout << boost::format("[%s] Testing receive rate %f Msps on %u channels\n") % time_stamp % rx_rate % num_channels; // setup variables and allocate buffer @@ -213,8 +213,8 @@ void benchmark_tx_rate(uhd::usrp::multi_usrp::sptr usrp, } // print pre-test summary - auto time_stamp = NOW(); - auto tx_rate = usrp->get_tx_rate() / 1e6; + auto time_stamp = NOW(); + auto tx_rate = usrp->get_tx_rate() / 1e6; auto num_channels = tx_stream->get_num_channels(); std::cout << boost::format("[%s] Testing transmit rate %f Msps on %u channels\n") % time_stamp % tx_rate % num_channels; @@ -592,7 +592,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) } else { duration += tx_delay; } - const int64_t secs = int64_t(duration); + const int64_t secs = int64_t(duration); const int64_t usecs = int64_t((duration - secs) * 1e6); std::this_thread::sleep_for( std::chrono::seconds(secs) + std::chrono::microseconds(usecs)); diff --git a/host/examples/gpio.cpp b/host/examples/gpio.cpp index 103060908..962e97450 100644 --- a/host/examples/gpio.cpp +++ b/host/examples/gpio.cpp @@ -321,7 +321,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) uhd::tx_metadata_t tx_md; tx_md.has_time_spec = false; tx_md.start_of_burst = true; - double timeout = 0.01; + double timeout = 0.01; auto dwell_time = std::chrono::milliseconds(static_cast<int64_t>(dwell * 1000)); int loop = 0; diff --git a/host/examples/replay_samples_from_file.cpp b/host/examples/replay_samples_from_file.cpp index c0443adfa..a384f1131 100644 --- a/host/examples/replay_samples_from_file.cpp +++ b/host/examples/replay_samples_from_file.cpp @@ -127,7 +127,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) if (vm.count("ref")) { radio_ctrl->set_clock_source(ref); } - + // Apply any radio arguments provided radio_ctrl->set_args(radio_args); diff --git a/host/examples/rfnoc-example/lib/gain_block_control.cpp b/host/examples/rfnoc-example/lib/gain_block_control.cpp index d53bafc8b..8cc9cc327 100644 --- a/host/examples/rfnoc-example/lib/gain_block_control.cpp +++ b/host/examples/rfnoc-example/lib/gain_block_control.cpp @@ -19,9 +19,7 @@ const uint32_t gain_block_control::REG_GAIN_VALUE = 0x00; class gain_block_control_impl : public gain_block_control { public: - RFNOC_BLOCK_CONSTRUCTOR(gain_block_control) - { - } + RFNOC_BLOCK_CONSTRUCTOR(gain_block_control) {} void set_gain_value(const uint32_t gain) { @@ -34,7 +32,6 @@ public: } private: - }; UHD_RFNOC_BLOCK_REGISTER_DIRECT( diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp index 78abd3c29..fb930ac7c 100644 --- a/host/examples/test_messages.cpp +++ b/host/examples/test_messages.cpp @@ -13,12 +13,12 @@ #include <uhd/utils/static.hpp> #include <uhd/utils/thread.hpp> #include <boost/assign/list_of.hpp> -#include <functional> #include <boost/format.hpp> #include <boost/program_options.hpp> #include <complex> #include <cstdlib> #include <ctime> +#include <functional> #include <iostream> namespace po = boost::program_options; diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index 4c059577c..39af6401b 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -290,7 +290,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) tx_usrp->set_clock_source(ref); rx_usrp->set_clock_source(ref); } - + std::cout << boost::format("Using TX Device: %s") % tx_usrp->get_pp_string() << std::endl; std::cout << boost::format("Using RX Device: %s") % rx_usrp->get_pp_string() diff --git a/host/examples/wavetable.hpp b/host/examples/wavetable.hpp index 73401220f..216fe5012 100644 --- a/host/examples/wavetable.hpp +++ b/host/examples/wavetable.hpp @@ -34,7 +34,8 @@ public: } else if (wave_type == "SINE") { static const double tau = 2 * std::acos(-1.0); for (size_t i = 0; i < wave_table_len; i++) { - real_wave_table[i] = static_cast<float>(std::sin((tau * i) / wave_table_len)); + real_wave_table[i] = + static_cast<float>(std::sin((tau * i) / wave_table_len)); } } else { throw std::runtime_error("unknown waveform type: " + wave_type); |