Skip to content

Commit 5666ec2

Browse files
committed
const-correctness IPAddress::toString()
it doesn't modify any member variables, should be safe to be const.
1 parent 4897e00 commit 5666ec2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/esp8266/IPAddress.cpp

+1-1
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

+1-1
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)