From 23d8bd36a5b8eb1f4d913b50db31a567a63ad994 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 30 Sep 2019 19:13:58 +0200 Subject: Nicer warning for missing parameter In case of just 1 missing parameter use the singular form (checking was already done, now we just count). --- src/docparser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index da4cfb2..8f7c2d2 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -508,7 +508,7 @@ static void checkUnOrMultipleDocumentedParams() { ArgumentListIterator ali(*al); const Argument *a; - bool found=FALSE; + int notArgCnt=0; for (ali.toFirst();(a=ali.current());++ali) { int count = 0; @@ -523,7 +523,7 @@ static void checkUnOrMultipleDocumentedParams() } else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a->docs.isEmpty()) { - found = TRUE; + notArgCnt++; } else { @@ -544,14 +544,16 @@ static void checkUnOrMultipleDocumentedParams() " has multiple @param documentation sections"); } } - if (found) + if (notArgCnt>0) { bool first=TRUE; QCString errMsg= - "The following parameters of "+ + "The following parameter"; + errMsg+= (notArgCnt>1 ? "s" : ""); + errMsg+=" of "+ QCString(g_memberDef->qualifiedName()) + QCString(argListToString(al)) + - " are not documented:\n"; + (notArgCnt>1 ? " are" : " is") + " not documented:\n"; for (ali.toFirst();(a=ali.current());++ali) { QCString argName = g_memberDef->isDefine() ? a->type : a->name; -- cgit v0.12