@@ -490,7 +490,7 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
490
490
/* Check for multiplication overflow. */
491
491
( ( SIZE_MAX / uxQueueLength ) >= uxItemSize ) &&
492
492
/* Check for addition overflow. */
493
- ( ( SIZE_MAX - sizeof ( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) )
493
+ ( ( UBaseType_t ) ( SIZE_MAX - sizeof ( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) )
494
494
{
495
495
/* Allocate enough space to hold the maximum number of items that
496
496
* can be in the queue at any time. It is valid for uxItemSize to be
@@ -1329,7 +1329,7 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
1329
1329
* can be assumed there is no mutex holder and no need to determine if
1330
1330
* priority disinheritance is needed. Simply increase the count of
1331
1331
* messages (semaphores) available. */
1332
- pxQueue -> uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1 ;
1332
+ pxQueue -> uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 ) ;
1333
1333
1334
1334
/* The event list is not altered if the queue is locked. This will
1335
1335
* be done when the queue is unlocked later. */
@@ -1474,7 +1474,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
1474
1474
/* Data available, remove one item. */
1475
1475
prvCopyDataFromQueue ( pxQueue , pvBuffer );
1476
1476
traceQUEUE_RECEIVE ( pxQueue );
1477
- pxQueue -> uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1 ;
1477
+ pxQueue -> uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 ) ;
1478
1478
1479
1479
/* There is now space in the queue, were any tasks waiting to
1480
1480
* post to the queue? If so, unblock the highest priority waiting
@@ -1631,7 +1631,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
1631
1631
1632
1632
/* Semaphores are queues with a data size of zero and where the
1633
1633
* messages waiting is the semaphore's count. Reduce the count. */
1634
- pxQueue -> uxMessagesWaiting = uxSemaphoreCount - ( UBaseType_t ) 1 ;
1634
+ pxQueue -> uxMessagesWaiting = ( UBaseType_t ) ( uxSemaphoreCount - ( UBaseType_t ) 1 ) ;
1635
1635
1636
1636
#if ( configUSE_MUTEXES == 1 )
1637
1637
{
@@ -2003,7 +2003,7 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
2003
2003
traceQUEUE_RECEIVE_FROM_ISR ( pxQueue );
2004
2004
2005
2005
prvCopyDataFromQueue ( pxQueue , pvBuffer );
2006
- pxQueue -> uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1 ;
2006
+ pxQueue -> uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 ) ;
2007
2007
2008
2008
/* If the queue is locked the event list will not be modified.
2009
2009
* Instead update the lock count so the task that unlocks the queue
@@ -2137,7 +2137,7 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
2137
2137
2138
2138
taskENTER_CRITICAL ();
2139
2139
{
2140
- uxReturn = pxQueue -> uxLength - pxQueue -> uxMessagesWaiting ;
2140
+ uxReturn = ( UBaseType_t ) ( pxQueue -> uxLength - pxQueue -> uxMessagesWaiting ) ;
2141
2141
}
2142
2142
taskEXIT_CRITICAL ();
2143
2143
@@ -2250,7 +2250,7 @@ UBaseType_t uxQueueGetQueueItemSize( QueueHandle_t xQueue ) /* PRIVILEGED_FUNCTI
2250
2250
* mutex. */
2251
2251
if ( listCURRENT_LIST_LENGTH ( & ( pxQueue -> xTasksWaitingToReceive ) ) > 0U )
2252
2252
{
2253
- uxHighestPriorityOfWaitingTasks = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY ( & ( pxQueue -> xTasksWaitingToReceive ) );
2253
+ uxHighestPriorityOfWaitingTasks = ( UBaseType_t ) ( ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY ( & ( pxQueue -> xTasksWaitingToReceive ) ) );
2254
2254
}
2255
2255
else
2256
2256
{
@@ -2340,7 +2340,7 @@ static BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue,
2340
2340
}
2341
2341
}
2342
2342
2343
- pxQueue -> uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1 ;
2343
+ pxQueue -> uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 ) ;
2344
2344
2345
2345
return xReturn ;
2346
2346
}
0 commit comments