]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/list.c
First pass at updating from MISRA 2004 to MISRA 2012:
[freertos] / FreeRTOS / Source / list.c
index 88191c5f8cec06f932d5a3d6378e9960f2a35ee5..7d88ec91bbdfc25e87f966e671e0762d5435b0d5 100644 (file)
@@ -39,7 +39,7 @@ void vListInitialise( List_t * const pxList )
        /* The list structure contains a list item which is used to mark the\r
        end of the list.  To initialise the list the list end is inserted\r
        as the only list entry. */\r
-       pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd );                       /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
+       pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd );                       /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
 \r
        /* The list end value is the highest possible value in the list to\r
        ensure it remains at the end of the list. */\r
@@ -47,8 +47,8 @@ void vListInitialise( List_t * const pxList )
 \r
        /* The list end next and previous pointers point to itself so we know\r
        when the list is empty. */\r
-       pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd );       /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
-       pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
+       pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd );       /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
+       pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
 \r
        pxList->uxNumberOfItems = ( UBaseType_t ) 0U;\r
 \r
@@ -62,7 +62,7 @@ void vListInitialise( List_t * const pxList )
 void vListInitialiseItem( ListItem_t * const pxItem )\r
 {\r
        /* Make sure the list item is not recorded as being on a list. */\r
-       pxItem->pvContainer = NULL;\r
+       pxItem->pxContainer = NULL;\r
 \r
        /* Write known values into the list item if\r
        configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */\r
@@ -94,7 +94,7 @@ ListItem_t * const pxIndex = pxList->pxIndex;
        pxIndex->pxPrevious = pxNewListItem;\r
 \r
        /* Remember which list the item is in. */\r
-       pxNewListItem->pvContainer = ( void * ) pxList;\r
+       pxNewListItem->pxContainer = pxList;\r
 \r
        ( pxList->uxNumberOfItems )++;\r
 }\r
@@ -127,18 +127,18 @@ const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
        {\r
                /* *** NOTE ***********************************************************\r
                If you find your application is crashing here then likely causes are\r
-               listed below.  In addition see http://www.freertos.org/FAQHelp.html for\r
+               listed below.  In addition see https://www.freertos.org/FAQHelp.html for\r
                more tips, and ensure configASSERT() is defined!\r
-               http://www.freertos.org/a00110.html#configASSERT\r
+               https://www.freertos.org/a00110.html#configASSERT\r
 \r
                        1) Stack overflow -\r
-                          see http://www.freertos.org/Stacks-and-stack-overflow-checking.html\r
+                          see https://www.freertos.org/Stacks-and-stack-overflow-checking.html\r
                        2) Incorrect interrupt priority assignment, especially on Cortex-M\r
                           parts where numerically high priority values denote low actual\r
                           interrupt priorities, which can seem counter intuitive.  See\r
-                          http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition\r
+                          https://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition\r
                           of configMAX_SYSCALL_INTERRUPT_PRIORITY on\r
-                          http://www.freertos.org/a00110.html\r
+                          https://www.freertos.org/a00110.html\r
                        3) Calling an API function from within a critical section or when\r
                           the scheduler is suspended, or calling an API function that does\r
                           not end in "FromISR" from an interrupt.\r
@@ -147,7 +147,7 @@ const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
                           before vTaskStartScheduler() has been called?).\r
                **********************************************************************/\r
 \r
-               for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */\r
+               for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM.  This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */\r
                {\r
                        /* There is nothing to do here, just iterating to the wanted\r
                        insertion position. */\r
@@ -161,7 +161,7 @@ const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
 \r
        /* Remember which list the item is in.  This allows fast removal of the\r
        item later. */\r
-       pxNewListItem->pvContainer = ( void * ) pxList;\r
+       pxNewListItem->pxContainer = pxList;\r
 \r
        ( pxList->uxNumberOfItems )++;\r
 }\r
@@ -171,7 +171,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
 {\r
 /* The list item knows which list it is in.  Obtain the list from the list\r
 item. */\r
-List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer;\r
+List_t * const pxList = pxItemToRemove->pxContainer;\r
 \r
        pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;\r
        pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;\r
@@ -189,7 +189,7 @@ List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer;
                mtCOVERAGE_TEST_MARKER();\r
        }\r
 \r
-       pxItemToRemove->pvContainer = NULL;\r
+       pxItemToRemove->pxContainer = NULL;\r
        ( pxList->uxNumberOfItems )--;\r
 \r
        return pxList->uxNumberOfItems;\r