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/utils/b2xx_fx3_utils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'host/utils/b2xx_fx3_utils.cpp') diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index b75ff6960..65c4e52ca 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -173,7 +173,7 @@ uhd::transport::usb_device_handle::sptr open_device( std::vector vid_pid_pair_list( 1, uhd::transport::usb_device_handle::vid_pid_pair_t(vid, pid)); handles = uhd::transport::usb_device_handle::get_device_list(vid_pid_pair_list); - if (handles.size() == 0) { + if (handles.empty()) { if (user_supplied) { std::cerr << (boost::format("Failed to open device with VID 0x%04x and " "PID 0x%04x - trying other known VID/PIDs") @@ -183,15 +183,14 @@ uhd::transport::usb_device_handle::sptr open_device( } // try known VID/PIDs next - for (size_t i = 0; handles.size() == 0 && i < known_vid_pid_vector.size(); - i++) { + for (size_t i = 0; handles.empty() && i < known_vid_pid_vector.size(); i++) { vp = known_vid_pid_vector[i]; handles = uhd::transport::usb_device_handle::get_device_list(vp.vid, vp.pid); } } - if (handles.size() > 0) { + if (!handles.empty()) { handle = handles[0]; std::cout << (boost::format("Device opened (VID=0x%04x,PID=0x%04x)") % vp.vid % vp.pid) -- cgit v1.2.3