Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf6770a

Browse files
committed
Reduce INADDR_NONE SRAM and Flash footprint
NTPClient-based project shrunk per `size firmware.elf` - .text 30100 -> 29838: -262 bytes, -0.8% of Uno Flash - .bss 602 -> 542: -60 bytes, -2.9% of Uno SRAMThat addresses#28,#461,#463 andarduino/Arduino#1007
1 parent87faf93 commitbf6770a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎cores/arduino/IPAddress.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class IPAddress : public Printable {
5252
// Overloaded cast operator to allow IPAddress objects to be used where a pointer
5353
// to a four-byte uint8_t array is expected
5454
operatoruint32_t()const {return _address.dword; };
55+
booloperator==(constuint32_t& addr)const {return _address.dword == addr; };
5556
booloperator==(const IPAddress& addr)const {return _address.dword == addr._address.dword; };
5657
booloperator==(constuint8_t* addr)const;
5758

@@ -73,6 +74,11 @@ class IPAddress : public Printable {
7374
friendclassDNSClient;
7475
};
7576

76-
const IPAddressINADDR_NONE(0,0,0,0);
77+
// Note well, it's still an unfortunate variable name as INADDR_NONE is defined
78+
// as ((in_addr_t) 0xffffffff) on Linux, *BSD and lwIP. Two definitions might
79+
// collide in unexpected ways. It's kept as zero to preserve compatibility
80+
// with previous versions of the library defining INADDR_NONE as `0.0.0.0`
81+
// and not as `255.255.255.255`.
82+
staticconstuint32_tINADDR_NONE(0);
7783

7884
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp