]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/list.h
First pass at updating from MISRA 2004 to MISRA 2012:
[freertos] / FreeRTOS / Source / include / list.h
index 431443f7c05bb1f6aa65e40c93870cd606c410b3..2ec4a67c9d106c7ae462723c5151856f8a990a4c 100644 (file)
@@ -136,6 +136,7 @@ use of FreeRTOS.*/
 /*\r
  * Definition of the only type of object that a list can contain.\r
  */\r
+struct xLIST;\r
 struct xLIST_ITEM\r
 {\r
        listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE                       /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */\r
@@ -143,7 +144,7 @@ struct xLIST_ITEM
        struct xLIST_ITEM * configLIST_VOLATILE pxNext;         /*< Pointer to the next ListItem_t in the list. */\r
        struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;     /*< Pointer to the previous ListItem_t in the list. */\r
        void * pvOwner;                                                                         /*< Pointer to the object (normally a TCB) that contains the list item.  There is therefore a two way link between the object containing the list item and the list item itself. */\r
-       void * configLIST_VOLATILE pvContainer;                         /*< Pointer to the list in which this list item is placed (if any). */\r
+       struct xLIST * configLIST_VOLATILE pxContainer;         /*< Pointer to the list in which this list item is placed (if any). */\r
        listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE                      /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */\r
 };\r
 typedef struct xLIST_ITEM ListItem_t;                                  /* For some reason lint wants this as two separate definitions. */\r
@@ -246,7 +247,7 @@ typedef struct xLIST
  * \page listLIST_IS_EMPTY listLIST_IS_EMPTY\r
  * \ingroup LinkedList\r
  */\r
-#define listLIST_IS_EMPTY( pxList )    ( ( BaseType_t ) ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) )\r
+#define listLIST_IS_EMPTY( pxList )    ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )\r
 \r
 /*\r
  * Access macro to return the number of items in the list.\r
@@ -314,7 +315,7 @@ List_t * const pxConstList = ( pxList );                                                                                                    \
  * @param pxListItem The list item we want to know if is in the list.\r
  * @return pdTRUE if the list item is in the list, otherwise pdFALSE.\r
  */\r
-#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( BaseType_t ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) )\r
+#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? pdTRUE : pdFALSE )\r
 \r
 /*\r
  * Return the list a list item is contained within (referenced from).\r
@@ -322,7 +323,7 @@ List_t * const pxConstList = ( pxList );                                                                                                    \
  * @param pxListItem The list item being queried.\r
  * @return A pointer to the List_t object that references the pxListItem\r
  */\r
-#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pvContainer )\r
+#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )\r
 \r
 /*\r
  * This provides a crude means of knowing if a list has been initialised, as\r