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

Add and fix -Wconversion errors #980

Merged
merged 7 commits into from
Jul 27, 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
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,16 @@ add_compile_options(
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>

# TODO: Add in other Compilers here.
# Suppressions required to build clean with clang.
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-padded>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-covered-switch-default>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align>
)

########################################################################
Expand Down
4 changes: 4 additions & 0 deletions source/FreeRTOS_ARP.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ static TickType_t xLastGratuitousARPTime = 0U;
}
}
}
else
{
/* do nothing, coverity happy */
}

break;

Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_BitConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ uint16_t usBitConfig_read_16( BitConfig_t * pxConfig )

if( xBitConfig_read_uc( pxConfig, pucData, uxNeeded ) != pdFALSE )
{
usResult = ( ( ( uint16_t ) pucData[ 0 ] ) << 8 ) |
( ( ( uint16_t ) pucData[ 1 ] ) );
usResult = ( uint16_t ) ( ( ( ( uint16_t ) pucData[ 0 ] ) << 8 ) |
( ( ( uint16_t ) pucData[ 1 ] ) ) );
}

return usResult;
Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_DHCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -1654,8 +1654,8 @@

( void ) xApplicationGetRandomNumber( &( ulNumbers[ 0 ] ) );
( void ) xApplicationGetRandomNumber( &( ulNumbers[ 1 ] ) );
ucLinkLayerIPAddress[ 0 ] = ( uint8_t ) 1 + ( uint8_t ) ( ulNumbers[ 0 ] % 0xFDU ); /* get value 1..254 for IP-address 3rd byte of IP address to try. */
ucLinkLayerIPAddress[ 1 ] = ( uint8_t ) 1 + ( uint8_t ) ( ulNumbers[ 1 ] % 0xFDU ); /* get value 1..254 for IP-address 4th byte of IP address to try. */
ucLinkLayerIPAddress[ 0 ] = ( uint8_t ) ( 1 + ( ulNumbers[ 0 ] % 0xFDU ) ); /* get value 1..254 for IP-address 3rd byte of IP address to try. */
ucLinkLayerIPAddress[ 1 ] = ( uint8_t ) ( 1 + ( ulNumbers[ 1 ] % 0xFDU ) ); /* get value 1..254 for IP-address 4th byte of IP address to try. */

EP_IPv4_SETTINGS.ulGatewayAddress = 0U;

Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_DHCPv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ static void prvSendDHCPMessage( NetworkEndPoint_t * pxEndPoint )
uint16_t usLength = ( uint16_t ) pxDHCPMessage->xServerID.uxLength;
/* DHCPv6_Option_Server_Identifier */
vBitConfig_write_16( &( xMessage ), DHCPv6_Option_Server_Identifier ); /* Option is 1: Server Identifier */
vBitConfig_write_16( &( xMessage ), usLength + 4U ); /* The length is 14 */
vBitConfig_write_16( &( xMessage ), ( uint16_t ) ( usLength + 4U ) ); /* The length is 14 */
vBitConfig_write_16( &( xMessage ), pxDHCPMessage->xServerID.usDUIDType ); /* The type of DUID: 1, 2, or 3. */
vBitConfig_write_16( &( xMessage ), pxDHCPMessage->xServerID.usHardwareType );
vBitConfig_write_uc( &( xMessage ), pxDHCPMessage->xServerID.pucID, pxDHCPMessage->xServerID.uxLength );
Expand Down Expand Up @@ -1263,7 +1263,7 @@ static BaseType_t prvDHCPv6_handleOption( struct xNetworkEndPoint * pxEndPoint,
* - the message does not include a Client Identifier option.
* - the contents of the Client Identifier option does not match the client's DUID.
* - the "transaction-id" field value does not match the value the client used in its Solicit message. */
( void ) xBitConfig_read_uc( pxMessage, pxDHCPMessage->xClientID.pucID, lIDSize ); /* Link Layer address, 6 bytes */
( void ) xBitConfig_read_uc( pxMessage, pxDHCPMessage->xClientID.pucID, ( size_t ) lIDSize ); /* Link Layer address, 6 bytes */

/* Check client DUID. */
if( ( pxSet->uxOptionLength != dhcpIPv6_CLIENT_DUID_LENGTH ) ||
Expand Down
8 changes: 4 additions & 4 deletions source/FreeRTOS_DNS_Parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
/*logging*/
FreeRTOS_printf( ( "prvParseDNS_HandleLLMNRRequest[%s]: type %04X\n", xSet.pcName, xSet.usType ) );

xEndPoint.usDNSType = xSet.usType;
xEndPoint.usDNSType = ( uint8_t ) xSet.usType;
}
#endif /* ( ipconfigUSE_IPv6 != 0 ) */

Expand Down Expand Up @@ -572,7 +572,7 @@
( void ) memcpy( &( pxAnswer->ulIPAddress ), xEndPoint.ipv6_settings.xIPAddress.ucBytes, ipSIZE_OF_IPv6_ADDRESS );
uxDistance = ( size_t ) ( xSet.pucByte - pucNewBuffer );
/* An extra 12 bytes will be sent compared to an A-record. */
usLength = ( int16_t ) sizeof( *pxAnswer ) + uxDistance + ipSIZE_OF_IPv6_ADDRESS - sizeof( pxAnswer->ulIPAddress );
usLength = ( int16_t ) ( sizeof( *pxAnswer ) + uxDistance + ipSIZE_OF_IPv6_ADDRESS - sizeof( pxAnswer->ulIPAddress ) );
}
else
#endif /* ( ipconfigUSE_IPv6 != 0 ) */
Expand Down Expand Up @@ -1090,8 +1090,8 @@
/* Define the ASCII value of the capital "A". */
const uint8_t ucCharA = ( uint8_t ) 0x41U;

ucByte = ( ( uint8_t ) ( ( pucSource[ 0 ] - ucCharA ) << 4 ) ) |
( pucSource[ 1 ] - ucCharA );
ucByte = ( uint8_t ) ( ( ( pucSource[ 0 ] - ucCharA ) << 4 ) |
( pucSource[ 1 ] - ucCharA ) );

/* Make sure there are no trailing spaces in the name. */
if( ( ucByte == ( uint8_t ) ' ' ) && ( pucTarget[ 1 ] == 0U ) )
Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_IPv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ eFrameProcessingResult_t prvCheckIP4HeaderOptions( NetworkBufferDescriptor_t * c
pxIPHeader->usLength = FreeRTOS_htons( FreeRTOS_ntohs( pxIPHeader->usLength ) - optlen );

/* Rewrite the Version/IHL byte to indicate that this packet has no IP options. */
pxIPHeader->ucVersionHeaderLength = ( pxIPHeader->ucVersionHeaderLength & 0xF0U ) | /* High nibble is the version. */
( ( ipSIZE_OF_IPv4_HEADER >> 2 ) & 0x0FU );
pxIPHeader->ucVersionHeaderLength = ( uint8_t ) ( ( pxIPHeader->ucVersionHeaderLength & 0xF0U ) | /* High nibble is the version. */
( ( ipSIZE_OF_IPv4_HEADER >> 2 ) & 0x0FU ) );
}
#else /* if ( ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS != 0 ) */
{
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_IPv4_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ BaseType_t prvChecksumIPv4Checks( uint8_t * pucEthernetBuffer,
/* coverity[misra_c_2012_rule_11_3_violation] */
pxSet->pxProtocolHeaders = ( ( ProtocolHeaders_t * ) &( pucEthernetBuffer[ pxSet->uxIPHeaderLength + ipSIZE_OF_ETH_HEADER ] ) );
/* For IPv4, the number of bytes in IP-header + the protocol is indicated. */
pxSet->usProtocolBytes = pxSet->usPayloadLength - ( ( uint16_t ) pxSet->uxIPHeaderLength );
pxSet->usProtocolBytes = ( uint16_t ) ( pxSet->usPayloadLength - pxSet->uxIPHeaderLength );
}

return xReturn;
Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_IPv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const struct xIPv6_Address FreeRTOS_in6addr_loopback = { { 0, 0, 0, 0, 0, 0, 0,
{
pxExtHeader = ( const IPExtHeader_IPv6_t * ) ( &( pucEthernetBuffer[ ipSIZE_OF_ETH_HEADER + ipSIZE_OF_IPv6_HEADER + uxExtHeaderLength ] ) );
/* The definition of length in extension header - Length of this header in 8-octet units, not including the first 8 octets. */
uxExtHeaderLength += ( 8 * pxExtHeader->ucHeaderExtLength ) + 8;
uxExtHeaderLength += ( size_t ) ( ( 8 * pxExtHeader->ucHeaderExtLength ) + 8 );

ucNextHeader = pxExtHeader->ucNextHeader;

Expand Down Expand Up @@ -656,7 +656,7 @@ eFrameProcessingResult_t eHandleIPv6ExtensionHeaders( NetworkBufferDescriptor_t
( void ) memmove( pucTo, pucFrom, xMoveLen );
pxNetworkBuffer->xDataLength -= uxRemovedBytes;

usPayloadLength -= ( uint16_t ) uxRemovedBytes;
usPayloadLength = ( uint16_t ) ( usPayloadLength - uxRemovedBytes );
pxIPPacket_IPv6->xIPHeader.usPayloadLength = FreeRTOS_htons( usPayloadLength );
eResult = eProcessBuffer;
}
Expand Down
8 changes: 4 additions & 4 deletions source/FreeRTOS_IPv6_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ char cHexToChar( uint16_t usValue )

if( usValue <= 9U )
{
cReturn += usValue;
cReturn = ( char ) ( cReturn + usValue );
}
else if( usValue <= 15U )
{
cReturn = 'a';
cReturn += ( usValue - 10U );
cReturn = ( char ) ( cReturn + ( usValue - ( uint16_t ) 10 ) );
}
else
{
Expand Down Expand Up @@ -199,7 +199,7 @@ socklen_t uxHexPrintShort( char * pcBuffer,
{
const size_t uxNibbleCount = 4U;
size_t uxNibble;
size_t uxIndex = 0U;
socklen_t uxIndex = 0U;
uint16_t usShifter = usValue;
BaseType_t xHadNonZero = pdFALSE;

Expand All @@ -223,7 +223,7 @@ socklen_t uxHexPrintShort( char * pcBuffer,
uxIndex++;
}

usShifter <<= 4;
usShifter = ( uint16_t ) ( usShifter << 4 );
}

return uxIndex;
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_IPv6_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ BaseType_t prvChecksumIPv6Checks( uint8_t * pucEthernetBuffer,
pxSet->pxProtocolHeaders = ( ( ProtocolHeaders_t * ) &( pucEthernetBuffer[ ipSIZE_OF_ETH_HEADER + ipSIZE_OF_IPv6_HEADER + uxExtensionHeaderLength ] ) );
pxSet->usPayloadLength = FreeRTOS_ntohs( pxSet->pxIPPacket_IPv6->usPayloadLength );
/* For IPv6, the number of bytes in the protocol is indicated. */
pxSet->usProtocolBytes = pxSet->usPayloadLength - ( uint16_t ) uxExtensionHeaderLength;
pxSet->usProtocolBytes = ( uint16_t ) ( pxSet->usPayloadLength - uxExtensionHeaderLength );

size_t uxNeeded = ( size_t ) pxSet->usPayloadLength;
uxNeeded += ipSIZE_OF_ETH_HEADER + ipSIZE_OF_IPv6_HEADER;
Expand Down
8 changes: 4 additions & 4 deletions source/FreeRTOS_Routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,8 @@ IPv6_Type_t xIPv6_GetIPType( const IPv6_Address_t * pxAddress )
for( xIndex = 0; xIndex < ARRAY_SIZE_X( xIPCouples ); xIndex++ )
{
uint16_t usAddress =
( ( ( uint16_t ) pxAddress->ucBytes[ 0 ] ) << 8 ) |
( ( uint16_t ) pxAddress->ucBytes[ 1 ] );
( uint16_t ) ( ( ( ( uint16_t ) pxAddress->ucBytes[ 0 ] ) << 8 ) |
( ( uint16_t ) pxAddress->ucBytes[ 1 ] ) );

if( ( usAddress & xIPCouples[ xIndex ].usMask ) == xIPCouples[ xIndex ].usExpected )
{
Expand Down Expand Up @@ -1504,7 +1504,7 @@ const char * pcEndpointName( const NetworkEndPoint_t * pxEndPoint,
( void ) FreeRTOS_inet_ntop( FREERTOS_AF_INET4,
( const void * ) &( pxEndPoint->ipv4_settings.ulIPAddress ),
pcBuffer,
uxSize );
( socklen_t ) uxSize );
break;
#endif /* ( ipconfigUSE_IPv4 != 0 ) */

Expand All @@ -1513,7 +1513,7 @@ const char * pcEndpointName( const NetworkEndPoint_t * pxEndPoint,
( void ) FreeRTOS_inet_ntop( FREERTOS_AF_INET6,
pxEndPoint->ipv6_settings.xIPAddress.ucBytes,
pcBuffer,
uxSize );
( socklen_t ) uxSize );
break;
#endif /* ( ipconfigUSE_IPv6 != 0 ) */

Expand Down
24 changes: 12 additions & 12 deletions source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static BaseType_t prvDetermineSocketSize( BaseType_t xDomain,

if( pxSocket->u.xTCP.usMSS > usDifference )
{
pxSocket->u.xTCP.usMSS -= ( uint16_t ) usDifference;
pxSocket->u.xTCP.usMSS = ( uint16_t ) ( pxSocket->u.xTCP.usMSS - usDifference );
}
}
#endif /* ipconfigUSE_IPv6 != 0 */
Expand Down Expand Up @@ -2843,7 +2843,7 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,

if( pvOptionValue == NULL )
{
pxSocket->ucSocketOptions &= ~( ( uint8_t ) FREERTOS_SO_UDPCKSUM_OUT );
pxSocket->ucSocketOptions &= ( ( uint8_t ) ~( ( uint8_t ) FREERTOS_SO_UDPCKSUM_OUT ) );
}
else
{
Expand Down Expand Up @@ -2956,7 +2956,7 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,
static uint16_t prvGetPrivatePortNumber( BaseType_t xProtocol )
{
const uint16_t usEphemeralPortCount =
socketAUTO_PORT_ALLOCATION_MAX_NUMBER - ( socketAUTO_PORT_ALLOCATION_START_NUMBER - 1U );
socketAUTO_PORT_ALLOCATION_MAX_NUMBER - ( uint16_t ) ( socketAUTO_PORT_ALLOCATION_START_NUMBER - 1U );
uint16_t usIterations = usEphemeralPortCount;
uint32_t ulRandomSeed = 0;
uint16_t usResult = 0;
Expand Down Expand Up @@ -2987,9 +2987,8 @@ static uint16_t prvGetPrivatePortNumber( BaseType_t xProtocol )
}

/* Map the random to a candidate port. */
usResult =
socketAUTO_PORT_ALLOCATION_START_NUMBER +
( ( ( uint16_t ) ulRandomSeed ) % usEphemeralPortCount );
usResult = ( uint16_t ) ( socketAUTO_PORT_ALLOCATION_START_NUMBER +
( ( ( uint16_t ) ulRandomSeed ) % usEphemeralPortCount ) );

/* Check if there's already an open socket with the same protocol
* and port. */
Expand Down Expand Up @@ -3266,23 +3265,23 @@ uint8_t ucASCIIToHex( char cChar )

if( ( cValue >= '0' ) && ( cValue <= '9' ) )
{
cValue -= ( char ) '0';
cValue = ( char ) ( cValue - ( uint8_t ) '0' );
/* The value will be between 0 and 9. */
ucNew = ( uint8_t ) cValue;
}
else if( ( cValue >= 'a' ) && ( cValue <= 'f' ) )
{
cValue -= ( char ) 'a';
cValue = ( char ) ( cValue - ( uint8_t ) 'a' );
ucNew = ( uint8_t ) cValue;
/* The value will be between 10 and 15. */
ucNew += ( uint8_t ) 10;
ucNew = ( uint8_t ) ( ucNew + ( uint8_t ) 10 );
}
else if( ( cValue >= 'A' ) && ( cValue <= 'F' ) )
{
cValue -= ( char ) 'A';
cValue = ( char ) ( cValue - ( uint8_t ) 'A' );
ucNew = ( uint8_t ) cValue;
/* The value will be between 10 and 15. */
ucNew += ( uint8_t ) 10;
ucNew = ( uint8_t ) ( ucNew + ( uint8_t ) 10 );
}
else
{
Expand Down Expand Up @@ -3339,7 +3338,8 @@ void FreeRTOS_EUI48_ntop( const uint8_t * pucSource,
else
{
cResult = cTen; /* Either 'a' or 'A' */
cResult = ( char ) ( cResult + ( ucNibble - 10U ) );
cResult = ( char ) ( cResult + ucNibble );
cResult = ( char ) ( cResult - ( uint8_t ) 10U );
}

pcTarget[ uxTarget ] = cResult;
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_TCP_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
( unsigned ) ( uxIPHeaderSizeSocket( pxSocket ) + ipSIZE_OF_TCP_HEADER ) ) );
}

prvTCPReturnPacket( pxSocket, pxSocket->u.xTCP.pxAckMessage, uxIPHeaderSizeSocket( pxSocket ) + ipSIZE_OF_TCP_HEADER, ipconfigZERO_COPY_TX_DRIVER );
prvTCPReturnPacket( pxSocket, pxSocket->u.xTCP.pxAckMessage, ( uint32_t ) ( uxIPHeaderSizeSocket( pxSocket ) + ipSIZE_OF_TCP_HEADER ), ipconfigZERO_COPY_TX_DRIVER );

#if ( ipconfigZERO_COPY_TX_DRIVER != 0 )
{
Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_TCP_Reception.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@
*/
if( pucPtr[ 0U ] == tcpTCP_OPT_SACK_A )
{
ucLen -= 2U;
ucLen = ( uint8_t ) ( ucLen - 2U );
lIndex += 2;

while( ucLen >= ( uint8_t ) 8U )
{
prvReadSackOption( pucPtr, ( size_t ) lIndex, pxSocket );
lIndex += 8;
ucLen -= 8U;
ucLen = ( uint8_t ) ( ucLen - 8U );
}

/* ucLen should be 0 by now. */
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_TCP_Utils_IPV6.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void prvSocketSetMSS_IPV6( FreeRTOS_Socket_t * pxSocket )
}
#endif

ulMSS -= uxDifference;
ulMSS = ( uint32_t ) ( ulMSS - uxDifference );
IPv6_Type_t eType = xIPv6_GetIPType( &( pxSocket->u.xTCP.xRemoteIP.xIP_IPv6 ) );

if( eType == eIPv6_Global )
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_TCP_WIN.c
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@
if( ( pxSegment->u.bits.ucTransmitCount == MAX_TRANSMIT_COUNT_USING_LARGE_WINDOW ) &&
( pxWindow->xSize.ulTxWindowLength > ( 2U * ( ( uint32_t ) pxWindow->usMSS ) ) ) )
{
uint16_t usMSS2 = pxWindow->usMSS * 2U;
uint16_t usMSS2 = ( uint16_t ) ( pxWindow->usMSS * 2U );
FreeRTOS_debug_printf( ( "ulTCPWindowTxGet[%u - %u]: Change Tx window: %u -> %u\n",
pxWindow->usPeerPortNumber,
pxWindow->usOurPortNumber,
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/Common/phyHandling.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ BaseType_t xPhyDiscover( EthernetPhy_t * pxPhyObject )
pxPhyObject->fnPhyRead( xPhyAddress, phyREG_02_PHYSID1, &ulUpperID );
ulPhyID = ( ( ( uint32_t ) ulUpperID ) << 16 ) | ( ulLowerID & 0xFFF0U );

pxPhyObject->ucPhyIndexes[ pxPhyObject->xPortCount ] = xPhyAddress;
pxPhyObject->ucPhyIndexes[ pxPhyObject->xPortCount ] = ( uint8_t ) xPhyAddress;
pxPhyObject->ulPhyIDs[ pxPhyObject->xPortCount ] = ulPhyID;

pxPhyObject->xPortCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ static void * prvLinuxPcapSendThread( void * pvParam )
FreeRTOS_debug_printf( ( "Sending ========== > data pcap_sendpadcket %lu\n", xLength ) );
print_hex( ucBuffer, xLength );

if( pcap_sendpacket( pxOpenedInterfaceHandle, ucBuffer, xLength ) != 0 )
if( pcap_sendpacket( pxOpenedInterfaceHandle, ucBuffer, ( int ) xLength ) != 0 )
{
FreeRTOS_printf( ( "pcap_sendpackeet: send failed %d\n", ulPCAPSendFailures ) );
ulPCAPSendFailures++;
Expand Down
6 changes: 3 additions & 3 deletions test/build-combination/Common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ UBaseType_t uxRand( void )

BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
*pulNumber = ( uint32_t ) uxRand();

return pdTRUE;
}
Expand Down Expand Up @@ -286,7 +286,7 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
( void ) ulDestinationAddress;
( void ) usDestinationPort;

return uxRand();
return ( uint32_t ) uxRand();
}

void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
Expand Down Expand Up @@ -365,6 +365,6 @@ void vApplicationPingReplyHook( ePingReplyStatus_t eStatus,
/* DHCPv6 needs a time-stamp, seconds after 1970. */
uint32_t ulApplicationTimeHook( void )
{
return time( NULL );
return ( uint32_t ) time( NULL );
}
#endif
Loading