From 974a355aa6eba902968c2ab7c7ce15813d8c74b6 Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Sun, 5 Feb 2023 12:12:07 +0100 Subject: [PATCH] fix compilation warning in some debug configuration --- cores/esp8266/WString.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 4e4ef3506b..1e608c3c92 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -200,7 +200,7 @@ bool String::reserve(unsigned int size) { #ifdef DEBUG_ESP_PORT static void identifyString (const String& badOne) { - DEBUGV("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ", + DEBUG_ESP_PORT.printf("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ", badOne.c_str(), badOne.length() > OOM_STRING_BORDER_DISPLAY? badOne.c_str() + std::max((int)badOne.length() - OOM_STRING_BORDER_DISPLAY, OOM_STRING_BORDER_DISPLAY): ""); } @@ -231,14 +231,14 @@ bool String::changeBuffer(unsigned int maxStrLen) { if (!isSSO() && capacity() >= OOM_STRING_THRESHOLD_REALLOC_WARN && maxStrLen > capacity()) { // warn when badly re-allocating identifyString(*this); - DEBUGV("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen); + DEBUG_ESP_PORT.printf("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen); } #endif // Make sure we can fit newsize in the buffer if (newSize > CAPACITY_MAX) { #ifdef DEBUG_ESP_PORT identifyString(*this); - DEBUGV("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n"); + DEBUG_ESP_PORT.printf("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n"); #endif return false; } @@ -261,7 +261,7 @@ bool String::changeBuffer(unsigned int maxStrLen) { } #ifdef DEBUG_ESP_PORT identifyString(*this); - DEBUGV("OOM: %d -> %d bytes\n", isSSO() ? 0: capacity(), newSize); + DEBUG_ESP_PORT.printf("OOM: %d -> %zu bytes\n", isSSO() ? 0: capacity(), newSize); #endif return false; }