mirror of
https://github.com/esphome/esphome.git
synced 2024-11-30 18:54:14 +01:00
fix macros
This commit is contained in:
parent
7a357d1b6b
commit
9c39cdc66e
1 changed files with 2 additions and 2 deletions
|
@ -325,7 +325,7 @@ void Si4713Component::loop() {
|
|||
template<typename T> T GET_ENUM_LAST(T value) { return T::LAST; }
|
||||
|
||||
#define CHECK_ENUM(value) \
|
||||
if (value >= GET_ENUM_LAST(value)) { \
|
||||
if ((value) >= GET_ENUM_LAST(value)) { \
|
||||
ESP_LOGE(TAG, "%s(%d) invalid", __func__, (int) (value)); \
|
||||
return; \
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ template<typename T> T GET_ENUM_LAST(T value) { return T::LAST; }
|
|||
}
|
||||
|
||||
#define CHECK_TEXT_RANGE(value, max_size) \
|
||||
if ((value).size() > max_size) { \
|
||||
if ((value).size() > (max_size)) { \
|
||||
ESP_LOGW(TAG, "%s(%s) trimmed (max %d characters)", __func__, (value).c_str(), max_size); \
|
||||
(value).resize(max_size); \
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue