Compatibility with clang-tidy v14 (#2272)

This commit is contained in:
Oxan van Leeuwen
2021-09-13 09:35:55 +02:00
committed by GitHub
parent f31e0532c4
commit 0cd24c629a
12 changed files with 41 additions and 45 deletions
+2 -4
View File
@@ -196,10 +196,8 @@ uint32_t Nameable::get_object_id_hash() { return this->object_id_hash_; }
bool Nameable::is_disabled_by_default() const { return this->disabled_by_default_; }
void Nameable::set_disabled_by_default(bool disabled_by_default) { this->disabled_by_default_ = disabled_by_default; }
WarnIfComponentBlockingGuard::WarnIfComponentBlockingGuard(Component *component) {
component_ = component;
started_ = millis();
}
WarnIfComponentBlockingGuard::WarnIfComponentBlockingGuard(Component *component)
: started_(millis()), component_(component) {}
WarnIfComponentBlockingGuard::~WarnIfComponentBlockingGuard() {
uint32_t now = millis();
if (now - started_ > 50) {
+3 -3
View File
@@ -20,7 +20,7 @@ static const char *const TAG = "preferences";
ESPPreferenceObject::ESPPreferenceObject() : offset_(0), length_words_(0), type_(0), data_(nullptr) {}
ESPPreferenceObject::ESPPreferenceObject(size_t offset, size_t length, uint32_t type)
: offset_(offset), length_words_(length), type_(type) {
this->data_ = new uint32_t[this->length_words_ + 1];
this->data_ = new uint32_t[this->length_words_ + 1]; // NOLINT(cppcoreguidelines-prefer-member-initializer)
for (uint32_t i = 0; i < this->length_words_ + 1; i++)
this->data_[i] = 0;
}
@@ -69,7 +69,7 @@ static inline bool esp_rtc_user_mem_read(uint32_t index, uint32_t *dest) {
if (index >= ESP_RTC_USER_MEM_SIZE_WORDS) {
return false;
}
*dest = ESP_RTC_USER_MEM[index];
*dest = ESP_RTC_USER_MEM[index]; // NOLINT(performance-no-int-to-ptr)
return true;
}
@@ -83,7 +83,7 @@ static inline bool esp_rtc_user_mem_write(uint32_t index, uint32_t value) {
return false;
}
auto *ptr = &ESP_RTC_USER_MEM[index];
auto *ptr = &ESP_RTC_USER_MEM[index]; // NOLINT(performance-no-int-to-ptr)
*ptr = value;
return true;
}