Skip to content

Error parsing function with static macro #522

Open
@Kochise

Description

@Kochise

Hi, using Visual Studio 2017 Pro and CodeMaid 10.4 yet I found out that adding some macros in front of some function implementation, that breaks the parsing. However it looks like the void keyword helps to recover from the parsing misalignment :

__STATIC
psOssMemBlck_Node (oss_mem_blck__impl_tlsf__NodePrevGet)
( pVoid	i_panBuffer
)
{ --> 'psOssMemBlck_Node(oss_mem_blck__impl_tlsf__NodePrevGet)'
Balloon : __STATIC (pVoid i_PanBuffer) psOssMemBlck_Node()

If I comment out the __STATIC :

//__STATIC
psOssMemBlck_Node (oss_mem_blck__impl_tlsf__NodePrevGet)
( pVoid	i_panBuffer
)
{ --> 'oss_mem_blck__impl_tlsf__NodePrevGet(pVoid i_panBuffer)'
Balloon : psOssMemBlck_Node() oss_mem_blck__impl_tlsf__NodePrevGet(i_panBuffer)

However if the return is a void, it gets parsed correctly :

__STATIC
void (oss_mem_blck__impl_tlsf__NodeFreeAdd)
( psOssMemBlck_Bank	i_psBank
, psOssMemBlck_Node	i_psNode
, nU32			i_nIndexPage
, nU32			i_nIndexRow
)
{ --> 'oss_mem_blck__impl_tlsf__NodeFreeAdd(psOssMemBlck_Bank i_psBank...)'
Balloon : void() oss_mem_blck__impl_tlsf__NodeFreeAdd(i_psBank, i_psNode, i_nIndexPage, i_nIndexRow)

Btw, __STATIC is defined as follow :

#if !defined(__STATIC)
	#define __STATIC	static
#endif	// defined(__STATIC)

#if !defined(__STATIC_INLINE)
	#define __STATIC_INLINE	__STATIC __INLINE
#endif	// defined(__STATIC_INLINE)

The other things are typedefs like :

typedef struct dsOssMemBlck_Bank
{ some stuff;
} sOssMemBlck_Bank, *psOssMemBlck_Bank;

Functions' name are between parenthesis to differentiate them from their macro counterpart which features default structure initialization code to mimic C++ default value parameters.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions