]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/list.h
Linting and MISRA checking
[freertos] / FreeRTOS / Source / include / list.h
index 934fd2afb9293a175d40cbd5ebb26ac340bac3f5..d95977f55e1b10e18060344fac42bff03c6576d0 100644 (file)
@@ -177,7 +177,7 @@ typedef struct xLIST
  * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER\r
  * \ingroup LinkedList\r
  */\r
-#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner )         ( pxListItem )->pvOwner = ( void * ) ( pxOwner )\r
+#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner )         ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )\r
 \r
 /*\r
  * Access macro to get the owner of a list item.  The owner of a list item\r
@@ -195,7 +195,7 @@ typedef struct xLIST
  * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE\r
  * \ingroup LinkedList\r
  */\r
-#define listSET_LIST_ITEM_VALUE( pxListItem, xValue )          ( pxListItem )->xItemValue = ( xValue )\r
+#define listSET_LIST_ITEM_VALUE( pxListItem, xValue )          ( ( pxListItem )->xItemValue = ( xValue ) )\r
 \r
 /*\r
  * Access macro to retrieve the value of the list item.  The value can\r
@@ -223,7 +223,7 @@ typedef struct xLIST
  * \page listLIST_IS_EMPTY listLIST_IS_EMPTY\r
  * \ingroup LinkedList\r
  */\r
-#define listLIST_IS_EMPTY( pxList )                            ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 )\r
+#define listLIST_IS_EMPTY( pxList )                            ( ( portBASE_TYPE ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 ) )\r
 \r
 /*\r
  * Access macro to return the number of items in the list.\r
@@ -249,17 +249,17 @@ typedef struct xLIST
  * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY\r
  * \ingroup LinkedList\r
  */\r
-#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList )                                                                   \\r
-{                                                                                                                                                                              \\r
-xList * const pxConstList = ( pxList );                                                                                                        \\r
-       /* Increment the index to the next item and return the item, ensuring */                        \\r
-       /* we don't return the marker used at the end of the list.  */                                          \\r
-       ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;                                            \\r
-       if( ( pxConstList )->pxIndex == ( xListItem * ) &( ( pxConstList )->xListEnd ) )        \\r
-       {                                                                                                                                                                       \\r
-               ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;                                    \\r
-       }                                                                                                                                                                       \\r
-       ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner;                                                                          \\r
+#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList )                                                                           \\r
+{                                                                                                                                                                                      \\r
+xList * const pxConstList = ( pxList );                                                                                                                \\r
+       /* Increment the index to the next item and return the item, ensuring */                                \\r
+       /* we don't return the marker used at the end of the list.  */                                                  \\r
+       ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;                                                    \\r
+       if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) )  \\r
+       {                                                                                                                                                                               \\r
+               ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext;                                            \\r
+       }                                                                                                                                                                               \\r
+       ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner;                                                                                  \\r
 }\r
 \r
 \r
@@ -291,7 +291,7 @@ xList * const pxConstList = ( pxList );                                                                                                     \
  * @return pdTRUE is the list item is in the list, otherwise pdFALSE.\r
  * pointer against\r
  */\r
-#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) )\r
+#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( portBASE_TYPE ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) )\r
 \r
 /*\r
  * Return the list a list item is contained within (referenced from).\r