diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-01-08 09:33:36 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-03-04 08:07:26 -0600 |
commit | 107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 (patch) | |
tree | fdeaad56030a02948377c45838dab97beb7a5c84 /host/lib/usrp_clock/octoclock | |
parent | 7d5e48032baa62cbe7467833b9e057900602f4b9 (diff) | |
download | uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.gz uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.bz2 uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.zip |
host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:
$ find . -name "*.cpp" | sort -u | xargs \
--max-procs 8 --max-args 1 clang-tidy --format-style=file \
--fix -p /path/to/compile_commands.json
Diffstat (limited to 'host/lib/usrp_clock/octoclock')
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_impl.hpp | 8 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_uart.hpp | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp b/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp index c588404aa..aba161584 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp @@ -125,7 +125,7 @@ static void octoclock_setup_session(octoclock_session_t& session, { // See if we can find an OctoClock with the given args device_addrs_t devs = octoclock_find(args); - if (devs.size() == 0) { + if (devs.empty()) { session.found = false; return; } else if (devs.size() > 1) { @@ -151,7 +151,7 @@ static void octoclock_setup_session(octoclock_session_t& session, session.found = true; // If no filepath is given, use the default - if (filepath == "") { + if (filepath.empty()) { session.image_filepath = find_image_path(str(boost::format("octoclock_r%s_fw.hex") % session.dev_addr.get("revision", "4"))); @@ -207,7 +207,7 @@ static void octoclock_reset_into_bootloader(octoclock_session_t& session) std::this_thread::sleep_for(std::chrono::milliseconds(500)); uhd::device_addrs_t octoclocks = uhd::device::find( uhd::device_addr_t(str(boost::format("addr=%s") % session.dev_addr["addr"]))); - if (octoclocks.size() == 0) { + if (octoclocks.empty()) { std::cout << "failed." << std::endl; throw uhd::runtime_error("Failed to reset OctoClock."); } else if (octoclocks[0]["type"] != "octoclock-bootloader") { diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp index 8f36b17a0..86fd5342d 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp @@ -34,13 +34,13 @@ class octoclock_impl : public uhd::device { public: octoclock_impl(const uhd::device_addr_t&); - ~octoclock_impl(void){}; + ~octoclock_impl(void) override{}; - uhd::rx_streamer::sptr get_rx_stream(const uhd::stream_args_t& args); + uhd::rx_streamer::sptr get_rx_stream(const uhd::stream_args_t& args) override; - uhd::tx_streamer::sptr get_tx_stream(const uhd::stream_args_t& args); + uhd::tx_streamer::sptr get_tx_stream(const uhd::stream_args_t& args) override; - bool recv_async_msg(uhd::async_metadata_t&, double); + bool recv_async_msg(uhd::async_metadata_t&, double) override; private: struct oc_container_type diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.hpp b/host/lib/usrp_clock/octoclock/octoclock_uart.hpp index 02fcf25e3..6a43e5ce8 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_uart.hpp +++ b/host/lib/usrp_clock/octoclock/octoclock_uart.hpp @@ -25,10 +25,10 @@ class octoclock_uart_iface : public uhd::uart_iface { public: octoclock_uart_iface(uhd::transport::udp_simple::sptr udp, uint32_t proto_ver); - ~octoclock_uart_iface(void){}; + ~octoclock_uart_iface(void) override{}; - void write_uart(const std::string& buf); - std::string read_uart(double timeout); + void write_uart(const std::string& buf) override; + std::string read_uart(double timeout) override; private: uhd::transport::udp_simple::sptr _udp; |