mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Fix MISRA C 2012 Rule 10.3 errors (#860)
* The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category. --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
76f3aa5b05
commit
ce88adea2a
|
@ -40,20 +40,20 @@
|
||||||
* item value. It is important they don't clash with the
|
* item value. It is important they don't clash with the
|
||||||
* taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
|
* taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
|
||||||
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
||||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
|
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint16_t ) 0x0100U )
|
||||||
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
|
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint16_t ) 0x0200U )
|
||||||
#define eventWAIT_FOR_ALL_BITS 0x0400U
|
#define eventWAIT_FOR_ALL_BITS ( ( uint16_t ) 0x0400U )
|
||||||
#define eventEVENT_BITS_CONTROL_BYTES 0xff00U
|
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint16_t ) 0xff00U )
|
||||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
||||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
|
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint32_t ) 0x01000000UL )
|
||||||
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
|
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint32_t ) 0x02000000UL )
|
||||||
#define eventWAIT_FOR_ALL_BITS 0x04000000UL
|
#define eventWAIT_FOR_ALL_BITS ( ( uint32_t ) 0x04000000UL )
|
||||||
#define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
|
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint32_t ) 0xff000000UL )
|
||||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
||||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100000000000000ULL
|
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint64_t ) 0x0100000000000000ULL )
|
||||||
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200000000000000ULL
|
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint64_t ) 0x0200000000000000ULL )
|
||||||
#define eventWAIT_FOR_ALL_BITS 0x0400000000000000ULL
|
#define eventWAIT_FOR_ALL_BITS ( ( uint64_t ) 0x0400000000000000ULL )
|
||||||
#define eventEVENT_BITS_CONTROL_BYTES 0xff00000000000000ULL
|
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint64_t ) 0xff00000000000000ULL )
|
||||||
#endif /* if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) */
|
#endif /* if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) */
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
16
tasks.c
16
tasks.c
|
@ -285,11 +285,11 @@
|
||||||
* responsibility of whichever module is using the value to ensure it gets set back
|
* responsibility of whichever module is using the value to ensure it gets set back
|
||||||
* to its original value when it is released. */
|
* to its original value when it is released. */
|
||||||
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
||||||
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000U
|
#define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint16_t ) 0x8000U )
|
||||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
||||||
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL
|
#define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint32_t ) 0x80000000UL )
|
||||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
||||||
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000000000000000ULL
|
#define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint64_t ) 0x8000000000000000ULL )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Indicates that the task is not actively running on any core. */
|
/* Indicates that the task is not actively running on any core. */
|
||||||
|
@ -2871,7 +2871,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
|
|
||||||
/* Only reset the event list item value if the value is not
|
/* Only reset the event list item value if the value is not
|
||||||
* being used for anything else. */
|
* being used for anything else. */
|
||||||
if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
|
if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0UL ) )
|
||||||
{
|
{
|
||||||
listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxNewPriority ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxNewPriority ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
}
|
}
|
||||||
|
@ -6559,7 +6559,7 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
/* Adjust the mutex holder state to account for its new
|
/* Adjust the mutex holder state to account for its new
|
||||||
* priority. Only reset the event list item value if the value is
|
* priority. Only reset the event list item value if the value is
|
||||||
* not being used for anything else. */
|
* not being used for anything else. */
|
||||||
if( ( listGET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
|
if( ( listGET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0UL ) )
|
||||||
{
|
{
|
||||||
listSET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
listSET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
}
|
}
|
||||||
|
@ -6788,7 +6788,7 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
|
|
||||||
/* Only reset the event list item value if the value is not
|
/* Only reset the event list item value if the value is not
|
||||||
* being used for anything else. */
|
* being used for anything else. */
|
||||||
if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
|
if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0UL ) )
|
||||||
{
|
{
|
||||||
listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriorityToUse ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriorityToUse ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
}
|
}
|
||||||
|
@ -7390,7 +7390,7 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalTime );
|
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalTime );
|
||||||
|
|
||||||
/* For percentage calculations. */
|
/* For percentage calculations. */
|
||||||
ulTotalTime /= 100UL;
|
ulTotalTime /= ( ( configRUN_TIME_COUNTER_TYPE ) 100UL );
|
||||||
|
|
||||||
/* Avoid divide by zero errors. */
|
/* Avoid divide by zero errors. */
|
||||||
if( ulTotalTime > 0UL )
|
if( ulTotalTime > 0UL )
|
||||||
|
@ -7642,7 +7642,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
||||||
{
|
{
|
||||||
if( xClearCountOnExit != pdFALSE )
|
if( xClearCountOnExit != pdFALSE )
|
||||||
{
|
{
|
||||||
pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = 0UL;
|
pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = ( uint32_t ) 0UL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
2
timers.c
2
timers.c
|
@ -1127,7 +1127,7 @@
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ) );
|
xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ) );
|
||||||
}
|
}
|
||||||
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
|
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue