diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 7abea5f20..bf54422c6 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -1790,7 +1790,7 @@ void WebCallback(JsonObject root) { // send over EMS devices JsonArray list = emsbus.createNestedArray("devices"); - for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) { + for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) { JsonObject item = list.createNestedObject(); item["type"] = (it)->model_type; item["model"] = (it)->model_string; diff --git a/src/ems.cpp b/src/ems.cpp index 2b15d02ff..df6cf18de 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -1823,7 +1823,7 @@ void _addDevice(uint8_t model_type, uint8_t product_id, uint8_t device_id, char _Generic_Device device; // if its a duplicate don't add bool found = false; - for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) { + for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) { if (((it)->product_id == product_id) && ((it)->device_id == device_id)) { found = true; } @@ -2560,9 +2560,9 @@ void ems_printDevices() { myDebug(s); // print out the ones we recognized - if (Devices.size() != 0) { + if (!Devices.empty()) { myDebug_P(PSTR("and from those these %d were recognized as:"), Devices.size()); - for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) { + for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) { myDebug_P(PSTR(" %s%s%s (DeviceID:0x%02X ProductID:%d Version:%s)"), COLOR_BOLD_ON, (it)->model_string, diff --git a/src/ems.h b/src/ems.h index c91594956..4ab34f48e 100644 --- a/src/ems.h +++ b/src/ems.h @@ -398,7 +398,7 @@ typedef struct { char version[10]; char datetime[25]; // HH:MM:SS DD/MM/YYYY bool write_supported; - _EMS_Thermostat_HC hc[EMS_THERMOSTAT_MAXHC - 1]; // array for the 4 heating circuits + _EMS_Thermostat_HC hc[EMS_THERMOSTAT_MAXHC]; // array for the 4 heating circuits } _EMS_Thermostat; // call back function signature for processing telegram types