1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-18 03:02:20 +01:00

Avoid non-const globals and enable clang-tidy check (#1892)

This commit is contained in:
Stefan Agner
2021-06-10 22:19:44 +02:00
committed by GitHub
parent 360effcb72
commit 501f88ca86
376 changed files with 466 additions and 468 deletions

View File

@@ -4,10 +4,10 @@
namespace esphome {
namespace json {
static const char *TAG = "json";
static const char *const TAG = "json";
static char *global_json_build_buffer = nullptr;
static size_t global_json_build_buffer_size = 0;
static char *global_json_build_buffer = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
static size_t global_json_build_buffer_size = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
void reserve_global_json_build_buffer(size_t required_size) {
if (global_json_build_buffer_size == 0 || global_json_build_buffer_size < required_size) {
@@ -123,7 +123,7 @@ void VectorJsonBuffer::reserve(size_t size) { // NOLINT
size_t VectorJsonBuffer::size() const { return this->size_; }
VectorJsonBuffer global_json_buffer;
VectorJsonBuffer global_json_buffer; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace json
} // namespace esphome