Skip to content

Commit 900bb68

Browse files
committed
Uncrustify: triggered by comment.
1 parent e90cc09 commit 900bb68

File tree

103 files changed

+4368
-4318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4368
-4318
lines changed

source/FreeRTOS_ARP.c

+28-28
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,16 @@ static TickType_t xLastGratuitousARPTime = 0U;
242242

243243
/* Process received ARP frame to see if there is a clash. */
244244
#if ( ipconfigARP_USE_CLASH_DETECTION != 0 )
245-
{
246-
NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress, 2 );
245+
{
246+
NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress, 2 );
247247

248-
if( ( pxSourceEndPoint != NULL ) && ( pxSourceEndPoint->ipv4_settings.ulIPAddress == ulSenderProtocolAddress ) )
249-
{
250-
xARPHadIPClash = pdTRUE;
251-
/* Remember the MAC-address of the other device which has the same IP-address. */
252-
( void ) memcpy( xARPClashMacAddress.ucBytes, pxARPHeader->xSenderHardwareAddress.ucBytes, sizeof( xARPClashMacAddress.ucBytes ) );
253-
}
248+
if( ( pxSourceEndPoint != NULL ) && ( pxSourceEndPoint->ipv4_settings.ulIPAddress == ulSenderProtocolAddress ) )
249+
{
250+
xARPHadIPClash = pdTRUE;
251+
/* Remember the MAC-address of the other device which has the same IP-address. */
252+
( void ) memcpy( xARPClashMacAddress.ucBytes, pxARPHeader->xSenderHardwareAddress.ucBytes, sizeof( xARPClashMacAddress.ucBytes ) );
254253
}
254+
}
255255
#endif /* ipconfigARP_USE_CLASH_DETECTION */
256256
}
257257
else
@@ -845,21 +845,21 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress,
845845
* is different. Continue looping to find a possible match with
846846
* ulIPAddress. */
847847
#if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 )
848-
{
849-
/* If ARP stores the MAC address of IP addresses outside the
850-
* network, than the MAC address of the gateway should not be
851-
* overwritten. */
852-
BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress, 3 ) != NULL ) ? 1 : 0; /* ARP remote address. */
848+
{
849+
/* If ARP stores the MAC address of IP addresses outside the
850+
* network, than the MAC address of the gateway should not be
851+
* overwritten. */
852+
BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress, 3 ) != NULL ) ? 1 : 0; /* ARP remote address. */
853853

854-
if( xAddressIsLocal == xOtherIsLocal )
855-
{
856-
pxLocation->xMacEntry = x;
857-
}
858-
}
859-
#else /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
854+
if( xAddressIsLocal == xOtherIsLocal )
860855
{
861856
pxLocation->xMacEntry = x;
862857
}
858+
}
859+
#else /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
860+
{
861+
pxLocation->xMacEntry = x;
862+
}
863863
#endif /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
864864
}
865865

@@ -1291,19 +1291,19 @@ void FreeRTOS_OutputARPRequest( uint32_t ulIPAddress )
12911291
vARPGenerateRequestPacket( pxNetworkBuffer );
12921292

12931293
#if ( ipconfigETHERNET_MINIMUM_PACKET_BYTES > 0 )
1294+
{
1295+
if( pxNetworkBuffer->xDataLength < ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES )
12941296
{
1295-
if( pxNetworkBuffer->xDataLength < ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES )
1296-
{
1297-
BaseType_t xIndex;
1297+
BaseType_t xIndex;
12981298

1299-
for( xIndex = ( BaseType_t ) pxNetworkBuffer->xDataLength; xIndex < ( BaseType_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES; xIndex++ )
1300-
{
1301-
pxNetworkBuffer->pucEthernetBuffer[ xIndex ] = 0U;
1302-
}
1303-
1304-
pxNetworkBuffer->xDataLength = ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES;
1299+
for( xIndex = ( BaseType_t ) pxNetworkBuffer->xDataLength; xIndex < ( BaseType_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES; xIndex++ )
1300+
{
1301+
pxNetworkBuffer->pucEthernetBuffer[ xIndex ] = 0U;
13051302
}
1303+
1304+
pxNetworkBuffer->xDataLength = ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES;
13061305
}
1306+
}
13071307
#endif /* if( ipconfigETHERNET_MINIMUM_PACKET_BYTES > 0 ) */
13081308

13091309
if( xIsCallingFromIPTask() != pdFALSE )

source/FreeRTOS_DHCP.c

+36-36
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,21 @@
422422
FreeRTOS_debug_printf( ( "vDHCPProcess: giving up %lu > %lu ticks\n", EP_DHCPData.xDHCPTxPeriod, ipconfigMAXIMUM_DISCOVER_TX_PERIOD ) );
423423

424424
#if ( ipconfigDHCP_FALL_BACK_AUTO_IP != 0 )
425-
{
426-
/* Only use a fake Ack if the default IP address == 0x00
427-
* and the link local addressing is used. Start searching
428-
* a free LinkLayer IP-address. Next state will be
429-
* 'eGetLinkLayerAddress'. */
430-
prvPrepareLinkLayerIPLookUp( pxEndPoint );
431-
432-
/* Setting an IP address manually so set to not using
433-
* leased address mode. */
434-
EP_DHCPData.eDHCPState = eGetLinkLayerAddress;
435-
}
425+
{
426+
/* Only use a fake Ack if the default IP address == 0x00
427+
* and the link local addressing is used. Start searching
428+
* a free LinkLayer IP-address. Next state will be
429+
* 'eGetLinkLayerAddress'. */
430+
prvPrepareLinkLayerIPLookUp( pxEndPoint );
431+
432+
/* Setting an IP address manually so set to not using
433+
* leased address mode. */
434+
EP_DHCPData.eDHCPState = eGetLinkLayerAddress;
435+
}
436436
#else
437-
{
438-
xGivingUp = pdTRUE;
439-
}
437+
{
438+
xGivingUp = pdTRUE;
439+
}
440440
#endif /* ipconfigDHCP_FALL_BACK_AUTO_IP */
441441
}
442442
}
@@ -1432,31 +1432,31 @@
14321432
( void ) memcpy( &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET ] ), pucOptionsArray, *pxOptionsArraySize );
14331433

14341434
#if ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
1435-
{
1436-
/* With this option, the hostname can be registered as well which makes
1437-
* it easier to lookup a device in a router's list of DHCP clients. */
1438-
1439-
/* Point to where the OPTION_END was stored to add data. */
1440-
pucPtr = &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + ( *pxOptionsArraySize - 1U ) ] );
1441-
pucPtr[ 0U ] = dhcpIPv4_DNS_HOSTNAME_OPTIONS_CODE;
1442-
pucPtr[ 1U ] = ( uint8_t ) uxNameLength;
1443-
1444-
/*
1445-
* Use helper variables for memcpy() to remain
1446-
* compliant with MISRA Rule 21.15. These should be
1447-
* optimized away.
1448-
*/
1449-
if( pucHostName != NULL )
1450-
{
1451-
pvCopySource = pucHostName;
1452-
pvCopyDest = &pucPtr[ 2U ];
1435+
{
1436+
/* With this option, the hostname can be registered as well which makes
1437+
* it easier to lookup a device in a router's list of DHCP clients. */
14531438

1454-
( void ) memcpy( pvCopyDest, pvCopySource, uxNameLength );
1455-
}
1439+
/* Point to where the OPTION_END was stored to add data. */
1440+
pucPtr = &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + ( *pxOptionsArraySize - 1U ) ] );
1441+
pucPtr[ 0U ] = dhcpIPv4_DNS_HOSTNAME_OPTIONS_CODE;
1442+
pucPtr[ 1U ] = ( uint8_t ) uxNameLength;
14561443

1457-
pucPtr[ 2U + uxNameLength ] = ( uint8_t ) dhcpOPTION_END_BYTE;
1458-
*pxOptionsArraySize += ( size_t ) ( 2U + uxNameLength );
1444+
/*
1445+
* Use helper variables for memcpy() to remain
1446+
* compliant with MISRA Rule 21.15. These should be
1447+
* optimized away.
1448+
*/
1449+
if( pucHostName != NULL )
1450+
{
1451+
pvCopySource = pucHostName;
1452+
pvCopyDest = &pucPtr[ 2U ];
1453+
1454+
( void ) memcpy( pvCopyDest, pvCopySource, uxNameLength );
14591455
}
1456+
1457+
pucPtr[ 2U + uxNameLength ] = ( uint8_t ) dhcpOPTION_END_BYTE;
1458+
*pxOptionsArraySize += ( size_t ) ( 2U + uxNameLength );
1459+
}
14601460
#endif /* if ( ipconfigDHCP_REGISTER_HOSTNAME == 1 ) */
14611461

14621462
/* Map in the client identifier. */

source/FreeRTOS_DHCPv6.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -773,15 +773,15 @@ static void vDHCPv6ProcessEndPoint( BaseType_t xReset,
773773
else
774774
{
775775
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
776-
{
777-
static eDHCPState_t lastState = eNotUsingLeasedAddress;
776+
{
777+
static eDHCPState_t lastState = eNotUsingLeasedAddress;
778778

779-
if( lastState != EP_DHCPData.eDHCPState )
780-
{
781-
lastState = EP_DHCPData.eDHCPState;
782-
FreeRTOS_debug_printf( ( "vDHCPv6ProcessEndPoint: enter %s (%d)\n", prvStateName( EP_DHCPData.eDHCPState ), EP_DHCPData.eDHCPState ) );
783-
}
779+
if( lastState != EP_DHCPData.eDHCPState )
780+
{
781+
lastState = EP_DHCPData.eDHCPState;
782+
FreeRTOS_debug_printf( ( "vDHCPv6ProcessEndPoint: enter %s (%d)\n", prvStateName( EP_DHCPData.eDHCPState ), EP_DHCPData.eDHCPState ) );
784783
}
784+
}
785785
#endif /* ( ipconfigHAS_DEBUG_PRINTF == 1 ) */
786786

787787
xGivingUp = xDHCPv6ProcessEndPoint_HandleState( pxEndPoint, pxDHCPMessage );

0 commit comments

Comments
 (0)