Skip to content

Commit a707cf8

Browse files
Add Casts to UBaseType_t
1 parent 0ae52db commit a707cf8

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

include/list.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ typedef struct xLIST
326326
} \
327327
\
328328
( pxItemToRemove )->pxContainer = NULL; \
329-
pxList->uxNumberOfItems -= 1U; \
329+
( ( pxList )->uxNumberOfItems ) -= ( UBaseType_t ) 1U; \
330330
} while( 0 )
331331

332332
/*
@@ -363,17 +363,17 @@ typedef struct xLIST
363363
\
364364
/* Insert a new list item into ( pxList ), but rather than sort the list, \
365365
* makes the new list item the last item to be removed by a call to \
366-
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
367-
( pxNewListItem )->pxNext = pxIndex; \
368-
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
369-
\
370-
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
371-
pxIndex->pxPrevious = ( pxNewListItem ); \
372-
\
373-
/* Remember which list the item is in. */ \
374-
( pxNewListItem )->pxContainer = ( pxList ); \
375-
\
376-
( pxList )->uxNumberOfItems += 1U; \
366+
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
367+
( pxNewListItem )->pxNext = pxIndex; \
368+
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
369+
\
370+
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
371+
pxIndex->pxPrevious = ( pxNewListItem ); \
372+
\
373+
/* Remember which list the item is in. */ \
374+
( pxNewListItem )->pxContainer = ( pxList ); \
375+
\
376+
( ( pxList )->uxNumberOfItems ) += ( UBaseType_t ) 1U; \
377377
} while( 0 )
378378

379379
/*

list.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void vListInsertEnd( List_t * const pxList,
130130
/* Remember which list the item is in. */
131131
pxNewListItem->pxContainer = pxList;
132132

133-
( pxList->uxNumberOfItems ) += 1U;
133+
( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
134134

135135
traceRETURN_vListInsertEnd();
136136
}
@@ -205,7 +205,7 @@ void vListInsert( List_t * const pxList,
205205
* item later. */
206206
pxNewListItem->pxContainer = pxList;
207207

208-
( pxList->uxNumberOfItems ) += 1U;
208+
( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
209209

210210
traceRETURN_vListInsert();
211211
}
@@ -237,7 +237,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
237237
}
238238

239239
pxItemToRemove->pxContainer = NULL;
240-
( pxList->uxNumberOfItems ) -= 1U;
240+
( pxList->uxNumberOfItems ) -= ( UBaseType_t ) 1U;
241241

242242
traceRETURN_uxListRemove( pxList->uxNumberOfItems );
243243

tasks.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
pxTemp = pxDelayedTaskList; \
256256
pxDelayedTaskList = pxOverflowDelayedTaskList; \
257257
pxOverflowDelayedTaskList = pxTemp; \
258-
xNumOfOverflows += 1; \
258+
xNumOfOverflows += ( BaseType_t ) 1; \
259259
prvResetNextTaskUnblockTime(); \
260260
} while( 0 )
261261

@@ -2021,7 +2021,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
20212021
* updated. */
20222022
taskENTER_CRITICAL();
20232023
{
2024-
uxCurrentNumberOfTasks += 1U;
2024+
uxCurrentNumberOfTasks += ( UBaseType_t ) 1U;
20252025

20262026
if( pxCurrentTCB == NULL )
20272027
{
@@ -3807,7 +3807,7 @@ void vTaskSuspendAll( void )
38073807

38083808
/* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
38093809
* is used to allow calls to vTaskSuspendAll() to nest. */
3810-
uxSchedulerSuspended += 1U;
3810+
uxSchedulerSuspended += ( UBaseType_t ) 1U;
38113811

38123812
/* Enforces ordering for ports and optimised compilers that may otherwise place
38133813
* the above increment elsewhere. */
@@ -3960,7 +3960,7 @@ BaseType_t xTaskResumeAll( void )
39603960
* previous call to vTaskSuspendAll(). */
39613961
configASSERT( uxSchedulerSuspended != 0U );
39623962

3963-
uxSchedulerSuspended -= 1U;
3963+
uxSchedulerSuspended -= ( UBaseType_t ) 1U;
39643964
portRELEASE_TASK_LOCK();
39653965

39663966
if( uxSchedulerSuspended == ( UBaseType_t ) 0U )

0 commit comments

Comments
 (0)