Eliminate %zu parameter

This commit is contained in:
fvanroie 2021-04-28 03:27:54 +02:00
parent e475b72995
commit b13252a42d
10 changed files with 11 additions and 11 deletions

View File

@ -912,7 +912,7 @@ void dispatch_statusupdate(const char*, const char*)
haspDevice.get_free_heap(), haspDevice.get_heap_fragmentation(), haspDevice.get_core_version());
strcat(data, buffer);
snprintf_P(buffer, sizeof(buffer), PSTR("\"canUpdate\":\"false\",\"page\":%u,\"numPages\":%zu,"),
snprintf_P(buffer, sizeof(buffer), PSTR("\"canUpdate\":\"false\",\"page\":%u,\"numPages\":%u,"),
haspPages.get(), haspPages.count());
strcat(data, buffer);

View File

@ -21,9 +21,9 @@ Page::Page()
// LVGL is not yet initialized at construction time
}
size_t Page::count()
uint8_t Page::count()
{
return sizeof(_pages) / sizeof(*_pages);
return (uint8_t)(sizeof(_pages) / sizeof(*_pages));
}
void Page::init(uint8_t start_page)

View File

@ -33,7 +33,7 @@ class Page {
public:
Page();
size_t count();
uint8_t count();
void init(uint8_t start_page);
void clear(uint8_t pageid);
// void set(uint8_t pageid);

View File

@ -47,7 +47,7 @@
#define D_MQTT_SUBSCRIBED "Subscribed to %s"
#define D_MQTT_NOT_SUBSCRIBED "Failed to subscribe to %s"
#define D_MQTT_HA_AUTO_DISCOVERY "Register HA auto-discovery"
#define D_MQTT_PAYLOAD_TOO_LONG "Payload too long (%zu bytes)"
#define D_MQTT_PAYLOAD_TOO_LONG "Payload too long (%u bytes)"
#define D_TELNET_CLOSING_CONNECTION "Closing session from %s"
#define D_TELNET_CLIENT_LOGIN_FROM "Client login from %s"

View File

@ -47,7 +47,7 @@
#define D_MQTT_SUBSCRIBED "Feliratkozva: %s"
#define D_MQTT_NOT_SUBSCRIBED "Nem sikerült feliratkozni: %s"
#define D_MQTT_HA_AUTO_DISCOVERY "Regisztrálás HA automatikus felfedezésre"
#define D_MQTT_PAYLOAD_TOO_LONG "$$$Payload too long (%zu bytes)"
#define D_MQTT_PAYLOAD_TOO_LONG "$$$Payload too long (%u bytes)"
#define D_TELNET_CLOSING_CONNECTION "Munkamenet befejezése %s-el"
#define D_TELNET_CLIENT_LOGIN_FROM "Kliens bejelentkezés innen: %s"

View File

@ -47,7 +47,7 @@
#define D_MQTT_SUBSCRIBED "Ingeschreven op %s"
#define D_MQTT_NOT_SUBSCRIBED "Inschrijving op %s mislukt"
#define D_MQTT_HA_AUTO_DISCOVERY "Registeren HA auto-configuratie"
#define D_MQTT_PAYLOAD_TOO_LONG "Payload is te lang (%zu bytes)"
#define D_MQTT_PAYLOAD_TOO_LONG "Payload is te lang (%u bytes)"
#define D_TELNET_CLOSING_CONNECTION "Sessie sluiten van %s"
#define D_TELNET_CLIENT_LOGIN_FROM "Client aangemeld van %s"

View File

@ -47,7 +47,7 @@
#define D_MQTT_SUBSCRIBED "Abonat la %s"
#define D_MQTT_NOT_SUBSCRIBED "Abonarea la %s a eșuat"
#define D_MQTT_HA_AUTO_DISCOVERY "Înregistrare la auto-descoperire în HA"
#define D_MQTT_PAYLOAD_TOO_LONG "$$$Payload too long (%zu bytes)"
#define D_MQTT_PAYLOAD_TOO_LONG "$$$Payload too long (%u bytes)"
#define D_TELNET_CLOSING_CONNECTION "Terminarea sesiunii de la %s"
#define D_TELNET_CLIENT_LOGIN_FROM "Conectare client de la %s"

View File

@ -126,7 +126,7 @@ void connlost(void* context, char* cause)
static void mqtt_message_cb(char* topic, char* payload, size_t length)
{ // Handle incoming commands from MQTT
if(length + 1 >= MQTT_MAX_PACKET_SIZE) {
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), length);
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), (uint32_t)length);
return;
} else {
payload[length] = '\0';

View File

@ -120,7 +120,7 @@ void connlost(void* context, char* cause)
static void mqtt_message_cb(char* topic, char* payload, size_t length)
{ // Handle incoming commands from MQTT
if(length + 1 >= MQTT_MAX_PACKET_SIZE) {
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), length);
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), (uint32_t)length);
return;
} else {
payload[length] = '\0';

View File

@ -156,7 +156,7 @@ int mqtt_send_discovery(const char* payload, size_t len)
static void mqtt_message_cb(char* topic, byte* payload, unsigned int length)
{ // Handle incoming commands from MQTT
if(length + 1 >= mqttClient.getBufferSize()) {
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), length);
LOG_ERROR(TAG_MQTT_RCV, F(D_MQTT_PAYLOAD_TOO_LONG), (uint32_t)length);
return;
} else {
payload[length] = '\0';