mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
const-correctness IPAddress::toString()
(#2507)
it doesn't modify any member variables, should be safe to be const.
This commit is contained in:
commit
f4c391032a
@ -105,7 +105,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]);
|
||||||
|
@ -77,7 +77,7 @@ class IPAddress: public Printable {
|
|||||||
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…
x
Reference in New Issue
Block a user