mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-15 09:17:44 -04:00
TCP: Address MISRA rule 11.3 violations (Part 2) (#227)
This commit is contained in:
parent
bcd5dec6c4
commit
7cb57324fd
4 changed files with 77 additions and 41 deletions
|
@ -129,6 +129,16 @@ struct xIP_HEADER
|
|||
#include "pack_struct_end.h"
|
||||
typedef struct xIP_HEADER IPHeader_t;
|
||||
|
||||
static portINLINE ipDECL_CAST_PTR_FUNC_FOR_TYPE( IPHeader_t )
|
||||
{
|
||||
return ( IPHeader_t *)pvArgument;
|
||||
}
|
||||
static portINLINE ipDECL_CAST_CONST_PTR_FUNC_FOR_TYPE( IPHeader_t )
|
||||
{
|
||||
return ( const IPHeader_t *) pvArgument;
|
||||
}
|
||||
|
||||
|
||||
#include "pack_struct_start.h"
|
||||
struct xICMP_HEADER
|
||||
{
|
||||
|
@ -269,6 +279,17 @@ struct xTCP_PACKET
|
|||
#include "pack_struct_end.h"
|
||||
typedef struct xTCP_PACKET TCPPacket_t;
|
||||
|
||||
static portINLINE ipDECL_CAST_PTR_FUNC_FOR_TYPE( TCPPacket_t )
|
||||
{
|
||||
return ( TCPPacket_t *)pvArgument;
|
||||
}
|
||||
|
||||
static portINLINE ipDECL_CAST_CONST_PTR_FUNC_FOR_TYPE( TCPPacket_t )
|
||||
{
|
||||
return ( const TCPPacket_t *) pvArgument;
|
||||
}
|
||||
|
||||
|
||||
typedef union XPROT_PACKET
|
||||
{
|
||||
ARPPacket_t xARPPacket;
|
||||
|
@ -293,6 +314,15 @@ typedef union xPROT_HEADERS
|
|||
TCPHeader_t xTCPHeader;
|
||||
} ProtocolHeaders_t;
|
||||
|
||||
static portINLINE ipDECL_CAST_PTR_FUNC_FOR_TYPE( ProtocolHeaders_t )
|
||||
{
|
||||
return ( ProtocolHeaders_t *)pvArgument;
|
||||
}
|
||||
|
||||
static portINLINE ipDECL_CAST_CONST_PTR_FUNC_FOR_TYPE( ProtocolHeaders_t )
|
||||
{
|
||||
return ( const ProtocolHeaders_t *) pvArgument;
|
||||
}
|
||||
|
||||
/* The maximum UDP payload length. */
|
||||
#define ipMAX_UDP_PAYLOAD_LENGTH ( ( ipconfigNETWORK_MTU - ipSIZE_OF_IPv4_HEADER ) - ipSIZE_OF_UDP_HEADER )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue