Skip to content

Commit be9fe45

Browse files
Fix compiler warnings when the TCP Window is not used (#124)
* Fix warnings when TCP window is not used * Uncrustify
1 parent 9a25860 commit be9fe45

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

FreeRTOS_IP.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ static BaseType_t xIPTaskInitialised = pdFALSE;
354354

355355
/*-----------------------------------------------------------*/
356356

357+
#include "random.h"
358+
357359
/* Coverity wants to make pvParameters const, which would make it incompatible. Leave the
358360
* function signature as is. */
359361

@@ -434,6 +436,8 @@ static void prvIPTask( void * pvParameters )
434436

435437
iptraceNETWORK_EVENT_RECEIVED( xReceivedEvent.eEventType );
436438

439+
vAddBytesToPool( xReceivedEvent.eEventType );
440+
437441
switch( xReceivedEvent.eEventType )
438442
{
439443
case eNetworkDownEvent:

FreeRTOS_TCP_IP.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,12 @@
14981498
uxIndex += ( size_t ) ucLen;
14991499
}
15001500
}
1501+
1502+
#if ( ipconfigUSE_TCP_WIN == 0 )
1503+
/* Avoid compiler warnings when TCP window is not used. */
1504+
( void ) xHasSYNFlag;
1505+
#endif
1506+
15011507
return uxIndex;
15021508
}
15031509
/*-----------------------------------------------------------*/
@@ -2595,11 +2601,12 @@
25952601
TCPHeader_t * pxTCPHeader = &pxProtocolHeaders->xTCPHeader;
25962602
const TCPWindow_t * pxTCPWindow = &pxSocket->u.xTCP.xTCPWindow;
25972603
UBaseType_t uxOptionsLength = pxTCPWindow->ucOptionLength;
2598-
/* memcpy() helper variables for MISRA Rule 21.15 compliance*/
2599-
const void * pvCopySource;
2600-
void * pvCopyDest;
26012604

26022605
#if ( ipconfigUSE_TCP_WIN == 1 )
2606+
/* memcpy() helper variables for MISRA Rule 21.15 compliance*/
2607+
const void * pvCopySource;
2608+
void * pvCopyDest;
2609+
26032610
if( uxOptionsLength != 0U )
26042611
{
26052612
/* TCP options must be sent because a packet which is out-of-order

tools/tcp_utilities/tcp_mem_stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
#ifndef ipconfigTCP_MEM_STATS_MAX_ALLOCATION
5151
#define ipconfigTCP_MEM_STATS_MAX_ALLOCATION 128u
52-
#pragma warning "ipconfigTCP_MEM_STATS_MAX_ALLOCATION undefined?"
52+
// #pragma warning "ipconfigTCP_MEM_STATS_MAX_ALLOCATION undefined?"
5353
#endif
5454

5555
#if ( ipconfigUSE_TCP_MEM_STATS != 0 )

0 commit comments

Comments
 (0)