Fix UBaseType_t conversion for increment and decrement operations

This commit is contained in:
Rahul Kar 2024-04-18 08:42:13 +00:00
parent 0c0f9f3f62
commit 910891f21d
2 changed files with 6 additions and 6 deletions

View file

@ -334,7 +334,7 @@ typedef struct xLIST
} \
\
( pxItemToRemove )->pxContainer = NULL; \
( ( pxList )->uxNumberOfItems ) -= ( UBaseType_t ) 1U; \
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) - 1U ); \
} while( 0 )
/*
@ -381,7 +381,7 @@ typedef struct xLIST
/* Remember which list the item is in. */ \
( pxNewListItem )->pxContainer = ( pxList ); \
\
( ( pxList )->uxNumberOfItems ) += ( UBaseType_t ) 1U; \
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) + 1U ); \
} while( 0 )
/*

View file

@ -255,7 +255,7 @@
pxTemp = pxDelayedTaskList; \
pxDelayedTaskList = pxOverflowDelayedTaskList; \
pxOverflowDelayedTaskList = pxTemp; \
xNumOfOverflows += ( BaseType_t ) 1; \
xNumOfOverflows = ( BaseType_t )( xNumOfOverflows + 1 ); \
prvResetNextTaskUnblockTime(); \
} while( 0 )
@ -2022,7 +2022,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
* updated. */
taskENTER_CRITICAL();
{
uxCurrentNumberOfTasks += ( UBaseType_t ) 1U;
uxCurrentNumberOfTasks = ( UBaseType_t ) ( uxCurrentNumberOfTasks + 1U );
if( pxCurrentTCB == NULL )
{
@ -3816,7 +3816,7 @@ void vTaskSuspendAll( void )
/* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
* is used to allow calls to vTaskSuspendAll() to nest. */
uxSchedulerSuspended += ( UBaseType_t ) 1U;
uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended + 1U );
/* Enforces ordering for ports and optimised compilers that may otherwise place
* the above increment elsewhere. */
@ -3969,7 +3969,7 @@ BaseType_t xTaskResumeAll( void )
* previous call to vTaskSuspendAll(). */
configASSERT( uxSchedulerSuspended != 0U );
uxSchedulerSuspended -= ( UBaseType_t ) 1U;
uxSchedulerSuspended = ( UBaseType_t )( uxSchedulerSuspended - 1U );
portRELEASE_TASK_LOCK();
if( uxSchedulerSuspended == ( UBaseType_t ) 0U )