mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
fix lint warnings
This commit is contained in:
@@ -2047,7 +2047,7 @@ int EMSdevice::get_modbus_value(uint8_t tag, const std::string & shortname, std:
|
||||
return -5;
|
||||
}
|
||||
|
||||
for (auto i = 0; i < register_length_s; i++) {
|
||||
for (size_t i = 0; i < register_length_s; i++) {
|
||||
auto hi = (uint8_t)value_s[2 * i];
|
||||
auto lo = (uint8_t)(2 * i + 1 < length_s ? value_s[2 * i + 1] : 0);
|
||||
result[i] = ((uint16_t)hi << 8) | lo;
|
||||
@@ -2165,7 +2165,7 @@ int EMSdevice::modbus_value_to_json(uint8_t tag, const std::string & shortname,
|
||||
}
|
||||
|
||||
uint32_t value = 0;
|
||||
for (auto i = 0; i < modbus_data.size(); i++) {
|
||||
for (size_t i = 0; i < modbus_data.size(); i++) {
|
||||
value += (uint32_t)modbus_data[modbus_data.size() - i - 1] << (i * 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class EMSdevice {
|
||||
}
|
||||
|
||||
void has_update(char * value, const char * newvalue, size_t len) {
|
||||
if (value && strcmp(value, newvalue) != 0) {
|
||||
if (value && newvalue && strcmp(value, newvalue) != 0) {
|
||||
strlcpy(value, newvalue, len);
|
||||
has_update_ = true;
|
||||
publish_value(value);
|
||||
|
||||
Reference in New Issue
Block a user