Skip to content

Use PGM_P instead of prog_char #1695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hardware/arduino/avr/cores/arduino/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ size_t Print::write(const uint8_t *buffer, size_t size)

size_t Print::print(const __FlashStringHelper *ifsh)
{
const char PROGMEM *p = (const char PROGMEM *)ifsh;
PGM_P p = (PGM_P)ifsh;
size_t n = 0;
while (1) {
unsigned char c = pgm_read_byte(p++);
Expand Down
4 changes: 2 additions & 2 deletions hardware/arduino/avr/cores/arduino/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
return *this;
}
len = length;
strcpy_P(buffer, (const prog_char *)pstr);
strcpy_P(buffer, (PGM_P)pstr);
return *this;
}

Expand Down Expand Up @@ -246,7 +246,7 @@ String & String::operator = (const char *cstr)

String & String::operator = (const __FlashStringHelper *pstr)
{
if (pstr) copy(pstr, strlen_P((const prog_char *)pstr));
if (pstr) copy(pstr, strlen_P((PGM_P)pstr));
else invalidate();

return *this;
Expand Down
4 changes: 2 additions & 2 deletions hardware/arduino/sam/cores/arduino/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
return *this;
}
len = length;
strcpy_P(buffer, (const prog_char *)pstr);
strcpy_P(buffer, (PGM_P)pstr);
return *this;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ String & String::operator = (const char *cstr)

String & String::operator = (const __FlashStringHelper *pstr)
{
if (pstr) copy(pstr, strlen_P((const prog_char *)pstr));
if (pstr) copy(pstr, strlen_P((PGM_P)pstr));
else invalidate();

return *this;
Expand Down