const correctness (#89)
make IPAddress.toString() const method, it doesn't modify anything within the class.
This commit is contained in:
parent
d8e74f2cbf
commit
54b1b8b1d3
@ -72,7 +72,7 @@ size_t IPAddress::printTo(Print& p) const
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
String IPAddress::toString()
|
String IPAddress::toString() const
|
||||||
{
|
{
|
||||||
char szRet[16];
|
char szRet[16];
|
||||||
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);
|
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
IPAddress& operator=(uint32_t address);
|
IPAddress& operator=(uint32_t address);
|
||||||
|
|
||||||
virtual size_t printTo(Print& p) const;
|
virtual size_t printTo(Print& p) const;
|
||||||
String toString();
|
String toString() const;
|
||||||
|
|
||||||
friend class EthernetClass;
|
friend class EthernetClass;
|
||||||
friend class UDP;
|
friend class UDP;
|
||||||
|
Loading…
Reference in New Issue
Block a user