Run clang-tidy against ESP32 (#2147)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
Oxan van Leeuwen
2021-09-13 18:11:27 +02:00
committed by GitHub
parent a2d2863c72
commit 40c474cd83
74 changed files with 291 additions and 364 deletions
@@ -6,7 +6,7 @@
namespace esphome {
namespace xiaomi_cgpr1 {
static const char *TAG = "xiaomi_cgpr1";
static const char *const TAG = "xiaomi_cgpr1";
void XiaomiCGPR1::dump_config() {
ESP_LOGCONFIG(TAG, "Xiaomi CGPR1");
@@ -54,11 +54,7 @@ bool XiaomiCGPR1::parse_device(const esp32_ble_tracker::ESPBTDevice &device) {
success = true;
}
if (!success) {
return false;
}
return true;
return success;
}
void XiaomiCGPR1::set_bindkey(const std::string &bindkey) {
@@ -69,7 +65,7 @@ void XiaomiCGPR1::set_bindkey(const std::string &bindkey) {
char temp[3] = {0};
for (int i = 0; i < 16; i++) {
strncpy(temp, &(bindkey.c_str()[i * 2]), 2);
bindkey_[i] = std::strtoul(temp, NULL, 16);
bindkey_[i] = std::strtoul(temp, nullptr, 16);
}
}