Skip to content

Commit

Permalink
const-correctness IPAddress::toString()
Browse files Browse the repository at this point in the history
it doesn't modify any member variables, should be safe to be const.
  • Loading branch information
Palatis committed Sep 12, 2016
1 parent 4897e00 commit 5666ec2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cores/esp8266/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ size_t IPAddress::printTo(Print& p) const {
return n;
}

String IPAddress::toString()
String IPAddress::toString() const
{
char szRet[16];
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IPAddress: public Printable {
IPAddress& operator=(uint32_t address);

virtual size_t printTo(Print& p) const;
String toString();
String toString() const;

friend class EthernetClass;
friend class UDP;
Expand Down

0 comments on commit 5666ec2

Please sign in to comment.