Skip to content

Commit

Permalink
event_groups.c/list.h/tasks.c: fix cpp compilation warnings
Browse files Browse the repository at this point in the history
event_groups.c, include/list.h, tasks.c show build warnings for
typecast operations. This is treated as error by the mcu plus sdk.
Include the required variable typecast to compile succesfully.

Fixes: MCUSDK-550

Signed-off-by: Ashwin Raj <ashwin.raj@ti.com>
  • Loading branch information
ashwin-ti committed Nov 19, 2024
1 parent dbf7055 commit f27b857
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions event_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
/* MISRA Ref 11.5.4 [Callback function parameter] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet );
( void ) xEventGroupSetBits( (EventGroupHandle_t) pvEventGroup, ( EventBits_t ) ulBitsToSet );

traceRETURN_vEventGroupSetBitsCallback();
}
Expand All @@ -766,7 +766,7 @@
/* MISRA Ref 11.5.4 [Callback function parameter] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear );
( void ) xEventGroupClearBits( (EventGroupHandle_t) pvEventGroup, ( EventBits_t ) ulBitsToClear );

traceRETURN_vEventGroupClearBitsCallback();
}
Expand Down
2 changes: 1 addition & 1 deletion include/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ typedef struct xLIST
{ \
( pxConstList )->pxIndex = ( pxConstList )->xListEnd.pxNext; \
} \
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
( pxTCB ) = (TCB_t * ) ( pxConstList )->pxIndex->pvOwner; \
} while( 0 )
#else /* #if ( configNUMBER_OF_CORES == 1 ) */

Expand Down
18 changes: 9 additions & 9 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxStack = pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );
pxStack = (StackType_t * ) pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );

if( pxStack != NULL )
{
Expand Down Expand Up @@ -3992,7 +3992,7 @@ BaseType_t xTaskResumeAll( void )
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );
pxTCB = (TCB_t *) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );
listREMOVE_ITEM( &( pxTCB->xEventListItem ) );
portMEMORY_BARRIER();
listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
Expand Down Expand Up @@ -4734,7 +4734,7 @@ BaseType_t xTaskIncrementTick( void )
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTCB = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );
pxTCB = (TCB_t *) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );
xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xStateListItem ) );

if( xConstTickCount < xItemValue )
Expand Down Expand Up @@ -5361,7 +5361,7 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxUnblockedTCB = listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
pxUnblockedTCB = (TCB_t *) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
configASSERT( pxUnblockedTCB );
listREMOVE_ITEM( &( pxUnblockedTCB->xEventListItem ) );

Expand Down Expand Up @@ -5450,7 +5450,7 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxUnblockedTCB = listGET_LIST_ITEM_OWNER( pxEventListItem );
pxUnblockedTCB = (TCB_t *) listGET_LIST_ITEM_OWNER( pxEventListItem );
configASSERT( pxUnblockedTCB );
listREMOVE_ITEM( pxEventListItem );

Expand Down Expand Up @@ -6060,7 +6060,7 @@ static void prvCheckTasksWaitingTermination( void )
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
pxTCB = (TCB_t *) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
--uxCurrentNumberOfTasks;
--uxDeletedTasksWaitingCleanUp;
Expand Down Expand Up @@ -6285,7 +6285,7 @@ static void prvCheckTasksWaitingTermination( void )
/* MISRA Ref 11.5.3 [Void pointer assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTCB = listGET_LIST_ITEM_OWNER( pxIterator );
pxTCB = (TCB_t *) listGET_LIST_ITEM_OWNER( pxIterator );

vTaskGetInfo( ( TaskHandle_t ) pxTCB, &( pxTaskStatusArray[ uxTask ] ), pdTRUE, eState );
uxTask++;
Expand Down Expand Up @@ -7263,7 +7263,7 @@ static void prvResetNextTaskUnblockTime( void )
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
pxTaskStatusArray = (TaskStatus_t *) pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );

if( pxTaskStatusArray != NULL )
{
Expand Down Expand Up @@ -7432,7 +7432,7 @@ static void prvResetNextTaskUnblockTime( void )
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
/* coverity[misra_c_2012_rule_11_5_violation] */
pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
pxTaskStatusArray = (TaskStatus_t *) pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );

if( pxTaskStatusArray != NULL )
{
Expand Down

0 comments on commit f27b857

Please sign in to comment.