diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c6d536a0b..cda568c28b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,10 +196,16 @@ add_compile_options( $<$:-Wall> $<$:-Wextra> $<$:-Werror> + $<$:-Wconversion> $<$:-Wunused-variable> $<$:-Weverything> - # TODO: Add in other Compilers here. + # Suppressions required to build clean with clang. + $<$:-Wno-unused-macros> + $<$:-Wno-padded> + $<$:-Wno-missing-variable-declarations> + $<$:-Wno-covered-switch-default> + $<$:-Wno-cast-align> ) ######################################################################## diff --git a/source/FreeRTOS_ARP.c b/source/FreeRTOS_ARP.c index cfaed6e6f4..330d11ab9a 100644 --- a/source/FreeRTOS_ARP.c +++ b/source/FreeRTOS_ARP.c @@ -321,6 +321,10 @@ static TickType_t xLastGratuitousARPTime = 0U; } } } + else + { + /* do nothing, coverity happy */ + } break; diff --git a/source/FreeRTOS_BitConfig.c b/source/FreeRTOS_BitConfig.c index a071ab154a..f338891a41 100644 --- a/source/FreeRTOS_BitConfig.c +++ b/source/FreeRTOS_BitConfig.c @@ -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; diff --git a/source/FreeRTOS_DHCP.c b/source/FreeRTOS_DHCP.c index f3591cd3d5..5ebeebcd71 100644 --- a/source/FreeRTOS_DHCP.c +++ b/source/FreeRTOS_DHCP.c @@ -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; diff --git a/source/FreeRTOS_DHCPv6.c b/source/FreeRTOS_DHCPv6.c index 5edf7aa735..8157fc96ba 100644 --- a/source/FreeRTOS_DHCPv6.c +++ b/source/FreeRTOS_DHCPv6.c @@ -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 ); @@ -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 ) || diff --git a/source/FreeRTOS_DNS_Parser.c b/source/FreeRTOS_DNS_Parser.c index 4d28e57a2a..fe1036e4d2 100644 --- a/source/FreeRTOS_DNS_Parser.c +++ b/source/FreeRTOS_DNS_Parser.c @@ -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 ) */ @@ -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 ) */ @@ -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 ) ) diff --git a/source/FreeRTOS_IPv4.c b/source/FreeRTOS_IPv4.c index d9bddf4438..ca88419ea0 100644 --- a/source/FreeRTOS_IPv4.c +++ b/source/FreeRTOS_IPv4.c @@ -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 ) */ { diff --git a/source/FreeRTOS_IPv4_Utils.c b/source/FreeRTOS_IPv4_Utils.c index b5960a6df7..5891da2134 100644 --- a/source/FreeRTOS_IPv4_Utils.c +++ b/source/FreeRTOS_IPv4_Utils.c @@ -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; diff --git a/source/FreeRTOS_IPv6.c b/source/FreeRTOS_IPv6.c index cf3067a0f4..7224096803 100644 --- a/source/FreeRTOS_IPv6.c +++ b/source/FreeRTOS_IPv6.c @@ -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; @@ -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; } diff --git a/source/FreeRTOS_IPv6_Sockets.c b/source/FreeRTOS_IPv6_Sockets.c index cbcf265717..0801c34775 100644 --- a/source/FreeRTOS_IPv6_Sockets.c +++ b/source/FreeRTOS_IPv6_Sockets.c @@ -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 { @@ -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; @@ -223,7 +223,7 @@ socklen_t uxHexPrintShort( char * pcBuffer, uxIndex++; } - usShifter <<= 4; + usShifter = ( uint16_t ) ( usShifter << 4 ); } return uxIndex; diff --git a/source/FreeRTOS_IPv6_Utils.c b/source/FreeRTOS_IPv6_Utils.c index deba03b8c7..7e0776fb24 100644 --- a/source/FreeRTOS_IPv6_Utils.c +++ b/source/FreeRTOS_IPv6_Utils.c @@ -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; diff --git a/source/FreeRTOS_Routing.c b/source/FreeRTOS_Routing.c index 65304fc49e..4c9c3813f5 100644 --- a/source/FreeRTOS_Routing.c +++ b/source/FreeRTOS_Routing.c @@ -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 ) { @@ -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 ) */ @@ -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 ) */ diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index c5a06ad6a2..5900e4a2c3 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -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 */ @@ -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 { @@ -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; @@ -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. */ @@ -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 { @@ -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; diff --git a/source/FreeRTOS_TCP_IP.c b/source/FreeRTOS_TCP_IP.c index dda679bddf..8944065720 100644 --- a/source/FreeRTOS_TCP_IP.c +++ b/source/FreeRTOS_TCP_IP.c @@ -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 ) { diff --git a/source/FreeRTOS_TCP_Reception.c b/source/FreeRTOS_TCP_Reception.c index 904414b96d..1401cf2f9a 100644 --- a/source/FreeRTOS_TCP_Reception.c +++ b/source/FreeRTOS_TCP_Reception.c @@ -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. */ diff --git a/source/FreeRTOS_TCP_Utils_IPV6.c b/source/FreeRTOS_TCP_Utils_IPV6.c index 5df69b646b..3db9a2e1ef 100644 --- a/source/FreeRTOS_TCP_Utils_IPV6.c +++ b/source/FreeRTOS_TCP_Utils_IPV6.c @@ -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 ) diff --git a/source/FreeRTOS_TCP_WIN.c b/source/FreeRTOS_TCP_WIN.c index 31b5c5f256..8296657984 100644 --- a/source/FreeRTOS_TCP_WIN.c +++ b/source/FreeRTOS_TCP_WIN.c @@ -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, diff --git a/source/portable/NetworkInterface/Common/phyHandling.c b/source/portable/NetworkInterface/Common/phyHandling.c index 9b55ab3e6e..470256d6d1 100644 --- a/source/portable/NetworkInterface/Common/phyHandling.c +++ b/source/portable/NetworkInterface/Common/phyHandling.c @@ -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++; diff --git a/source/portable/NetworkInterface/linux/NetworkInterface.c b/source/portable/NetworkInterface/linux/NetworkInterface.c index 409b769004..2732d33947 100644 --- a/source/portable/NetworkInterface/linux/NetworkInterface.c +++ b/source/portable/NetworkInterface/linux/NetworkInterface.c @@ -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++; diff --git a/test/build-combination/Common/main.c b/test/build-combination/Common/main.c index bf4217333f..a0e1822a66 100644 --- a/test/build-combination/Common/main.c +++ b/test/build-combination/Common/main.c @@ -242,7 +242,7 @@ UBaseType_t uxRand( void ) BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber ) { - *pulNumber = uxRand(); + *pulNumber = ( uint32_t ) uxRand(); return pdTRUE; } @@ -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, @@ -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