diff options
Diffstat (limited to 'host/lib/types')
-rw-r--r-- | host/lib/types/device_addr.cpp | 2 | ||||
-rw-r--r-- | host/lib/types/mac_addr.cpp | 2 | ||||
-rw-r--r-- | host/lib/types/serial.cpp | 8 |
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 |