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/x300/x300_image_loader.cpp | |
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/x300/x300_image_loader.cpp')
-rw-r--r-- | host/lib/usrp/x300/x300_image_loader.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/usrp/x300/x300_image_loader.cpp b/host/lib/usrp/x300/x300_image_loader.cpp index 474aed4cb..f18af02b7 100644 --- a/host/lib/usrp/x300/x300_image_loader.cpp +++ b/host/lib/usrp/x300/x300_image_loader.cpp @@ -180,7 +180,7 @@ static void x300_setup_session(x300_session_t& session, const std::string& outpath) { device_addrs_t devs = x300_find(args); - if (devs.size() == 0) { + if (devs.empty()) { session.found = false; return; } else if (devs.size() > 1) { @@ -224,8 +224,8 @@ static void x300_setup_session(x300_session_t& session, * If this cannot be determined, then the user is forced to specify a filename. */ session.fpga_type = args.get("fpga", session.dev_addr.get("fpga", "")); - if (filepath == "") { - if (!session.dev_addr.has_key("product") or session.fpga_type == "") { + if (filepath.empty()) { + if (!session.dev_addr.has_key("product") or session.fpga_type.empty()) { throw uhd::runtime_error( "Found a device but could not auto-generate an image filename."); } else { @@ -243,8 +243,8 @@ static void x300_setup_session(x300_session_t& session, * The user can specify an output image path, or UHD will use the * system temporary path by default */ - if (outpath == "") { - if (!session.dev_addr.has_key("product") or session.fpga_type == "") { + if (outpath.empty()) { + if (!session.dev_addr.has_key("product") or session.fpga_type.empty()) { throw uhd::runtime_error( "Found a device but could not auto-generate an image filename."); } @@ -598,7 +598,7 @@ static bool x300_image_loader(const image_loader::image_loader_args_t& image_loa // See if any X3x0 with the given args is found device_addrs_t devs = x300_find(image_loader_args.args); - if (devs.size() == 0) + if (devs.empty()) return false; x300_session_t session; |