aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-01-08 09:33:36 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-04 08:07:26 -0600
commit107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 (patch)
treefdeaad56030a02948377c45838dab97beb7a5c84 /host/examples
parent7d5e48032baa62cbe7467833b9e057900602f4b9 (diff)
downloaduhd-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/examples')
-rw-r--r--host/examples/gpio.cpp4
-rw-r--r--host/examples/test_dboard_coercion.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/host/examples/gpio.cpp b/host/examples/gpio.cpp
index 12bcd26f7..d4a188c66 100644
--- a/host/examples/gpio.cpp
+++ b/host/examples/gpio.cpp
@@ -214,9 +214,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
std::cout << "Using GPIO bank: " << gpio << std::endl;
// subdev spec
- if (tx_subdev_spec != "")
+ if (!tx_subdev_spec.empty())
usrp->set_tx_subdev_spec(tx_subdev_spec);
- if (rx_subdev_spec != "")
+ if (!rx_subdev_spec.empty())
usrp->set_rx_subdev_spec(rx_subdev_spec);
std::cout << boost::format(" rx_subdev_spec: %s")
% usrp->get_rx_subdev_spec(0).to_string()
diff --git a/host/examples/test_dboard_coercion.cpp b/host/examples/test_dboard_coercion.cpp
index 0fb6f1872..7dd053610 100644
--- a/host/examples/test_dboard_coercion.cpp
+++ b/host/examples/test_dboard_coercion.cpp
@@ -44,7 +44,7 @@ std::string return_usrp_config_string(
std::string rx_serial, rx_subdev_name, rx_subdev_spec;
mboard_id = tx_info.get("mboard_id");
- if (tx_info.get("mboard_serial") == "")
+ if (tx_info.get("mboard_serial").empty())
mboard_serial = "no serial";
else
mboard_serial = tx_info.get("mboard_serial");
@@ -53,7 +53,7 @@ std::string return_usrp_config_string(
str(boost::format("Motherboard: %s (%s)\n") % mboard_id % mboard_serial);
if (test_tx) {
- if (tx_info.get("tx_serial") == "")
+ if (tx_info.get("tx_serial").empty())
tx_serial = "no serial";
else
tx_serial = tx_info.get("tx_serial");
@@ -68,7 +68,7 @@ std::string return_usrp_config_string(
if (test_tx and test_rx)
info_string += "\n";
if (test_rx) {
- if (rx_info.get("rx_serial") == "")
+ if (rx_info.get("rx_serial").empty())
rx_serial = "no serial";
else
rx_serial = rx_info.get("rx_serial");