Skip to content

Commit 15483bb

Browse files
committed
spirit of the thing
1 parent 6db9e7a commit 15483bb

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

Marlin/src/core/mstring.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ class MString {
143143

144144
// Set with format string and arguments, like printf
145145
template<typename... Args>
146-
MString& setf_P(PGM_P const fmt, Args... more) { SNPRINTF_P(str, SIZE, fmt, more...); debug(F("setf_P")); return *this; }
146+
MString& setf_P(PGM_P const pfmt, Args... more) { SNPRINTF_P(str, SIZE, pfmt, more...); debug(F("setf_P")); return *this; }
147147

148148
template<typename... Args>
149149
MString& setf(const char *fmt, Args... more) { SNPRINTF(str, SIZE, fmt, more...); debug(F("setf")); return *this; }
150150

151151
template<typename... Args>
152-
MString& setf(FSTR_P const fmt, Args... more) { return setf_P(FTOP(fmt), more...); }
152+
MString& setf(FSTR_P const ffmt, Args... more) { return setf_P(FTOP(ffmt), more...); }
153153

154154
// Chainable String appenders
155155
MString& append() { debug(F("nil")); return *this; } // for macros that might emit no output
@@ -206,9 +206,9 @@ class MString {
206206
MString& append(const spaces_t &s) { return append(repchr_t(' ', s.count)); }
207207

208208
template<typename... Args>
209-
MString& appendf_P(PGM_P const fmt, Args... more) {
209+
MString& appendf_P(PGM_P const pfmt, Args... more) {
210210
int sz = length();
211-
if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, fmt, more...);
211+
if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, pfmt, more...);
212212
debug(F("appendf_P"));
213213
return *this;
214214
}

Marlin/src/core/serial.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ class SString : public MString<SIZE> {
271271
SString& set() { super::set(); return *this; }
272272

273273
template<typename... Args>
274-
SString& setf_P(PGM_P const fmt, Args... more) { super::setf_P(fmt, more...); return *this; }
274+
SString& setf_P(PGM_P const pfmt, Args... more) { super::setf_P(pfmt, more...); return *this; }
275275

276276
template<typename... Args>
277-
SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; }
277+
SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; }
278278

279279
template<typename... Args>
280-
SString& setf(FSTR_P const fmt, Args... more) { super::setf(fmt, more...); return *this; }
280+
SString& setf(FSTR_P const ffmt, Args... more) { super::setf(ffmt, more...); return *this; }
281281

282282
template <typename T>
283283
SString& set(const T &v) { super::set(v); return *this; }

Marlin/src/lcd/marlinui.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,12 +1563,12 @@ void MarlinUI::host_notify(const char * const cstr) {
15631563
*
15641564
* @param pfmt A constant format P-string
15651565
*/
1566-
void MarlinUI::status_printf(int8_t level, FSTR_P const pfmt, ...) {
1566+
void MarlinUI::status_printf_P(int8_t level, PGM_P const pfmt, ...) {
15671567
if (set_alert_level(level)) return;
15681568

15691569
va_list args;
15701570
va_start(args, pfmt);
1571-
vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, FTOP(pfmt), args);
1571+
vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, pfmt, args);
15721572
va_end(args);
15731573

15741574
host_notify(status_message);
@@ -1642,12 +1642,12 @@ void MarlinUI::host_notify(const char * const cstr) {
16421642
void MarlinUI::_set_status_and_level(const char * const ustr, const int8_t=0, const bool pgm) {
16431643
pgm ? host_notify_P(ustr) : host_notify(ustr);
16441644
}
1645-
void MarlinUI::status_printf(int8_t level, FSTR_P const pfmt, ...) {
1645+
void MarlinUI::status_printf_P(int8_t level, PGM_P const pfmt, ...) {
16461646
MString<30> msg;
16471647

16481648
va_list args;
16491649
va_start(args, pfmt);
1650-
vsnprintf_P(&msg, 30, FTOP(pfmt), args);
1650+
vsnprintf_P(&msg, 30, pfmt, args);
16511651
va_end(args);
16521652

16531653
host_notify(msg);

Marlin/src/lcd/marlinui.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ class MarlinUI {
499499
*
500500
* @param pfmt A constant format P-string
501501
*/
502-
static void status_printf(int8_t level, FSTR_P const pfmt, ...);
502+
static void status_printf_P(int8_t level, PGM_P const pfmt, ...);
503+
504+
template<typename... Args>
505+
static void status_printf(int8_t level, FSTR_P const ffmt, Args... more) { status_printf_P(level, FTOP(ffmt), more...); }
503506

504507
// Periodic or as-needed display update
505508
static void update() IF_DISABLED(HAS_UI_UPDATE, {});

0 commit comments

Comments
 (0)