Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MISRA violations Rule 1.1 for forward declaration #1004

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ TaskHandle_t FreeRTOS_GetIPTaskHandle( void )
*
* @param pxEndPoint The end-point which goes up.
*/
void vIPNetworkUpCalls( NetworkEndPoint_t * pxEndPoint )
void vIPNetworkUpCalls( struct xNetworkEndPoint * pxEndPoint )
{
pxEndPoint->bits.bEndPointUp = pdTRUE_UNSIGNED;

Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_IP_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ BaseType_t xIsCallingFromIPTask( void )
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-89 */
/* coverity[misra_c_2012_rule_8_9_violation] */
/* coverity[single_use] */
void prvProcessNetworkDownEvent( NetworkInterface_t * pxInterface )
void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface )
{
NetworkEndPoint_t * pxEndPoint;

Expand Down
8 changes: 4 additions & 4 deletions source/FreeRTOS_IPv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ BaseType_t xIsIPv4Multicast( uint32_t ulIPAddress )
*
* @return Whether the packet should be processed or dropped.
*/
eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPacket,
const NetworkBufferDescriptor_t * const pxNetworkBuffer,
UBaseType_t uxHeaderLength )
enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * const pxIPPacket,
const struct xNETWORK_BUFFER * const pxNetworkBuffer,
UBaseType_t uxHeaderLength )
{
eFrameProcessingResult_t eReturn = eProcessBuffer;

Expand Down Expand Up @@ -417,7 +417,7 @@ eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPack
*
* @return Either 'eProcessBuffer' or 'eReleaseBuffer'
*/
eFrameProcessingResult_t prvCheckIP4HeaderOptions( NetworkBufferDescriptor_t * const pxNetworkBuffer )
enum eFrameProcessingResult prvCheckIP4HeaderOptions( struct xNETWORK_BUFFER * const pxNetworkBuffer )
{
eFrameProcessingResult_t eReturn = eProcessBuffer;

Expand Down
6 changes: 3 additions & 3 deletions source/include/FreeRTOS_IP_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
#define ipFOREVER() 1
#endif

/* Forward declaration of 'NetworkEndPoint_t'. */
typedef struct xNetworkEndPoint NetworkEndPoint_t;
/* Forward declaration. */
struct xNetworkEndPoint;

typedef enum eFrameProcessingResult
{
Expand Down Expand Up @@ -889,7 +889,7 @@ BaseType_t xIsCallingFromIPTask( void );
#endif /* ipconfigSUPPORT_SELECT_FUNCTION */

/* Send the network-up event and start the ARP timer. */
void vIPNetworkUpCalls( NetworkEndPoint_t * pxEndPoint );
void vIPNetworkUpCalls( struct xNetworkEndPoint * pxEndPoint );

/* *INDENT-OFF* */
#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions source/include/FreeRTOS_IP_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
#endif
/* *INDENT-ON* */

/* Forward declaration of 'NetworkInterface_t'. */
typedef struct xNetworkInterface NetworkInterface_t;
/* Forward declaration. */
struct xNetworkInterface;

#if ( ipconfigUSE_DHCP != 0 )

Expand Down Expand Up @@ -101,7 +101,7 @@ void vPreCheckConfigs( void );
* @brief Called to create a network connection when the stack is first
* started, or when the network connection is lost.
*/
void prvProcessNetworkDownEvent( NetworkInterface_t * pxInterface );
void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface );

/* *INDENT-OFF* */
#ifdef __cplusplus
Expand Down
14 changes: 7 additions & 7 deletions source/include/FreeRTOS_IPv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
/* *INDENT-ON* */

/* Forward declarations. */
typedef struct xNETWORK_BUFFER NetworkBufferDescriptor_t;
typedef enum eFrameProcessingResult eFrameProcessingResult_t;
typedef struct xIP_PACKET IPPacket_t;
struct xNETWORK_BUFFER;
enum eFrameProcessingResult;
struct xIP_PACKET;

#define ipSIZE_OF_IPv4_HEADER 20U
#define ipSIZE_OF_IPv4_ADDRESS 4U
Expand Down Expand Up @@ -89,12 +89,12 @@ uint32_t FreeRTOS_GetIPAddress( void );
BaseType_t xIsIPv4Multicast( uint32_t ulIPAddress );

/* The function 'prvAllowIPPacket()' checks if a packets should be processed. */
eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPacket,
const NetworkBufferDescriptor_t * const pxNetworkBuffer,
UBaseType_t uxHeaderLength );
enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * const pxIPPacket,
const struct xNETWORK_BUFFER * const pxNetworkBuffer,
UBaseType_t uxHeaderLength );

/* Check if the IP-header is carrying options. */
eFrameProcessingResult_t prvCheckIP4HeaderOptions( NetworkBufferDescriptor_t * const pxNetworkBuffer );
enum eFrameProcessingResult prvCheckIP4HeaderOptions( struct xNETWORK_BUFFER * const pxNetworkBuffer );


/* *INDENT-OFF* */
Expand Down
Loading