From d34236ba40379847ad4ee3140366bee37b652615 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 17 Dec 2020 12:51:35 -0300 Subject: Add param validation to typedef function pointers Currently typedef'd function pointers, typically used as callbacks, don't have their `@param` documentation properly validated. This commit adds a proper check by initializing their memberdef with the parsed args. To avoid duplicating the params in the output, since typedef's already have the params in their definition, an extra check was added. Signed-off-by: Fabio Utzig --- src/doxygen.cpp | 2 +- src/memberdef.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index e246628..e2ab088 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2351,7 +2351,7 @@ static MemberDef *addVariableToFile( type,name,args,0, root->protection, Normal,root->stat,Member, mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(), - ArgumentList(), root->metaData) }; + root->argList, root->metaData) }; md->setTagInfo(root->tagInfo()); md->setMemberSpecifiers(root->spec); md->setDocumentation(root->doc,root->docFile,root->docLine); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index ca6026e..ecc07d7 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -845,7 +845,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me const ArgumentList &defArgList=(md->isDocsForDefinition()) ? md->argumentList() : md->declArgumentList(); //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition()); - if (!defArgList.hasParameters() || md->isProperty()) + if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef()) { return FALSE; // member has no function like argument list } -- cgit v0.12