I'm studying the source code of FreeRTOS. I found this snippet: https://github.com/TheKK/myFreeRTOS/blob/master/include/list.h#L268
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
{ \
List_t * const pxConstList = ( pxList ); \
/* Increment the index to the next item and return the item, ensuring */ \
/* we don't return the marker used at the end of the list. */ \
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
{ \
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
} \
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
}
I know that ( pxConstList )->pxIndex
means access the data of pointer variable pxConstList. But I'm wondering what is the meaning of surround a variable with parenthesis only
?
That is:
List_t * const pxConstList = ( pxList );
~~~~~~~~~~
and
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner;
~~~~~~~~~~
Thanks.