mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Fix MISRA C 2012 Rule 13.3 Violations (#988)
* MISRA Rule 13.3 Fixes * Add semiicolons that were accidentally removed * Add parentheses back around pxList->uxNumberOfItems where removed. * Formatting fix * Add Casts to UBaseType_t --------- Co-authored-by: bjbsmith <bjbsmith@uafeb6a6bcdce55.ant.amazon.com> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
This commit is contained in:
parent
8c10944575
commit
4d34700bcc
3 changed files with 21 additions and 22 deletions
9
list.c
9
list.c
|
@ -130,7 +130,7 @@ void vListInsertEnd( List_t * const pxList,
|
|||
/* Remember which list the item is in. */
|
||||
pxNewListItem->pxContainer = pxList;
|
||||
|
||||
( pxList->uxNumberOfItems )++;
|
||||
( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
|
||||
|
||||
traceRETURN_vListInsertEnd();
|
||||
}
|
||||
|
@ -205,12 +205,13 @@ void vListInsert( List_t * const pxList,
|
|||
* item later. */
|
||||
pxNewListItem->pxContainer = pxList;
|
||||
|
||||
( pxList->uxNumberOfItems )++;
|
||||
( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
|
||||
|
||||
traceRETURN_vListInsert();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
||||
{
|
||||
/* The list item knows which list it is in. Obtain the list from the list
|
||||
|
@ -219,8 +220,6 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
|||
|
||||
traceENTER_uxListRemove( pxItemToRemove );
|
||||
|
||||
|
||||
|
||||
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
|
||||
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
|
||||
|
||||
|
@ -238,7 +237,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
|||
}
|
||||
|
||||
pxItemToRemove->pxContainer = NULL;
|
||||
( pxList->uxNumberOfItems )--;
|
||||
( pxList->uxNumberOfItems ) -= ( UBaseType_t ) 1U;
|
||||
|
||||
traceRETURN_uxListRemove( pxList->uxNumberOfItems );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue