aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types
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/lib/types
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/lib/types')
-rw-r--r--host/lib/types/device_addr.cpp2
-rw-r--r--host/lib/types/mac_addr.cpp2
-rw-r--r--host/lib/types/serial.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/types/device_addr.cpp b/host/lib/types/device_addr.cpp
index d5e9ce0d4..01dd46f5c 100644
--- a/host/lib/types/device_addr.cpp
+++ b/host/lib/types/device_addr.cpp
@@ -29,7 +29,7 @@ static std::string trim(const std::string& in)
device_addr_t::device_addr_t(const std::string& args)
{
for (const std::string& pair : tokenizer(args, arg_delim)) {
- if (trim(pair) == "")
+ if (trim(pair).empty())
continue;
std::vector<std::string> toks;
for (const std::string& tok : tokenizer(pair, pair_delim)) {
diff --git a/host/lib/types/mac_addr.cpp b/host/lib/types/mac_addr.cpp
index a2f3dec3a..4a9972f1c 100644
--- a/host/lib/types/mac_addr.cpp
+++ b/host/lib/types/mac_addr.cpp
@@ -60,7 +60,7 @@ std::string mac_addr_t::to_string(void) const
{
std::string addr = "";
for (uint8_t byte : this->to_bytes()) {
- addr += str(boost::format("%s%02x") % ((addr == "") ? "" : ":") % int(byte));
+ addr += str(boost::format("%s%02x") % ((addr.empty()) ? "" : ":") % int(byte));
}
return addr;
}
diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp
index e146b4c6c..67272e62e 100644
--- a/host/lib/types/serial.cpp
+++ b/host/lib/types/serial.cpp
@@ -63,17 +63,17 @@ struct eeprom16_impl : i2c_iface
}
i2c_iface* _internal;
- byte_vector_t read_i2c(uint16_t addr, size_t num_bytes)
+ byte_vector_t read_i2c(uint16_t addr, size_t num_bytes) override
{
return _internal->read_i2c(addr, num_bytes);
}
- void write_i2c(uint16_t addr, const byte_vector_t& bytes)
+ void write_i2c(uint16_t addr, const byte_vector_t& bytes) override
{
return _internal->write_i2c(addr, bytes);
}
- byte_vector_t read_eeprom(uint16_t addr, uint16_t offset, size_t num_bytes)
+ byte_vector_t read_eeprom(uint16_t addr, uint16_t offset, size_t num_bytes) override
{
byte_vector_t cmd = {
narrow_cast<uint8_t>(offset >> 8), narrow_cast<uint8_t>(offset & 0xff)};
@@ -81,7 +81,7 @@ struct eeprom16_impl : i2c_iface
return this->read_i2c(addr, num_bytes);
}
- void write_eeprom(uint16_t addr, uint16_t offset, const byte_vector_t& bytes)
+ void write_eeprom(uint16_t addr, uint16_t offset, const byte_vector_t& bytes) override
{
for (uint16_t i = 0; i < bytes.size(); i++) {
// write a byte at a time, its easy that way