Skip to content

Commit f4c3910

Browse files
authored
const-correctness IPAddress::toString() (esp8266#2507)
it doesn't modify any member variables, should be safe to be const.
2 parents 4897e00 + 5666ec2 commit f4c3910

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/esp8266/IPAddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ size_t IPAddress::printTo(Print& p) const {
105105
return n;
106106
}
107107

108-
String IPAddress::toString()
108+
String IPAddress::toString() const
109109
{
110110
char szRet[16];
111111
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);

cores/esp8266/IPAddress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class IPAddress: public Printable {
7777
IPAddress& operator=(uint32_t address);
7878

7979
virtual size_t printTo(Print& p) const;
80-
String toString();
80+
String toString() const;
8181

8282
friend class EthernetClass;
8383
friend class UDP;

0 commit comments

Comments
 (0)