From 107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 8 Jan 2021 09:33:36 +0100 Subject: 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 --- host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp_clock/octoclock/octoclock_image_loader.cpp') 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") { -- cgit v1.2.3