util: Use htonl_constant() in more places
We might as well when we're passing a known constant value, giving the compiler the best chance to optimise things away. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
073f530bfe
commit
eae4304000
1 changed files with 2 additions and 2 deletions
4
util.h
4
util.h
|
@ -111,9 +111,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IN4_IS_ADDR_UNSPECIFIED(a) \
|
#define IN4_IS_ADDR_UNSPECIFIED(a) \
|
||||||
((a)->s_addr == htonl(INADDR_ANY))
|
((a)->s_addr == htonl_constant(INADDR_ANY))
|
||||||
#define IN4_IS_ADDR_BROADCAST(a) \
|
#define IN4_IS_ADDR_BROADCAST(a) \
|
||||||
((a)->s_addr == htonl(INADDR_BROADCAST))
|
((a)->s_addr == htonl_constant(INADDR_BROADCAST))
|
||||||
#define IN4_IS_ADDR_LOOPBACK(a) \
|
#define IN4_IS_ADDR_LOOPBACK(a) \
|
||||||
(ntohl((a)->s_addr) >> IN_CLASSA_NSHIFT == IN_LOOPBACKNET)
|
(ntohl((a)->s_addr) >> IN_CLASSA_NSHIFT == IN_LOOPBACKNET)
|
||||||
#define IN4_IS_ADDR_MULTICAST(a) \
|
#define IN4_IS_ADDR_MULTICAST(a) \
|
||||||
|
|
Loading…
Reference in a new issue