mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 09:33:44 +08:00
added optional macros PACK_STRUCT_FLD_8() and PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that do not need packing
This commit is contained in:
@@ -57,7 +57,7 @@ extern "C" {
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct eth_addr {
|
||||
PACK_STRUCT_FIELD(u8_t addr[ETHARP_HWADDR_LEN]);
|
||||
PACK_STRUCT_FLD_8(u8_t addr[ETHARP_HWADDR_LEN]);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
@@ -71,10 +71,10 @@ PACK_STRUCT_BEGIN
|
||||
/** Ethernet header */
|
||||
struct eth_hdr {
|
||||
#if ETH_PAD_SIZE
|
||||
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
|
||||
PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]);
|
||||
#endif
|
||||
PACK_STRUCT_FIELD(struct eth_addr dest);
|
||||
PACK_STRUCT_FIELD(struct eth_addr src);
|
||||
PACK_STRUCT_FLD_S(struct eth_addr dest);
|
||||
PACK_STRUCT_FLD_S(struct eth_addr src);
|
||||
PACK_STRUCT_FIELD(u16_t type);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
@@ -115,13 +115,13 @@ PACK_STRUCT_BEGIN
|
||||
struct etharp_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t hwtype);
|
||||
PACK_STRUCT_FIELD(u16_t proto);
|
||||
PACK_STRUCT_FIELD(u8_t hwlen);
|
||||
PACK_STRUCT_FIELD(u8_t protolen);
|
||||
PACK_STRUCT_FLD_8(u8_t hwlen);
|
||||
PACK_STRUCT_FLD_8(u8_t protolen);
|
||||
PACK_STRUCT_FIELD(u16_t opcode);
|
||||
PACK_STRUCT_FIELD(struct eth_addr shwaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr2 sipaddr);
|
||||
PACK_STRUCT_FIELD(struct eth_addr dhwaddr);
|
||||
PACK_STRUCT_FIELD(struct ip_addr2 dipaddr);
|
||||
PACK_STRUCT_FLD_S(struct eth_addr shwaddr);
|
||||
PACK_STRUCT_FLD_S(struct ip_addr2 sipaddr);
|
||||
PACK_STRUCT_FLD_S(struct eth_addr dhwaddr);
|
||||
PACK_STRUCT_FLD_S(struct ip_addr2 dipaddr);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct pppoehdr {
|
||||
PACK_STRUCT_FIELD(u8_t vertype);
|
||||
PACK_STRUCT_FIELD(u8_t code);
|
||||
PACK_STRUCT_FLD_8(u8_t vertype);
|
||||
PACK_STRUCT_FLD_8(u8_t code);
|
||||
PACK_STRUCT_FIELD(u16_t session);
|
||||
PACK_STRUCT_FIELD(u16_t plen);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
|
||||
Reference in New Issue
Block a user