Skip to content

Commit 2ea12d0

Browse files
Remove unneeded casts in Print::write(const String&)
Now that Print::write(const char*) is also available, these casts are no longer needed.
1 parent f304abe commit 2ea12d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hardware/arduino/avr/cores/arduino/Print.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
5353

5454
size_t Print::print(const String &s)
5555
{
56-
return write(reinterpret_cast<const uint8_t*>(s.c_str()), s.length());
56+
return write(s.c_str(), s.length());
5757
}
5858

5959
size_t Print::print(const char str[])

hardware/arduino/sam/cores/arduino/Print.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
4646

4747
size_t Print::print(const String &s)
4848
{
49-
return write(reinterpret_cast<const uint8_t*>(s.c_str()), s.length());
49+
return write(s.c_str(), s.length());
5050
}
5151

5252
size_t Print::print(const char str[])

0 commit comments

Comments
 (0)