Skip to content

Commit a29ace4

Browse files
d-a-vhasenradball
authored andcommitted
Fix String build warning with DEBUG_ESP_PORT but without DEBUG_ESP_CORE (esp8266#8849)
1 parent 6ae407c commit a29ace4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cores/esp8266/WString.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool String::reserve(unsigned int size) {
200200
#ifdef DEBUG_ESP_PORT
201201
static void identifyString (const String& badOne)
202202
{
203-
DEBUGV("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ",
203+
DEBUG_ESP_PORT.printf("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ",
204204
badOne.c_str(),
205205
badOne.length() > OOM_STRING_BORDER_DISPLAY? badOne.c_str() + std::max((int)badOne.length() - OOM_STRING_BORDER_DISPLAY, OOM_STRING_BORDER_DISPLAY): "");
206206
}
@@ -231,14 +231,14 @@ bool String::changeBuffer(unsigned int maxStrLen) {
231231
if (!isSSO() && capacity() >= OOM_STRING_THRESHOLD_REALLOC_WARN && maxStrLen > capacity()) {
232232
// warn when badly re-allocating
233233
identifyString(*this);
234-
DEBUGV("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen);
234+
DEBUG_ESP_PORT.printf("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen);
235235
}
236236
#endif
237237
// Make sure we can fit newsize in the buffer
238238
if (newSize > CAPACITY_MAX) {
239239
#ifdef DEBUG_ESP_PORT
240240
identifyString(*this);
241-
DEBUGV("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n");
241+
DEBUG_ESP_PORT.printf("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n");
242242
#endif
243243
return false;
244244
}
@@ -261,7 +261,7 @@ bool String::changeBuffer(unsigned int maxStrLen) {
261261
}
262262
#ifdef DEBUG_ESP_PORT
263263
identifyString(*this);
264-
DEBUGV("OOM: %d -> %d bytes\n", isSSO() ? 0: capacity(), newSize);
264+
DEBUG_ESP_PORT.printf("OOM: %d -> %zu bytes\n", isSSO() ? 0: capacity(), newSize);
265265
#endif
266266
return false;
267267
}

0 commit comments

Comments
 (0)