mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
Avoid code duplication in def.c
This commit is contained in:
parent
50e09ccd2c
commit
0c06073819
@ -62,7 +62,7 @@
|
|||||||
u16_t
|
u16_t
|
||||||
lwip_htons(u16_t n)
|
lwip_htons(u16_t n)
|
||||||
{
|
{
|
||||||
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
|
return (u16_t)PP_HTONS(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,10 +86,7 @@ lwip_ntohs(u16_t n)
|
|||||||
u32_t
|
u32_t
|
||||||
lwip_htonl(u32_t n)
|
lwip_htonl(u32_t n)
|
||||||
{
|
{
|
||||||
return ((n & 0xff) << 24) |
|
return (u32_t)PP_HTONL(n);
|
||||||
((n & 0xff00) << 8) |
|
|
||||||
((n & 0xff0000UL) >> 8) |
|
|
||||||
((n & 0xff000000UL) >> 24);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user