From dcd90f9779e3d2608e4c1e9225d1c0e5c12249f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20=27Morty=27=20Str=C3=BCbe?= Date: Sat, 21 Mar 2020 16:33:06 +0100 Subject: Fix not correctly formatted messages --- src/definition.cpp | 2 +- src/docparser.cpp | 452 +++++++++++++++++++------------------- src/doxygen.cpp | 11 +- src/fortranscanner.l | 12 +- src/language.cpp | 2 +- src/tagreader.cpp | 148 +++++++------ src/util.cpp | 608 +++++++++++++++++++++++++-------------------------- src/vhdldocgen.cpp | 16 +- 8 files changed, 624 insertions(+), 627 deletions(-) diff --git a/src/definition.cpp b/src/definition.cpp index e4b75a1..6a15547 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -736,7 +736,7 @@ class FilterCache if (numBytes!=item->fileSize) { err("Failed to read %d bytes from position %d in filter database file %s: got %d bytes\n", - (int)item->fileSize,(int)item->filePos,qPrint(Doxygen::filterDBFileName),numBytes); + (int)item->fileSize,(int)item->filePos,qPrint(Doxygen::filterDBFileName),(int)numBytes); success=FALSE; } } diff --git a/src/docparser.cpp b/src/docparser.cpp index 0cc7080..a9be280 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1,13 +1,13 @@ /****************************************************************************** * - * + * * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -70,11 +70,11 @@ //#define DBG(x) myprintf x #define INTERNAL_ASSERT(x) do {} while(0) -//#define INTERNAL_ASSERT(x) if (!(x)) DBG(("INTERNAL_ASSERT(%s) failed retval=0x%x: file=%s line=%d\n",#x,retval,__FILE__,__LINE__)); +//#define INTERNAL_ASSERT(x) if (!(x)) DBG(("INTERNAL_ASSERT(%s) failed retval=0x%x: file=%s line=%d\n",#x,retval,__FILE__,__LINE__)); //--------------------------------------------------------------------------- -static const char *sectionLevelToName[] = +static const char *sectionLevelToName[] = { "page", "section", @@ -116,7 +116,7 @@ static int g_includeFileLine; static bool g_includeFileShowLineNo; -/** Parser's context to store all global variables. +/** Parser's context to store all global variables. */ struct DocParserContext { @@ -196,7 +196,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE) ctx->includeFileLength = g_includeFileLength; ctx->includeFileLine = g_includeFileLine; ctx->includeFileLineNo = g_includeFileShowLineNo; - + ctx->token = g_token; g_token = new TokenInfo; @@ -291,7 +291,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName)); text+="Possible candidates:\n"; text+=showFileDefMatches(Doxygen::imageNameDict,fileName); - warn_doc_error(g_fileName,doctokenizerYYlineno,text); + warn_doc_error(g_fileName,doctokenizerYYlineno,"%s", text.data()); } QCString inputFile = fd->absFilePath(); @@ -364,7 +364,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool "could not open image %s",qPrint(fileName)); } - if (type==DocImage::Latex && Config_getBool(USE_PDFLATEX) && + if (type==DocImage::Latex && Config_getBool(USE_PDFLATEX) && fd->name().right(4)==".eps" ) { // we have an .eps image in pdflatex mode => convert it to a pdf. @@ -389,7 +389,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool if (result.left(5)!="http:" && result.left(6)!="https:" && dowarn) { warn_doc_error(g_fileName,doctokenizerYYlineno, - "image file %s is not found in IMAGE_PATH: " + "image file %s is not found in IMAGE_PATH: " "assuming external image.",qPrint(fileName) ); } @@ -404,7 +404,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool * are disabled altogether). */ static void checkArgumentName(const QCString &name) -{ +{ if (!Config_getBool(WARN_IF_DOC_ERROR)) return; if (g_memberDef==0) return; // not a member const ArgumentList &al=g_memberDef->isDocsForDefinition() ? @@ -474,9 +474,10 @@ static void checkRetvalName(const QCString &name) { warn_doc_error(g_memberDef->getDefFileName(), g_memberDef->getDefLine(), - "return value '" + name + "' of " + + "%s", + ("return value '" + name + "' of " + QCString(g_memberDef->qualifiedName()) + - " has multiple documentation sections"); + " has multiple documentation sections").data()); } g_retvalsFound.insert(name,(void *)(0x8)); } @@ -510,7 +511,7 @@ static void checkUnOrMultipleDocumentedParams() { // allow undocumented self / cls parameter for Python } - else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty()) + else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty()) { notArgCnt++; } @@ -527,10 +528,11 @@ static void checkUnOrMultipleDocumentedParams() { warn_doc_error(g_memberDef->getDefFileName(), g_memberDef->getDefLine(), - "argument '" + aName + + "%s", + ("argument '" + aName + "' from the argument list of " + QCString(g_memberDef->qualifiedName()) + - " has multiple @param documentation sections"); + " has multiple @param documentation sections").data()); } } if (notArgCnt>0) @@ -540,7 +542,7 @@ static void checkUnOrMultipleDocumentedParams() "The following parameter"; errMsg+= (notArgCnt>1 ? "s" : ""); errMsg+=" of "+ - QCString(g_memberDef->qualifiedName()) + + QCString(g_memberDef->qualifiedName()) + QCString(argListToString(al)) + (notArgCnt>1 ? " are" : " is") + " not documented:\n"; for (const Argument &a : al) @@ -567,7 +569,8 @@ static void checkUnOrMultipleDocumentedParams() } warn_doc_error(g_memberDef->getDefFileName(), g_memberDef->getDefLine(), - substitute(errMsg,"%","%%")); + "%s", + substitute(errMsg,"%","%%").data()); } } } @@ -584,7 +587,7 @@ static QCString stripKnownExtensions(const char *text) result=result.left(result.length()-4); } else if (result.right(Doxygen::htmlFileExtension.length())== - QCString(Doxygen::htmlFileExtension)) + QCString(Doxygen::htmlFileExtension)) { result=result.left(result.length()-Doxygen::htmlFileExtension.length()); } @@ -625,7 +628,7 @@ static bool insideUL(DocNode *n) { while (n) { - if (n->kind()==DocNode::Kind_HtmlList && + if (n->kind()==DocNode::Kind_HtmlList && ((DocHtmlList *)n)->type()==DocHtmlList::Unordered) return TRUE; n=n->parent(); } @@ -639,7 +642,7 @@ static bool insideOL(DocNode *n) { while (n) { - if (n->kind()==DocNode::Kind_HtmlList && + if (n->kind()==DocNode::Kind_HtmlList && ((DocHtmlList *)n)->type()==DocHtmlList::Ordered) return TRUE; n=n->parent(); } @@ -683,7 +686,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (l==0) return FALSE; int funcStart=cmdArg.find('('); - if (funcStart==-1) + if (funcStart==-1) { funcStart=l; } @@ -693,9 +696,9 @@ static bool findDocsForMemberOrCompound(const char *commandName, // beware of scenarios like operator()((foo)bar) int secondParen = cmdArg.find('(', funcStart+1); int leftParen = cmdArg.find(')', funcStart+1); - if (leftParen!=-1 && secondParen!=-1) + if (leftParen!=-1 && secondParen!=-1) { - if (leftParenfind(fullName); - if (cd) // class + if (cd) // class { *pDoc=cd->documentation(); *pBrief=cd->briefDescription(); @@ -790,7 +793,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, } } while (scopeOffset>=0); - + return FALSE; } //--------------------------------------------------------------------------- @@ -821,7 +824,7 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok, //--------------------------------------------------------------------------- // forward declaration -static bool defaultHandleToken(DocNode *parent,int tok, +static bool defaultHandleToken(DocNode *parent,int tok, QList &children,bool handleWord=TRUE); @@ -837,15 +840,15 @@ static int handleStyleArgument(DocNode *parent,QList &children, qPrint(saveCmdName)); return tok; } - while ((tok=doctokenizerYYlex()) && - tok!=TK_WHITESPACE && + while ((tok=doctokenizerYYlex()) && + tok!=TK_WHITESPACE && tok!=TK_NEWPARA && - tok!=TK_LISTITEM && + tok!=TK_LISTITEM && tok!=TK_ENDLIST ) { static QRegExp specialChar("[.,|()\\[\\]:;\\?]"); - if (tok==TK_WORD && g_token->name.length()==1 && + if (tok==TK_WORD && g_token->name.length()==1 && g_token->name.find(specialChar)!=-1) { // special character that ends the markup command @@ -858,7 +861,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, case TK_HTMLTAG: if (insideLI(parent) && Mappers::htmlTagMapper->map(g_token->name) && g_token->endTag) { // ignore as the end of a style command - continue; + continue; } return tok; break; @@ -871,7 +874,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, } DBG(("handleStyleArgument(%s) end tok=%x\n",qPrint(saveCmdName),tok)); return (tok==TK_NEWPARA || tok==TK_LISTITEM || tok==TK_ENDLIST - ) ? tok : RetVal_OK; + ) ? tok : RetVal_OK; } /*! Called when a style change starts. For instance a \ command is @@ -938,7 +941,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList &children) if (!g_styleStack.isEmpty()) { DocStyleChange *sc = g_styleStack.top(); - while (sc && sc->position()>=g_nodeStack.count()) + while (sc && sc->position()>=g_nodeStack.count()) { // there are unclosed style modifiers in the paragraph children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),sc->tagName(),FALSE)); g_initialStyleStack.push(sc); @@ -1059,7 +1062,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor bool ambig; FileDef *fd = findFileDef(Doxygen::inputNameDict,g_fileName,ambig); //printf("handleLinkedWord(%s) g_context=%s\n",g_token->name.data(),g_context.data()); - if (!g_insideHtmlLink && + if (!g_insideHtmlLink && (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member,TRUE,fd,TRUE) || (!g_context.isEmpty() && // also try with global scope resolveRef("",g_token->name,g_inSeeBlock,&compound,&member,FALSE,0,TRUE)) @@ -1069,12 +1072,12 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor //printf("resolveRef %s = %p (linkable?=%d)\n",qPrint(g_token->name),member,member ? member->isLinkable() : FALSE); if (member && member->isLinkable()) // member link { - if (member->isObjCMethod()) + if (member->isObjCMethod()) { bool localLink = g_memberDef ? member->getClassDef()==g_memberDef->getClassDef() : FALSE; name = member->objCMethodName(localLink,g_inSeeBlock); } - children.append(new + children.append(new DocLinkedWord(parent,name, member->getReference(), member->getOutputFileBase(), @@ -1094,7 +1097,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor { name=(dynamic_cast(compound))->groupTitle(); } - children.append(new + children.append(new DocLinkedWord(parent,name, compound->getReference(), compound->getOutputFileBase(), @@ -1107,7 +1110,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor (dynamic_cast(compound))->generateSourceFile() ) // undocumented file that has source code we can link to { - children.append(new + children.append(new DocLinkedWord(parent,g_token->name, compound->getReference(), compound->getSourceFileBase(), @@ -1123,7 +1126,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor } else if (!g_insideHtmlLink && len>1 && g_token->name.at(len-1)==':') { - // special case, where matching Foo: fails to be an Obj-C reference, + // special case, where matching Foo: fails to be an Obj-C reference, // but Foo itself might be linkable. g_token->name=g_token->name.left(len-1); handleLinkedWord(parent,children,ignoreAutoLinkFlag); @@ -1133,7 +1136,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor { // special case 2, where the token name is not a class, but could // be a Obj-C protocol - children.append(new + children.append(new DocLinkedWord(parent,name, cd->getReference(), cd->getOutputFileBase(), @@ -1145,7 +1148,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor // { // // special case 3, where the token name is not a class, but could // // be a C# generic -// children.append(new +// children.append(new // DocLinkedWord(parent,name, // cd->getReference(), // cd->getOutputFileBase(), @@ -1397,7 +1400,7 @@ reparsetoken: children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,FALSE)); if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," ")); if (tok==TK_NEWPARA) goto handlepara; - else if (tok==TK_WORD || tok==TK_HTMLTAG) + else if (tok==TK_WORD || tok==TK_HTMLTAG) { DBG(("CMD_EMPHASIS: reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -1411,7 +1414,7 @@ reparsetoken: children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,FALSE)); if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," ")); if (tok==TK_NEWPARA) goto handlepara; - else if (tok==TK_WORD || tok==TK_HTMLTAG) + else if (tok==TK_WORD || tok==TK_HTMLTAG) { DBG(("CMD_BOLD: reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -1425,7 +1428,7 @@ reparsetoken: children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,FALSE)); if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," ")); if (tok==TK_NEWPARA) goto handlepara; - else if (tok==TK_WORD || tok==TK_HTMLTAG) + else if (tok==TK_WORD || tok==TK_HTMLTAG) { DBG(("CMD_CODE: reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -1464,7 +1467,7 @@ reparsetoken: doctokenizerYYsetStateLatexOnly(); tok = doctokenizerYYlex(); children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName)); - if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"latexonly section ended without end marker",doctokenizerYYlineno); + if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"latexonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -1473,7 +1476,7 @@ reparsetoken: doctokenizerYYsetStateXmlOnly(); tok = doctokenizerYYlex(); children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName)); - if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"xmlonly section ended without end marker",doctokenizerYYlineno); + if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"xmlonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -1482,7 +1485,7 @@ reparsetoken: doctokenizerYYsetStateDbOnly(); tok = doctokenizerYYlex(); children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName)); - if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker",doctokenizerYYlineno); + if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -1670,7 +1673,7 @@ reparsetoken: } } break; - case TK_SYMBOL: + case TK_SYMBOL: { DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName); if (s!=DocSymbol::Sym_Unknown) @@ -1683,15 +1686,15 @@ reparsetoken: } } break; - case TK_WHITESPACE: - case TK_NEWPARA: + case TK_WHITESPACE: + case TK_NEWPARA: handlepara: if (insidePRE(parent) || !children.isEmpty()) { children.append(new DocWhiteSpace(parent,g_token->chars)); } break; - case TK_LNKWORD: + case TK_LNKWORD: if (handleWord) { handleLinkedWord(parent,children); @@ -1699,7 +1702,7 @@ handlepara: else return FALSE; break; - case TK_WORD: + case TK_WORD: if (handleWord) { children.append(new DocWord(parent,g_token->name)); @@ -1806,7 +1809,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children, DocPara *par = new DocPara(parent); if (isFirst) { par->markFirst(); isFirst=FALSE; } retval=par->parse(); - if (!par->isEmpty()) + if (!par->isEmpty()) { children.append(par); if (lastPar) lastPar->markLast(FALSE); @@ -1849,7 +1852,7 @@ static void readTextFileByName(const QCString &file,QCString &text) text = fileToString(absFileName,Config_getBool(FILTER_SOURCE_FILES)); return; } - s=examplePathList.next(); + s=examplePathList.next(); } // as a fallback we also look in the exampleNameDict @@ -1875,10 +1878,10 @@ static void readTextFileByName(const QCString &file,QCString &text) //--------------------------------------------------------------------------- -DocWord::DocWord(DocNode *parent,const QCString &word) : - m_word(word) +DocWord::DocWord(DocNode *parent,const QCString &word) : + m_word(word) { - m_parent = parent; + m_parent = parent; //printf("new word %s url=%s\n",word.data(),g_searchUrl.data()); if (Doxygen::searchIndex && !g_searchUrl.isEmpty()) { @@ -1890,12 +1893,12 @@ DocWord::DocWord(DocNode *parent,const QCString &word) : DocLinkedWord::DocLinkedWord(DocNode *parent,const QCString &word, const QCString &ref,const QCString &file, - const QCString &anchor,const QCString &tooltip) : - m_word(word), m_ref(ref), + const QCString &anchor,const QCString &tooltip) : + m_word(word), m_ref(ref), m_file(file), m_relPath(g_relPath), m_anchor(anchor), m_tooltip(tooltip) { - m_parent = parent; + m_parent = parent; //printf("DocLinkedWord: new word %s url=%s tooltip='%s'\n", // word.data(),g_searchUrl.data(),tooltip.data()); if (Doxygen::searchIndex && !g_searchUrl.isEmpty()) @@ -1908,7 +1911,7 @@ DocLinkedWord::DocLinkedWord(DocNode *parent,const QCString &word, DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) { - m_parent = parent; + m_parent = parent; if (id.isEmpty()) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label"); @@ -1925,7 +1928,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) m_file = convertNameToFile(ct.fileName(),FALSE,TRUE); m_anchor = id; } - else + else { warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid cite anchor id '%s'",qPrint(id)); m_anchor = "invalid"; @@ -1990,7 +1993,7 @@ void DocInclude::parse() g_includeFileShowLineNo = (m_type == DontIncWithLines || m_type == IncWithLines); //printf("g_includeFile=<<%s>>\n",g_includeFileText.data()); break; - case VerbInclude: + case VerbInclude: // fall through case HtmlInclude: case LatexInclude: @@ -2012,8 +2015,8 @@ void DocInclude::parse() m_blockId.data(),m_file.data(),count); } break; - case DocInclude::SnippetDoc: - case DocInclude::IncludeDoc: + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" "Please create a bug report\n",__FILE__); break; @@ -2045,7 +2048,7 @@ void DocIncOperator::parse() while (odefinitionType()==Definition::TypeFile || - compound->definitionType()==Definition::TypePage ? TRUE : FALSE) : + compound->definitionType()==Definition::TypePage ? TRUE : FALSE) : FALSE; m_text = linkToText(compound?compound->getLanguage():SrcLangExt_Unknown,target,isFile); m_anchor = anchor; @@ -2496,7 +2499,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : } m_text = target; warn_doc_error(g_fileName,doctokenizerYYlineno,"unable to resolve reference to '%s' for \\ref command", - qPrint(target)); + qPrint(target)); } static void flattenParagraphs(DocNode *root,QList &children) @@ -2560,7 +2563,7 @@ void DocRef::parse() } handlePendingStyleCommands(this,m_children); - + DocNode *n=g_nodeStack.pop(); ASSERT(n==this); } @@ -2606,7 +2609,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont //--------------------------------------------------------------------------- -DocLink::DocLink(DocNode *parent,const QCString &target) +DocLink::DocLink(DocNode *parent,const QCString &target) { m_parent = parent; const Definition *compound = 0; @@ -2638,7 +2641,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target) // bogus link target warn_doc_error(g_fileName,doctokenizerYYlineno,"unable to resolve link to '%s' for \\link command", - qPrint(target)); + qPrint(target)); } @@ -2674,7 +2677,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) break; } break; - case TK_SYMBOL: + case TK_SYMBOL: warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found as part of a \\link", qPrint(g_token->name)); break; @@ -2685,8 +2688,8 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) qPrint(g_token->name)); } goto endlink; - case TK_LNKWORD: - case TK_WORD: + case TK_LNKWORD: + case TK_WORD: if (isJavaLink) // special case to detect closing } { QCString w = g_token->name; @@ -2718,7 +2721,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) if (tok==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside" - " link command\n"); + " link command\n"); } endlink: @@ -2737,10 +2740,10 @@ endlink: //--------------------------------------------------------------------------- -DocDotFile::DocDotFile(DocNode *parent,const QCString &name,const QCString &context) : +DocDotFile::DocDotFile(DocNode *parent,const QCString &name,const QCString &context) : m_name(name), m_relPath(g_relPath), m_context(context) { - m_parent = parent; + m_parent = parent; } bool DocDotFile::parse() @@ -2774,10 +2777,10 @@ bool DocDotFile::parse() return ok; } -DocMscFile::DocMscFile(DocNode *parent,const QCString &name,const QCString &context) : +DocMscFile::DocMscFile(DocNode *parent,const QCString &name,const QCString &context) : m_name(name), m_relPath(g_relPath), m_context(context) { - m_parent = parent; + m_parent = parent; } bool DocMscFile::parse() @@ -2932,7 +2935,7 @@ int DocHtmlHeader::parse() if (m_level!=1) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -2941,7 +2944,7 @@ int DocHtmlHeader::parse() if (m_level!=2) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -2950,7 +2953,7 @@ int DocHtmlHeader::parse() if (m_level!=3) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -2959,7 +2962,7 @@ int DocHtmlHeader::parse() if (m_level!=4) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -2968,7 +2971,7 @@ int DocHtmlHeader::parse() if (m_level!=5) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -2977,7 +2980,7 @@ int DocHtmlHeader::parse() if (m_level!=6) { warn_doc_error(g_fileName,doctokenizerYYlineno," ended with ", - m_level); + m_level); } goto endheader; } @@ -3010,7 +3013,7 @@ int DocHtmlHeader::parse() if (tok==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside" - " tag\n",m_level); + " tag\n",m_level); } endheader: handlePendingStyleCommands(this,m_children); @@ -3045,7 +3048,7 @@ int DocHRef::parse() else { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected html tag <%s%s> found within context", - g_token->endTag?"/":"",qPrint(g_token->name),doctokenizerYYlineno); + g_token->endTag?"/":"",qPrint(g_token->name)); } } break; @@ -3058,7 +3061,7 @@ int DocHRef::parse() if (tok==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside" - " tag",doctokenizerYYlineno); + " tag"); } endhref: handlePendingStyleCommands(this,m_children); @@ -3084,7 +3087,7 @@ int DocInternal::parse(int level) DocPara *par = new DocPara(this); if (isFirst) { par->markFirst(); isFirst=FALSE; } retval=par->parse(); - if (!par->isEmpty()) + if (!par->isEmpty()) { m_children.append(par); lastPar=par; @@ -3095,9 +3098,9 @@ int DocInternal::parse(int level) } if (retval==TK_LISTITEM) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found",doctokenizerYYlineno); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found"); } - } while (retval!=0 && + } while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Subsection && retval!=RetVal_Subsubsection && @@ -3107,7 +3110,7 @@ int DocInternal::parse(int level) if (lastPar) lastPar->markLast(); // then parse any number of level-n sections - while ((level==1 && retval==RetVal_Section) || + while ((level==1 && retval==RetVal_Section) || (level==2 && retval==RetVal_Subsection) || (level==3 && retval==RetVal_Subsubsection) || (level==4 && retval==RetVal_Paragraph) @@ -3152,8 +3155,8 @@ int DocIndexEntry::parse() case TK_WHITESPACE: m_entry+=" "; break; - case TK_WORD: - case TK_LNKWORD: + case TK_WORD: + case TK_LNKWORD: m_entry+=g_token->name; break; case TK_SYMBOL: @@ -3293,7 +3296,7 @@ int DocHtmlCaption::parse() if (tok==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside" - " tag",doctokenizerYYlineno); + " tag"); } endcaption: handlePendingStyleCommands(this,m_children); @@ -3384,7 +3387,7 @@ uint DocHtmlCell::rowSpan() const uint retval = 0; HtmlAttribList attrs = attribs(); uint i; - for (i=0; iname.lower()=="rowspan") { @@ -3400,7 +3403,7 @@ uint DocHtmlCell::colSpan() const uint retval = 1; HtmlAttribList attrs = attribs(); uint i; - for (i=0; iname.lower()=="colspan") { @@ -3587,7 +3590,7 @@ int DocHtmlTable::parse() int retval=RetVal_OK; g_nodeStack.push(this); DBG(("DocHtmlTable::parse() start\n")); - + getrow: // get next token int tok=doctokenizerYYlex(); @@ -3635,14 +3638,14 @@ getrow: warn_doc_error(g_fileName,doctokenizerYYlineno,"expected tag but found %s token instead!", tokToString(tok)); } - + // parse one or more rows while (retval==RetVal_TableRow) { DocHtmlRow *tr=new DocHtmlRow(this,g_token->attribs); m_children.append(tr); retval=tr->parse(); - } + } computeTableGrid(); @@ -3657,7 +3660,7 @@ int DocHtmlTable::parseXml() int retval=RetVal_OK; g_nodeStack.push(this); DBG(("DocHtmlTable::parseXml() start\n")); - + // get next token int tok=doctokenizerYYlex(); // skip whitespace @@ -3686,7 +3689,7 @@ int DocHtmlTable::parseXml() m_children.append(tr); retval=tr->parseXml(isHeader); isHeader=FALSE; - } + } computeTableGrid(); @@ -3702,7 +3705,7 @@ struct ActiveRowSpan { ActiveRowSpan(uint rows,uint col) : rowsLeft(rows), column(col) {} uint rowsLeft; - uint column; + uint column; }; /** List of ActiveRowSpan classes. */ @@ -3741,8 +3744,8 @@ void DocHtmlTable::computeTableGrid() for (i=0;irowsLeft>0 && - rowSpans.at(i)->column==colIdx) + if (rowSpans.at(i)->rowsLeft>0 && + rowSpans.at(i)->column==colIdx) { colIdx=rowSpans.at(i)->column+1; cells++; @@ -3752,7 +3755,7 @@ void DocHtmlTable::computeTableGrid() //printf("found cell at (%d,%d)\n",rowIdx,colIdx); cell->setRowIndex(rowIdx); cell->setColumnIndex(colIdx); - colIdx+=cs; + colIdx+=cs; cells++; } } @@ -3769,9 +3772,9 @@ void DocHtmlTable::computeTableGrid() m_numCols = maxCols; } -void DocHtmlTable::accept(DocVisitor *v) -{ - v->visitPre(this); +void DocHtmlTable::accept(DocVisitor *v) +{ + v->visitPre(this); // for HTML output we put the caption first //if (m_caption && v->id()==DocVisitor_Html) m_caption->accept(v); // doxygen 1.8.11: always put the caption first @@ -3781,7 +3784,7 @@ void DocHtmlTable::accept(DocVisitor *v) for (cli.toFirst();(n=cli.current());++cli) n->accept(v); // for other output formats we put the caption last //if (m_caption && v->id()!=DocVisitor_Html) m_caption->accept(v); - v->visitPost(this); + v->visitPost(this); } //--------------------------------------------------------------------------- @@ -3877,7 +3880,7 @@ int DocHtmlDescTitle::parse() } } break; - case TK_SYMBOL: + case TK_SYMBOL: warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol \\%s found as part of a
tag", qPrint(g_token->name)); break; @@ -3928,7 +3931,7 @@ int DocHtmlDescTitle::parse() if (tok==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside" - "
tag"); + "
tag"); } endtitle: handlePendingStyleCommands(this,m_children); @@ -3958,7 +3961,7 @@ int DocHtmlDescData::parse() } while (retval==TK_NEWPARA); if (par) par->markLast(); - + DBG(("DocHtmlDescData::parse() end\n")); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); @@ -4163,7 +4166,7 @@ int DocHtmlList::parse() m_children.append(li); retval=li->parse(); } while (retval==RetVal_ListItem); - + if (retval==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment while inside <%cl> block", @@ -4226,7 +4229,7 @@ int DocHtmlList::parseXml() if (retval==0) break; //printf("retval=%x g_token->name=%s\n",retval,qPrint(g_token->name)); } while (retval==RetVal_ListItem); - + if (retval==0) { warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment while inside block", @@ -4237,8 +4240,8 @@ endlist: DBG(("DocHtmlList::parseXml() end retval=%x\n",retval)); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); - return retval==RetVal_EndList || - (retval==RetVal_CloseXml || g_token->name=="list") ? + return retval==RetVal_EndList || + (retval==RetVal_CloseXml || g_token->name=="list") ? RetVal_OK : retval; } @@ -4250,7 +4253,7 @@ int DocHtmlBlockQuote::parse() int retval=0; g_nodeStack.push(this); - // parse one or more paragraphs + // parse one or more paragraphs bool isFirst=TRUE; DocPara *par=0; do @@ -4277,7 +4280,7 @@ int DocParBlock::parse() int retval=0; g_nodeStack.push(this); - // parse one or more paragraphs + // parse one or more paragraphs bool isFirst=TRUE; DocPara *par=0; do @@ -4328,17 +4331,17 @@ int DocSimpleList::parse() //-------------------------------------------------------------------------- -DocAutoListItem::DocAutoListItem(DocNode *parent,int indent,int num) +DocAutoListItem::DocAutoListItem(DocNode *parent,int indent,int num) : m_indent(indent), m_itemNum(num) -{ - m_parent = parent; +{ + m_parent = parent; } int DocAutoListItem::parse() { int retval = RetVal_OK; g_nodeStack.push(this); - + // first parse any number of paragraphs bool isFirst=TRUE; DocPara *lastPar=0; @@ -4347,7 +4350,7 @@ int DocAutoListItem::parse() DocPara *par = new DocPara(this); if (isFirst) { par->markFirst(); isFirst=FALSE; } retval=par->parse(); - if (!par->isEmpty()) + if (!par->isEmpty()) { m_children.append(par); if (lastPar) lastPar->markLast(FALSE); @@ -4371,11 +4374,11 @@ int DocAutoListItem::parse() //-------------------------------------------------------------------------- DocAutoList::DocAutoList(DocNode *parent,int indent,bool isEnumList, - int depth) : + int depth) : m_indent(indent), m_isEnumList(isEnumList), m_depth(depth) -{ - m_parent = parent; +{ + m_parent = parent; } int DocAutoList::parse() @@ -4395,11 +4398,11 @@ int DocAutoList::parse() m_children.append(li); retval=li->parse(); //printf("DocAutoList::parse(): retval=0x%x g_token->indent=%d m_indent=%d " - // "m_isEnumList=%d g_token->isEnumList=%d g_token->name=%s\n", + // "m_isEnumList=%d g_token->isEnumList=%d g_token->name=%s\n", // retval,g_token->indent,m_indent,m_isEnumList,g_token->isEnumList, // g_token->name.data()); //printf("num=%d g_token->id=%d\n",num,g_token->id); - } + } while (retval==TK_LISTITEM && // new list item m_indent==g_token->indent && // at same indent level m_isEnumList==g_token->isEnumList && // of the same kind @@ -4441,16 +4444,16 @@ void DocTitle::parseFromString(const QCString &text) //-------------------------------------------------------------------------- -DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) : +DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) : m_type(t) -{ - m_parent = parent; - m_title=0; +{ + m_parent = parent; + m_title=0; } DocSimpleSect::~DocSimpleSect() -{ - delete m_title; +{ + delete m_title; } void DocSimpleSect::accept(DocVisitor *v) @@ -4474,10 +4477,10 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator) m_title = new DocTitle(this); m_title->parse(); } - + // add new paragraph as child DocPara *par = new DocPara(this); - if (m_children.isEmpty()) + if (m_children.isEmpty()) { par->markFirst(); } @@ -4489,7 +4492,7 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator) par->markLast(); if (needsSeparator) m_children.append(new DocSimpleSectSep(this)); m_children.append(par); - + // parse the contents of the paragraph int retval = par->parse(); @@ -4515,7 +4518,7 @@ int DocSimpleSect::parseRcs() DBG(("DocSimpleSect::parseRcs()\n")); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); - return RetVal_OK; + return RetVal_OK; } int DocSimpleSect::parseXml() @@ -4524,11 +4527,11 @@ int DocSimpleSect::parseXml() g_nodeStack.push(this); int retval = RetVal_OK; - for (;;) + for (;;) { // add new paragraph as child DocPara *par = new DocPara(this); - if (m_children.isEmpty()) + if (m_children.isEmpty()) { par->markFirst(); } @@ -4543,17 +4546,17 @@ int DocSimpleSect::parseXml() // parse the contents of the paragraph retval = par->parse(); if (retval == 0) break; - if (retval == RetVal_CloseXml) + if (retval == RetVal_CloseXml) { retval = RetVal_OK; break; } } - + DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval)); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); - return retval; + return retval; } void DocSimpleSect::appendLinkWord(const QCString &word) @@ -4567,12 +4570,12 @@ void DocSimpleSect::appendLinkWord(const QCString &word) else { p = (DocPara *)m_children.getLast(); - + // Comma-separate links. p->injectToken(TK_WORD,","); p->injectToken(TK_WHITESPACE," "); } - + g_inSeeBlock=TRUE; p->injectToken(TK_LNKWORD,word); g_inSeeBlock=FALSE; @@ -4698,7 +4701,7 @@ int DocParamList::parseXml(const QCString ¶mName) g_hasReturnCommand=TRUE; checkRetvalName(g_token->name); } - + handleLinkedWord(this,m_params); do @@ -4727,11 +4730,11 @@ int DocParamList::parseXml(const QCString ¶mName) if (retval == 0) break; - } while (retval==RetVal_CloseXml && + } while (retval==RetVal_CloseXml && Mappers::htmlTagMapper->map(g_token->name)!=XML_PARAM && Mappers::htmlTagMapper->map(g_token->name)!=XML_TYPEPARAM && Mappers::htmlTagMapper->map(g_token->name)!=XML_EXCEPTION); - + if (retval==0) /* premature end of comment block */ { @@ -4787,7 +4790,7 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d) { retval = RetVal_OK; } - + DBG(("DocParamSect::parse() end retval=%d\n",retval)); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); @@ -4922,7 +4925,7 @@ int DocPara::handleXRefItem() { m_children.append(ref); } - else + else { delete ref; } @@ -5316,7 +5319,7 @@ int DocPara::handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs,int level) // For XML tags whose content is stored in attributes rather than // contained within the element, we need a way to inject the attribute // text into the current paragraph. -bool DocPara::injectToken(int tok,const QCString &tokText) +bool DocPara::injectToken(int tok,const QCString &tokText) { g_token->name = tokText; return defaultHandleToken(this,tok,m_children); @@ -5389,19 +5392,19 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) break; case CMD_EMPHASIS: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,TRUE)); - retval=handleStyleArgument(this,m_children,cmdName); + retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,FALSE)); if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); break; case CMD_BOLD: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,TRUE)); - retval=handleStyleArgument(this,m_children,cmdName); + retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,FALSE)); if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); break; case CMD_CODE: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,TRUE)); - retval=handleStyleArgument(this,m_children,cmdName); + retval=handleStyleArgument(this,m_children,cmdName); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,FALSE)); if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); break; @@ -5597,7 +5600,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) doctokenizerYYsetStateDbOnly(); retval = doctokenizerYYlex(); m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName)); - if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker",doctokenizerYYlineno); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -5687,7 +5690,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) case CMD_ENDMSC: case CMD_ENDUML: warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected command %s",qPrint(g_token->name)); - break; + break; case CMD_PARAM: retval = handleParamSection(cmdName,DocParamSect::Param,FALSE,g_token->paramDir); break; @@ -5873,26 +5876,26 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) ASSERT(0); break; } - INTERNAL_ASSERT(retval==0 || retval==RetVal_OK || retval==RetVal_SimpleSec || + INTERNAL_ASSERT(retval==0 || retval==RetVal_OK || retval==RetVal_SimpleSec || retval==TK_LISTITEM || retval==TK_ENDLIST || retval==TK_NEWPARA || - retval==RetVal_Section || retval==RetVal_EndList || - retval==RetVal_Internal || retval==RetVal_SwitchLang || + retval==RetVal_Section || retval==RetVal_EndList || + retval==RetVal_Internal || retval==RetVal_SwitchLang || retval==RetVal_EndInternal ); DBG(("handleCommand(%s) end retval=%x\n",qPrint(cmdName),retval)); return retval; } -static bool findAttribute(const HtmlAttribList &tagHtmlAttribs, - const char *attrName, - QCString *result) +static bool findAttribute(const HtmlAttribList &tagHtmlAttribs, + const char *attrName, + QCString *result) { HtmlAttribListIterator li(tagHtmlAttribs); HtmlAttrib *opt; for (li.toFirst();(opt=li.current());++li) { - if (opt->name==attrName) + if (opt->name==attrName) { *result = opt->value; return TRUE; @@ -5906,7 +5909,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta DBG(("handleHtmlStartTag(%s,%d)\n",qPrint(tagName),tagHtmlAttribs.count())); int retval=RetVal_OK; int tagId = Mappers::htmlTagMapper->map(tagName); - if (g_token->emptyTag && !(tagId&XML_CmdMask) && + if (g_token->emptyTag && !(tagId&XML_CmdMask) && tagId!=HTML_UNKNOWN && tagId!=HTML_IMG && tagId!=HTML_BR && tagId!=HTML_HR && tagId!=HTML_P) { warn_doc_error(g_fileName,doctokenizerYYlineno,"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.", @@ -5914,7 +5917,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta } switch (tagId) { - case HTML_UL: + case HTML_UL: if (!g_token->emptyTag) { DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Unordered); @@ -5922,7 +5925,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta retval=list->parse(); } break; - case HTML_OL: + case HTML_OL: if (!g_token->emptyTag) { DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Ordered); @@ -5961,8 +5964,8 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta break; case HTML_CODE: if (g_token->emptyTag) break; - if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment) - // for C# source or inside a or section we + if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment) + // for C# source or inside a or section we // treat as an XML tag (so similar to @code) { doctokenizerYYsetStateXmlCode(); @@ -6140,7 +6143,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta { //printf("paramName=%s\n",paramName.data()); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,TRUE)); - m_children.append(new DocWord(this,paramName)); + m_children.append(new DocWord(this,paramName)); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,FALSE)); if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); } @@ -6195,7 +6198,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta case XML_SEE: // I'm not sure if is the same as or if it // should you link a member without producing a section. The - // C# specification is extremely vague about this (but what else + // C# specification is extremely vague about this (but what else // can we expect from Microsoft...) { QCString cref; @@ -6327,7 +6330,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) int retval=RetVal_OK; switch (tagId) { - case HTML_UL: + case HTML_UL: if (!insideUL(this)) { warn_doc_error(g_fileName,doctokenizerYYlineno,"found tag without matching
    "); @@ -6337,7 +6340,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) retval=RetVal_EndList; } break; - case HTML_OL: + case HTML_OL: if (!insideOL(this)) { warn_doc_error(g_fileName,doctokenizerYYlineno,"found tag without matching
      "); @@ -6555,8 +6558,8 @@ reparsetoken: DocNode::Kind k; if (insidePRE(this) || // all whitespace is relevant ( - // remove leading whitespace - !m_children.isEmpty() && + // remove leading whitespace + !m_children.isEmpty() && // and whitespace after certain constructs (k=m_children.getLast()->kind())!=DocNode::Kind_HtmlDescList && k!=DocNode::Kind_HtmlTable && @@ -6585,7 +6588,7 @@ reparsetoken: { DocAutoList *al = (DocAutoList *)n; DBG(("previous list item at %d\n",al->indent())); - if (al->indent()>=g_token->indent) + if (al->indent()>=g_token->indent) // new item at the same or lower indent level { retval=TK_LISTITEM; @@ -6596,9 +6599,9 @@ reparsetoken: // determine list depth int depth = 0; n=parent(); - while(n) + while(n) { - if (n->kind() == DocNode::Kind_AutoList && + if (n->kind() == DocNode::Kind_AutoList && ((DocAutoList*)n)->isEnumList()) depth++; n=n->parent(); } @@ -6651,7 +6654,7 @@ reparsetoken: } } break; - case TK_ENDLIST: + case TK_ENDLIST: DBG(("Found end of list inside of paragraph at line %d\n",doctokenizerYYlineno)); if (parent()->kind()==DocNode::Kind_AutoListItem) { @@ -6682,10 +6685,10 @@ reparsetoken: // see if we have to start a simple section int cmd = Mappers::cmdMapper->map(g_token->name); DocNode *n=parent(); - while (n && - n->kind()!=DocNode::Kind_SimpleSect && + while (n && + n->kind()!=DocNode::Kind_SimpleSect && n->kind()!=DocNode::Kind_ParamSect - ) + ) { n=n->parent(); } @@ -6736,25 +6739,25 @@ reparsetoken: DBG(("reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; } - else if (retval==RetVal_OK) + else if (retval==RetVal_OK) { // the command ended normally, keep scanning for new tokens. retval = 0; } else if (retval>0 && retvalendTag) // found a start tag { @@ -6764,7 +6767,7 @@ reparsetoken: { retval = handleHtmlEndTag(g_token->name); } - if (retval==RetVal_OK) + if (retval==RetVal_OK) { // the command ended normally, keep scanner for new tokens. retval = 0; @@ -6775,7 +6778,7 @@ reparsetoken: } } break; - case TK_SYMBOL: + case TK_SYMBOL: { DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name); if (s!=DocSymbol::Sym_Unknown) @@ -6789,16 +6792,16 @@ reparsetoken: } break; } - case TK_NEWPARA: + case TK_NEWPARA: retval=TK_NEWPARA; goto endparagraph; case TK_RCSTAG: { DocNode *n=parent(); - while (n && - n->kind()!=DocNode::Kind_SimpleSect && + while (n && + n->kind()!=DocNode::Kind_SimpleSect && n->kind()!=DocNode::Kind_ParamSect - ) + ) { n=n->parent(); } @@ -6835,11 +6838,11 @@ endparagraph: { ((DocPara *)n)->setAttribs(g_token->attribs); } - INTERNAL_ASSERT(retval==0 || retval==TK_NEWPARA || retval==TK_LISTITEM || - retval==TK_ENDLIST || retval>RetVal_OK + INTERNAL_ASSERT(retval==0 || retval==TK_NEWPARA || retval==TK_LISTITEM || + retval==TK_ENDLIST || retval>RetVal_OK ); - return retval; + return retval; } //-------------------------------------------------------------------------- @@ -6870,7 +6873,7 @@ int DocSection::parse() DocPara *par = new DocPara(this); if (isFirst) { par->markFirst(); isFirst=FALSE; } retval=par->parse(); - if (!par->isEmpty()) + if (!par->isEmpty()) { m_children.append(par); lastPar=par; @@ -6893,7 +6896,7 @@ int DocSection::parse() retval=RetVal_OK; } } - } while (retval!=0 && + } while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Subsection && retval!=RetVal_Subsubsection && @@ -6945,7 +6948,7 @@ int DocSection::parse() m_children.append(s); retval = s->parse(); } - if (!(m_levelname)); break; - case TK_WHITESPACE: + case TK_WHITESPACE: m_children.append(new DocWhiteSpace(this,g_token->chars)); break; - case TK_SYMBOL: + case TK_SYMBOL: { DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name); if (s!=DocSymbol::Sym_Unknown) @@ -7262,7 +7265,7 @@ static QCString extractCopyDocId(const char *data, uint &j, uint len) case '\'': insideSQuote=TRUE; break; case ' ': // fall through case '\t': // fall through - case '\n': + case '\n': found=(round==0); break; } @@ -7581,10 +7584,10 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, docParserPushContext(); if (ctx && ctx!=Doxygen::globalScope && - (ctx->definitionType()==Definition::TypeClass || + (ctx->definitionType()==Definition::TypeClass || ctx->definitionType()==Definition::TypeNamespace - ) - ) + ) + ) { g_context = ctx->name(); } @@ -7622,7 +7625,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, { g_searchUrl=md->getOutputFileBase(); Doxygen::searchIndex->setCurrentDoc( - (md->getLanguage()==SrcLangExt_Fortran ? + (md->getLanguage()==SrcLangExt_Fortran ? theTranslator->trSubprogram(TRUE,TRUE): theTranslator->trMember(TRUE,TRUE))+" "+md->qualifiedName(), g_searchUrl, @@ -7702,8 +7705,8 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, } g_fileName = fileName; - g_relPath = (!linkFromIndex && ctx) ? - QCString(relativePathToRoot(ctx->getOutputFileBase())) : + g_relPath = (!linkFromIndex && ctx) ? + QCString(relativePathToRoot(ctx->getOutputFileBase())) : QCString(""); //printf("ctx->name=%s relPath=%s\n",ctx->name().data(),g_relPath.data()); g_memberDef = md; @@ -7724,7 +7727,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, g_retvalsFound.clear(); g_paramsFound.setAutoDelete(FALSE); g_paramsFound.clear(); - + //printf("Starting comment block at %s:%d\n",g_fileName.data(),startLine); doctokenizerYYlineno=startLine; uint inpLen=qstrlen(input); @@ -7762,7 +7765,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, //printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"", // md?md->name().data():""); - + return root; } @@ -7827,4 +7830,3 @@ void docFindSections(const char *input, { doctokenizerYYFindSections(input,d,fileName); } - diff --git a/src/doxygen.cpp b/src/doxygen.cpp index c269067..f76a26f 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -209,7 +209,7 @@ class Statistics Statistics() { stats.setAutoDelete(TRUE); } void begin(const char *name) { - msg(name); + msg("%s", name); stat *entry= new stat(name,0); stats.append(entry); time.restart(); @@ -557,7 +557,7 @@ static void buildFileList(const Entry *root) { text+="is not an input file"; } - warn(fn,root->startLine,text); + warn(fn,root->startLine,"%s", text.data()); } } for (const auto &e : root->children()) buildFileList(e.get()); @@ -611,7 +611,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,const Entry *root) { text+="is not an input file"; } - warn(root->fileName,root->startLine,text); + warn(root->fileName,root->startLine, "%s", text.data()); } else if (includeFile.isEmpty() && ifd && // see if the file extension makes sense @@ -5285,7 +5285,7 @@ static bool findGlobalMember(const Entry *root, " of file "+md->getDefFileName()+"\n"; } } - warn(root->fileName,root->startLine,warnMsg); + warn(root->fileName,root->startLine, "%s", warnMsg.data()); } } else // got docs for an undefined member! @@ -8379,7 +8379,7 @@ static void findDefineDocumentation(Entry *root) else { warn(root->fileName,root->startLine, - "found documented #define but ignoring it because " + "found documented #define %s but ignoring it because " "ENABLE_PREPROCESSING is NO.\n", root->name.data() ); @@ -11646,4 +11646,3 @@ void generateOutput() // delete Doxygen::symbolStorage; g_successfulRun=TRUE; } - diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 95842f0..df4941d 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -2581,8 +2581,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b else { // something different specified, give warning and leave error. - warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args + - " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName); + warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args + + " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data()); handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " + yyextra->argName + " " + loc_doc,brief); } @@ -2605,8 +2605,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b } else { - warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args + - " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName); + warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args + + " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data()); handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " + yyextra->argName + " " + loc_doc,brief); } @@ -2627,8 +2627,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b } else { - warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args + - " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName); + warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args + + " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data()); handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " + yyextra->argName + " " + loc_doc,brief); } diff --git a/src/language.cpp b/src/language.cpp index 7457676..299c452 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -417,6 +417,6 @@ bool setTranslator(const char *langName) } QCString msg = theTranslator->updateNeededMessage(); - if (!msg.isEmpty()) warn_uncond(msg); + if (!msg.isEmpty()) warn_uncond("%s", msg.data()); return TRUE; } diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 3640f0e..275d66a 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -1,13 +1,13 @@ /****************************************************************************** * - * + * * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -50,7 +50,7 @@ class TagAnchorInfo public: TagAnchorInfo(const QCString &f, const QCString &l, - const QCString &t=QCString()) + const QCString &t=QCString()) : label(l), fileName(f), title(t) {} QCString label; QCString fileName; @@ -60,7 +60,7 @@ class TagAnchorInfo /** List of TagAnchorInfo objects. */ class TagAnchorInfoList : public QList { - public: + public: TagAnchorInfoList() : QList() { setAutoDelete(TRUE); } virtual ~TagAnchorInfoList() {} }; @@ -79,7 +79,7 @@ class TagEnumValueInfo class TagMemberInfo { public: - TagMemberInfo() : prot(Public), virt(Normal), isStatic(FALSE) + TagMemberInfo() : prot(Public), virt(Normal), isStatic(FALSE) { enumValues.setAutoDelete(TRUE); } QCString type; QCString name; @@ -91,7 +91,7 @@ class TagMemberInfo TagAnchorInfoList docAnchors; Protection prot; Specifier virt; - bool isStatic; + bool isStatic; QList enumValues; }; @@ -207,10 +207,10 @@ class TagDirInfo TagAnchorInfoList docAnchors; }; -/** Tag file parser. +/** Tag file parser. * * Reads an XML-structured tagfile and builds up the structure in - * memory. The method buildLists() is used to transfer/translate + * memory. The method buildLists() is used to transfer/translate * the structures to the doxygen engine. */ class TagFileParser : public QXmlDefaultHandler @@ -229,7 +229,7 @@ class TagFileParser : public QXmlDefaultHandler }; class StartElementHandler { - typedef void (TagFileParser::*Handler)(const QXmlAttributes &attrib); + typedef void (TagFileParser::*Handler)(const QXmlAttributes &attrib); public: StartElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {} void operator()(const QXmlAttributes &attrib) { (m_parent->*m_handler)(attrib); } @@ -240,7 +240,7 @@ class TagFileParser : public QXmlDefaultHandler class EndElementHandler { - typedef void (TagFileParser::*Handler)(); + typedef void (TagFileParser::*Handler)(); public: EndElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {} void operator()() { (m_parent->*m_handler)(); } @@ -282,7 +282,7 @@ class TagFileParser : public QXmlDefaultHandler void warn(const char *fmt) { - ::warn(m_inputFileName,m_locator->lineNumber(),fmt); + ::warn(m_inputFileName,m_locator->lineNumber(),"%s", fmt); } void warn(const char *fmt,const char *s) { @@ -391,7 +391,7 @@ class TagFileParser : public QXmlDefaultHandler } if (isObjC=="yes" && m_curClass) { - m_curClass->isObjC = TRUE; + m_curClass->isObjC = TRUE; } } @@ -399,20 +399,20 @@ class TagFileParser : public QXmlDefaultHandler { switch (m_state) { - case InClass: m_tagFileClasses.append(m_curClass); - m_curClass=0; break; - case InFile: m_tagFileFiles.append(m_curFile); - m_curFile=0; break; - case InNamespace: m_tagFileNamespaces.append(m_curNamespace); - m_curNamespace=0; break; - case InGroup: m_tagFileGroups.append(m_curGroup); - m_curGroup=0; break; - case InPage: m_tagFilePages.append(m_curPage); - m_curPage=0; break; + case InClass: m_tagFileClasses.append(m_curClass); + m_curClass=0; break; + case InFile: m_tagFileFiles.append(m_curFile); + m_curFile=0; break; + case InNamespace: m_tagFileNamespaces.append(m_curNamespace); + m_curNamespace=0; break; + case InGroup: m_tagFileGroups.append(m_curGroup); + m_curGroup=0; break; + case InPage: m_tagFilePages.append(m_curPage); + m_curPage=0; break; case InDir: m_tagFileDirs.append(m_curDir); m_curDir=0; break; - case InPackage: m_tagFilePackages.append(m_curPackage); - m_curPackage=0; break; + case InPackage: m_tagFilePackages.append(m_curPackage); + m_curPackage=0; break; default: warn("tag 'compound' was not expected!"); } @@ -460,7 +460,7 @@ class TagFileParser : public QXmlDefaultHandler case InNamespace: m_curNamespace->members.append(m_curMember); break; case InGroup: m_curGroup->members.append(m_curMember); break; case InPackage: m_curPackage->members.append(m_curMember); break; - default: warn("Unexpected tag 'member' found"); break; + default: warn("Unexpected tag 'member' found"); break; } } @@ -484,7 +484,7 @@ class TagFileParser : public QXmlDefaultHandler void endEnumValue() { - m_curEnumValue->name = m_curString.stripWhiteSpace(); + m_curEnumValue->name = m_curString.stripWhiteSpace(); m_state = *m_stateStack.top(); m_stateStack.remove(); if (m_state==InMember) @@ -536,7 +536,7 @@ class TagFileParser : public QXmlDefaultHandler case InNamespace: m_curNamespace->classList.append(m_curString); break; case InGroup: m_curGroup->classList.append(m_curString); break; case InPackage: m_curPackage->classList.append(m_curString); break; - default: warn("Unexpected tag 'class' found"); break; + default: warn("Unexpected tag 'class' found"); break; } } @@ -547,7 +547,7 @@ class TagFileParser : public QXmlDefaultHandler case InNamespace: m_curNamespace->classList.append(m_curString); break; case InFile: m_curFile->namespaceList.append(m_curString); break; case InGroup: m_curGroup->namespaceList.append(m_curString); break; - default: warn("Unexpected tag 'namespace' found"); break; + default: warn("Unexpected tag 'namespace' found"); break; } } @@ -557,7 +557,7 @@ class TagFileParser : public QXmlDefaultHandler { case InGroup: m_curGroup->fileList.append(m_curString); break; case InDir: m_curDir->fileList.append(m_curString); break; - default: warn("Unexpected tag 'file' found"); break; + default: warn("Unexpected tag 'file' found"); break; } } @@ -566,7 +566,7 @@ class TagFileParser : public QXmlDefaultHandler switch(m_state) { case InGroup: m_curGroup->fileList.append(m_curString); break; - default: warn("Unexpected tag 'page' found"); break; + default: warn("Unexpected tag 'page' found"); break; } } @@ -575,7 +575,7 @@ class TagFileParser : public QXmlDefaultHandler switch(m_state) { case InDir: m_curDir->subdirList.append(m_curString); break; - default: warn("Unexpected tag 'dir' found"); break; + default: warn("Unexpected tag 'dir' found"); break; } } @@ -595,7 +595,7 @@ class TagFileParser : public QXmlDefaultHandler { if (m_state==InMember) { - m_curMember->type = m_curString; + m_curMember->type = m_curString; } else { @@ -615,7 +615,7 @@ class TagFileParser : public QXmlDefaultHandler case InDir: m_curDir->name = m_curString; break; case InMember: m_curMember->name = m_curString; break; case InPackage: m_curPackage->name = m_curString; break; - default: warn("Unexpected tag 'name' found"); break; + default: warn("Unexpected tag 'name' found"); break; } } @@ -687,7 +687,7 @@ class TagFileParser : public QXmlDefaultHandler { if (m_state==InClass && m_curClass) { - if (m_curClass->templateArguments==0) + if (m_curClass->templateArguments==0) { m_curClass->templateArguments = new QList; m_curClass->templateArguments->setAutoDelete(TRUE); @@ -711,7 +711,7 @@ class TagFileParser : public QXmlDefaultHandler case InPage: m_curPage->filename = m_curString; break; case InPackage: m_curPackage->filename = m_curString; break; case InDir: m_curDir->filename = m_curString; break; - default: warn("Unexpected tag 'filename' found"); break; + default: warn("Unexpected tag 'filename' found"); break; } } @@ -721,19 +721,19 @@ class TagFileParser : public QXmlDefaultHandler { case InFile: m_curFile->path = m_curString; break; case InDir: m_curDir->path = m_curString; break; - default: warn("Unexpected tag 'path' found"); break; + default: warn("Unexpected tag 'path' found"); break; } } - + void endAnchor() { if (m_state==InMember) { - m_curMember->anchor = m_curString; + m_curMember->anchor = m_curString; } else if (m_state==InClass) { - m_curClass->anchor = m_curString; + m_curClass->anchor = m_curString; } else { @@ -745,7 +745,7 @@ class TagFileParser : public QXmlDefaultHandler { if (m_state==InMember) { - m_curMember->clangId = m_curString; + m_curMember->clangId = m_curString; } else if (m_state==InClass) { @@ -762,24 +762,24 @@ class TagFileParser : public QXmlDefaultHandler } - + void endAnchorFile() { if (m_state==InMember) { - m_curMember->anchorFile = m_curString; + m_curMember->anchorFile = m_curString; } else { warn("Unexpected tag 'anchorfile' found"); } } - + void endArglist() { if (m_state==InMember) { - m_curMember->arglist = m_curString; + m_curMember->arglist = m_curString; } else { @@ -792,7 +792,7 @@ class TagFileParser : public QXmlDefaultHandler { case InGroup: m_curGroup->title = m_curString; break; case InPage: m_curPage->title = m_curString; break; - default: warn("Unexpected tag 'title' found"); break; + default: warn("Unexpected tag 'title' found"); break; } } @@ -888,7 +888,7 @@ class TagFileParser : public QXmlDefaultHandler return TRUE; } - bool startElement( const QString&, const QString&, + bool startElement( const QString&, const QString&, const QString&name, const QXmlAttributes& attrib ) { //printf("startElement '%s'\n",name.data()); @@ -897,7 +897,7 @@ class TagFileParser : public QXmlDefaultHandler { (*handler)(attrib); } - else + else { warn("Unknown tag '%s' found!",name.data()); } @@ -912,14 +912,14 @@ class TagFileParser : public QXmlDefaultHandler { (*handler)(); } - else + else { warn("Unknown tag '%s' found!",name.data()); } return TRUE; } - bool characters ( const QString & ch ) + bool characters ( const QString & ch ) { m_curString+=ch.utf8(); return TRUE; @@ -928,7 +928,7 @@ class TagFileParser : public QXmlDefaultHandler void dump(); void buildLists(const std::shared_ptr &root); void addIncludes(); - + private: void buildMemberList(const std::shared_ptr &ce,QList &members); void addDocAnchors(const std::shared_ptr &e,const TagAnchorInfoList &l); @@ -961,7 +961,7 @@ class TagFileParser : public QXmlDefaultHandler QCString m_inputFileName; }; -/** Error handler for the XML tag file parser. +/** Error handler for the XML tag file parser. * * Basically dumps all fatal error to stderr using err(). */ @@ -1026,8 +1026,8 @@ void TagFileParser::dump() msg("namespace '%s'\n",nd->name.data()); msg(" filename '%s'\n",nd->filename.data()); QCStringList::Iterator it; - for ( it = nd->classList.begin(); - it != nd->classList.end(); ++it ) + for ( it = nd->classList.begin(); + it != nd->classList.end(); ++it ) { msg( " class: %s \n", (*it).data() ); } @@ -1051,13 +1051,13 @@ void TagFileParser::dump() msg("file '%s'\n",fd->name.data()); msg(" filename '%s'\n",fd->filename.data()); QCStringList::Iterator it; - for ( it = fd->namespaceList.begin(); - it != fd->namespaceList.end(); ++it ) + for ( it = fd->namespaceList.begin(); + it != fd->namespaceList.end(); ++it ) { msg( " namespace: %s \n", (*it).data() ); } - for ( it = fd->classList.begin(); - it != fd->classList.end(); ++it ) + for ( it = fd->classList.begin(); + it != fd->classList.end(); ++it ) { msg( " class: %s \n", (*it).data() ); } @@ -1089,28 +1089,28 @@ void TagFileParser::dump() msg("group '%s'\n",gd->name.data()); msg(" filename '%s'\n",gd->filename.data()); QCStringList::Iterator it; - for ( it = gd->namespaceList.begin(); - it != gd->namespaceList.end(); ++it ) + for ( it = gd->namespaceList.begin(); + it != gd->namespaceList.end(); ++it ) { msg( " namespace: %s \n", (*it).data() ); } - for ( it = gd->classList.begin(); - it != gd->classList.end(); ++it ) + for ( it = gd->classList.begin(); + it != gd->classList.end(); ++it ) { msg( " class: %s \n", (*it).data() ); } - for ( it = gd->fileList.begin(); - it != gd->fileList.end(); ++it ) + for ( it = gd->fileList.begin(); + it != gd->fileList.end(); ++it ) { msg( " file: %s \n", (*it).data() ); } - for ( it = gd->subgroupList.begin(); - it != gd->subgroupList.end(); ++it ) + for ( it = gd->subgroupList.begin(); + it != gd->subgroupList.end(); ++it ) { msg( " subgroup: %s \n", (*it).data() ); } - for ( it = gd->pageList.begin(); - it != gd->pageList.end(); ++it ) + for ( it = gd->pageList.begin(); + it != gd->pageList.end(); ++it ) { msg( " page: %s \n", (*it).data() ); } @@ -1143,13 +1143,13 @@ void TagFileParser::dump() msg("dir '%s'\n",dd->name.data()); msg(" path '%s'\n",dd->path.data()); QCStringList::Iterator it; - for ( it = dd->fileList.begin(); - it != dd->fileList.end(); ++it ) + for ( it = dd->fileList.begin(); + it != dd->fileList.end(); ++it ) { msg( " file: %s \n", (*it).data() ); } - for ( it = dd->subdirList.begin(); - it != dd->subdirList.end(); ++it ) + for ( it = dd->subdirList.begin(); + it != dd->subdirList.end(); ++it ) { msg( " subdir: %s \n", (*it).data() ); } @@ -1310,7 +1310,7 @@ static QCString stripPath(const QCString &s) } /*! Injects the info gathered by the XML parser into the Entry tree. - * This tree contains the information extracted from the input in a + * This tree contains the information extracted from the input in a * "unrelated" form. */ void TagFileParser::buildLists(const std::shared_ptr &root) @@ -1561,5 +1561,3 @@ void parseTagFile(const std::shared_ptr &root,const char *fullName) handler.addIncludes(); //handler.dump(); } - - diff --git a/src/util.cpp b/src/util.cpp index 7a7d56e..104c80f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,11 +1,11 @@ /***************************************************************************** - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -19,6 +19,8 @@ #include #include #include +#include + #include "md5.h" @@ -84,7 +86,7 @@ #define ALGO_COUNT 1 #define ALGO_CRC16 2 #define ALGO_MD5 3 - + //#define MAP_ALGO ALGO_COUNT //#define MAP_ALGO ALGO_CRC16 #define MAP_ALGO ALGO_MD5 @@ -95,12 +97,12 @@ // TextGeneratorOLImpl implementation //------------------------------------------------------------------------ -TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od) +TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od) { } void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const -{ +{ if (s==0) return; //printf("TextGeneratorOlImpl::writeString('%s',%d)\n",s,keepSpaces); if (keepSpaces) @@ -113,19 +115,19 @@ void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const cs[1]='\0'; while ((c=*p++)) { - if (c==' ') m_od.writeNonBreakableSpace(1); + if (c==' ') m_od.writeNonBreakableSpace(1); else cs[0]=c,m_od.docify(cs); } } } else { - m_od.docify(s); + m_od.docify(s); } } void TextGeneratorOLImpl::writeBreak(int indent) const -{ +{ m_od.lineBreak("typebreak"); int i; for (i=0;i=i && s.at(c)!='@') if (s.at(c--)==':') b2=TRUE; - if (b1 && b2) - { - result+="::"; + if (b1 && b2) + { + result+="::"; } p=i+l; } @@ -248,7 +250,7 @@ done: void writePageRef(OutputDocInterface &od,const char *cn,const char *mn) { od.pushGeneratorState(); - + od.disable(OutputGenerator::Html); od.disable(OutputGenerator::Man); od.disable(OutputGenerator::Docbook); @@ -275,7 +277,7 @@ QCString generateMarker(int id) static QCString stripFromPath(const QCString &path,QStrList &l) { - // look at all the strings in the list and strip the longest match + // look at all the strings in the list and strip the longest match const char *s=l.first(); QCString potential; unsigned int length = 0; @@ -311,7 +313,7 @@ QCString stripFromIncludePath(const QCString &path) } /*! try to determine if \a name is a source or a header file name by looking - * at the extension. A number of variations is allowed in both upper and + * at the extension. A number of variations is allowed in both upper and * lower case) If anyone knows or uses another extension please let me know :-) */ int guessSection(const char *name) @@ -331,7 +333,7 @@ int guessSection(const char *name) n.right(4)==".i++" || n.right(4)==".inl" || n.right(4)==".xml" || - n.right(4)==".sql" + n.right(4)==".sql" ) return Entry::SOURCE_SEC; if (n.right(2)==".h" || // header n.right(3)==".hh" || @@ -352,7 +354,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, //printf("<name().data() : "",qualifiedName.data()); QCString result; - if (qualifiedName.isEmpty()) + if (qualifiedName.isEmpty()) { //printf(" qualified name empty!\n"); return result; @@ -379,7 +381,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, { // step 1: get the right scope const Definition *resScope=mContext; - if (scopeIndex!=-1) + if (scopeIndex!=-1) { // split-off scope part QCString resScopeName = qualifiedName.left(scopeIndex); @@ -400,9 +402,9 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, } } //printf("resScope=%s\n",resScope?resScope->name().data():""); - + // step 2: get the member - if (resScope) // no scope or scope found in the current context + if (resScope) // no scope or scope found in the current context { //printf("scope found: %s, look for typedef %s\n", // resScope->qualifiedName().data(),resName.data()); @@ -424,7 +426,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, for (;(tmd=mni.current());++mni) { //printf("Found member %s resScope=%s outerScope=%s mContext=%p\n", - // tmd->name().data(), resScope->name().data(), + // tmd->name().data(), resScope->name().data(), // tmd->getOuterScope()->name().data(), mContext); if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/) { @@ -465,11 +467,11 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, // qualifiedName.data(),context ? context->name().data() : ""); } return result; - + } -/*! Get a class definition given its name. +/*! Get a class definition given its name. * Returns 0 if the class is not found. */ ClassDef *getClass(const char *n) @@ -532,7 +534,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop * within file \a fileScope. * * Example: typedef A T; will return the class representing A if it is a class. - * + * * Example: typedef int T; will return 0, since "int" is not a class. */ const ClassDef *newResolveTypedef(const FileDef *fileScope, @@ -560,7 +562,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope, if (g_resolvedTypedefs.find(qname)) return 0; // typedef already done g_resolvedTypedefs.insert(qname,md); // put on the trace list - + const ClassDef *typeClass = md->getClassDef(); QCString type = md->typeString(); // get the "value" of the typedef if (typeClass && typeClass->isTemplate() && @@ -572,7 +574,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope, QCString typedefValue = type; int tl=type.length(); int ip=tl-1; // remove * and & at the end - while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' ')) + while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' ')) { ip--; } @@ -587,7 +589,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope, const ClassDef *result = getResolvedClassRec(md->getOuterScope(), fileScope,type,&memTypeDef,0,pResolvedType); // if type is a typedef then return what it resolves to. - if (memTypeDef && memTypeDef->isTypedef()) + if (memTypeDef && memTypeDef->isTypedef()) { result=newResolveTypedef(fileScope,memTypeDef,pMemType,pTemplSpec); goto done; @@ -647,8 +649,8 @@ done: } // remember computed value for next time - if (result && result->getDefFileName()!="") - // this check is needed to prevent that temporary classes that are + if (result && result->getDefFileName()!="") + // this check is needed to prevent that temporary classes that are // introduced while parsing code fragments are being cached here. { //printf("setting cached typedef %p in result %p\n",md,result); @@ -659,9 +661,9 @@ done: pResolvedType ? *pResolvedType : QCString() ); } - + g_resolvedTypedefs.remove(qname); // remove from the trace list - + return result; } @@ -696,11 +698,11 @@ static QCString substTypedef(const Definition *scope,const FileDef *fileScope,co { // test accessibility of typedef within scope. int distance = isAccessibleFromWithExpScope(scope,fileScope,d,""); - if (distance!=-1 && distancetypeString(); if (pTypeDef) *pTypeDef=bestMatch; } - + //printf("substTypedef(%s,%s)=%s\n",scope?scope->name().data():"", // name.data(),result.data()); return result; @@ -750,8 +752,8 @@ static const Definition *endOfPathIsUsedClass(const SDict *cl,const } /*! Starting with scope \a start, the string \a path is interpreted as - * a part of a qualified scope name (e.g. A::B::C), and the scope is - * searched. If found the scope definition is returned, otherwise 0 + * a part of a qualified scope name (e.g. A::B::C), and the scope is + * searched. If found the scope definition is returned, otherwise 0 * is returned. */ static const Definition *followPath(const Definition *start,const FileDef *fileScope,const QCString &path) @@ -782,7 +784,7 @@ static const Definition *followPath(const Definition *start,const FileDef *fileS // qualScopePart.data(), // current->name().data(), // next?next->name().data():""); - if (next==0) // failed to follow the path + if (next==0) // failed to follow the path { //printf("==> next==0!\n"); if (current->definitionType()==Definition::TypeNamespace) @@ -817,7 +819,7 @@ bool accessibleViaUsingClass(const SDict *cl, ) { //printf("accessibleViaUsingClass(%p)\n",cl); - if (cl) // see if the class was imported via a using statement + if (cl) // see if the class was imported via a using statement { SDict::Iterator cli(*cl); Definition *ucd; @@ -826,7 +828,7 @@ bool accessibleViaUsingClass(const SDict *cl, { //printf("Trying via used class %s\n",ucd->name().data()); const Definition *sc = explicitScopePartEmpty ? ucd : followPath(ucd,fileScope,explicitScopePart); - if (sc && sc==item) return TRUE; + if (sc && sc==item) return TRUE; //printf("Try via used class done\n"); } } @@ -849,10 +851,10 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl, //printf("[Trying via used namespace %s: count=%d/%d\n",und->name().data(), // count,nl->count()); const Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart); - if (sc && item->getOuterScope()==sc) + if (sc && item->getOuterScope()==sc) { //printf("] found it\n"); - return TRUE; + return TRUE; } if (item->getLanguage()==SrcLangExt_Cpp) { @@ -916,7 +918,7 @@ class AccessStack for (i=0;iscope==scope && e->fileScope==fileScope && e->item==item) + if (e->scope==scope && e->fileScope==fileScope && e->item==item) { return TRUE; } @@ -929,7 +931,7 @@ class AccessStack for (i=0;iscope==scope && e->fileScope==fileScope && e->item==item && e->expScope==expScope) + if (e->scope==scope && e->fileScope==fileScope && e->item==item && e->expScope==expScope) { return TRUE; } @@ -951,7 +953,7 @@ class AccessStack }; /* Returns the "distance" (=number of levels up) from item to scope, or -1 - * if item in not inside scope. + * if item in not inside scope. */ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Definition *item) { @@ -969,20 +971,20 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi int i; Definition *itemScope=item->getOuterScope(); - bool memberAccessibleFromScope = + bool memberAccessibleFromScope = (item->definitionType()==Definition::TypeMember && // a member itemScope && itemScope->definitionType()==Definition::TypeClass && // of a class scope->definitionType()==Definition::TypeClass && // accessible (dynamic_cast(scope))->isAccessibleMember(dynamic_cast(item)) // from scope ); - bool nestedClassInsideBaseClass = + bool nestedClassInsideBaseClass = (item->definitionType()==Definition::TypeClass && // a nested class - itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base + itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base scope->definitionType()==Definition::TypeClass && // class of scope - (dynamic_cast(scope))->isBaseClass(dynamic_cast(itemScope),TRUE) + (dynamic_cast(scope))->isBaseClass(dynamic_cast(itemScope),TRUE) ); - if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass) + if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass) { //printf("> found it\n"); if (nestedClassInsideBaseClass) result++; // penalty for base class to prevent @@ -994,13 +996,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi if (fileScope) { SDict *cl = fileScope->getUsedClasses(); - if (accessibleViaUsingClass(cl,fileScope,item)) + if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } NamespaceSDict *nl = fileScope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item)) + if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); goto done; @@ -1017,13 +1019,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi const NamespaceDef *nscope = dynamic_cast(scope); //printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses()); const SDict *cl = nscope->getUsedClasses(); - if (accessibleViaUsingClass(cl,fileScope,item)) + if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } const NamespaceSDict *nl = nscope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item)) + if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); goto done; @@ -1050,10 +1052,10 @@ done: * class B { public: class J {}; }; * * - Looking for item=='J' inside scope=='B' will return 0. - * - Looking for item=='I' inside scope=='B' will return -1 + * - Looking for item=='I' inside scope=='B' will return -1 * (as it is not found in B nor in the global scope). - * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but - * not found and then A::I is searched in the global scope, which matches and + * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but + * not found and then A::I is searched in the global scope, which matches and * thus the result is 1. */ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScope, @@ -1097,7 +1099,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop (dynamic_cast(newScope))->isBaseClass(dynamic_cast(itemScope),TRUE,0) ) { - // inheritance is also ok. Example: looking for B::I, where + // inheritance is also ok. Example: looking for B::I, where // class A { public: class I {} }; // class B : public A {} // but looking for B::I, where @@ -1172,7 +1174,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop { const NamespaceDef *nscope = dynamic_cast(scope); const NamespaceSDict *nl = nscope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) + if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); goto done; @@ -1183,7 +1185,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop if (fileScope) { const NamespaceSDict *nl = fileScope->getUsedNamespaces(); - if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) + if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); goto done; @@ -1216,7 +1218,7 @@ int computeQualifiedIndex(const QCString &name) static void getResolvedSymbol(const Definition *scope, const FileDef *fileScope, - Definition *d, + Definition *d, const QCString &explicitScopePart, ArgumentList *actTemplParams, int &minDistance, @@ -1231,8 +1233,8 @@ static void getResolvedSymbol(const Definition *scope, // only look at classes and members that are enums or typedefs if (d->definitionType()==Definition::TypeClass || - (d->definitionType()==Definition::TypeMember && - ((dynamic_cast(d))->isTypedef() || (dynamic_cast(d))->isEnumerate()) + (d->definitionType()==Definition::TypeMember && + ((dynamic_cast(d))->isTypedef() || (dynamic_cast(d))->isEnumerate()) ) ) { @@ -1248,23 +1250,23 @@ static void getResolvedSymbol(const Definition *scope, ClassDef *cd = dynamic_cast(d); //printf("cd=%s\n",cd->name().data()); if (!cd->isTemplateArgument()) // skip classes that - // are only there to - // represent a template + // are only there to + // represent a template // argument { //printf("is not a templ arg\n"); if (distancequalifiedName(); } else if (distance==minDistance && fileScope && bestMatch && - fileScope->getUsedNamespaces() && - d->getOuterScope()->definitionType()==Definition::TypeNamespace && + fileScope->getUsedNamespaces() && + d->getOuterScope()->definitionType()==Definition::TypeNamespace && bestMatch->getOuterScope()==Doxygen::globalScope ) { @@ -1277,7 +1279,7 @@ static void getResolvedSymbol(const Definition *scope, // Just a non-perfect heuristic but it could help in some situations // (kdecore code is an example). minDistance=distance; - bestMatch = cd; + bestMatch = cd; bestTypedef = 0; bestTemplSpec.resize(0); bestResolvedType = cd->qualifiedName(); @@ -1376,7 +1378,7 @@ static void getResolvedSymbol(const Definition *scope, /* Find the fully qualified class name referred to by the input class * or typedef name against the input scope. * Loops through scope and each of its parent scopes looking for a - * match against the input name. Can recursively call itself when + * match against the input name. Can recursively call itself when * resolving typedefs. */ static const ClassDef *getResolvedClassRec(const Definition *scope, @@ -1411,7 +1413,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, name=name.mid(qualifierIndex+2); } - if (name.isEmpty()) + if (name.isEmpty()) { //printf("] empty name\n"); return 0; // empty name @@ -1419,9 +1421,9 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, //printf("Looking for symbol %s\n",name.data()); DefinitionIntf *di = Doxygen::symbolMap->find(name); - // the -g (for C# generics) and -p (for ObjC protocols) are now already + // the -g (for C# generics) and -p (for ObjC protocols) are now already // stripped from the key used in the symbolMap, so that is not needed here. - if (di==0) + if (di==0) { //di = Doxygen::symbolMap->find(name+"-g"); //if (di==0) @@ -1436,11 +1438,11 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, } //printf("found symbol!\n"); - bool hasUsingStatements = - (fileScope && ((fileScope->getUsedNamespaces() && + bool hasUsingStatements = + (fileScope && ((fileScope->getUsedNamespaces() && fileScope->getUsedNamespaces()->count()>0) || - (fileScope->getUsedClasses() && - fileScope->getUsedClasses()->count()>0)) + (fileScope->getUsedClasses() && + fileScope->getUsedClasses()->count()>0)) ); //printf("hasUsingStatements=%d\n",hasUsingStatements); // Since it is often the case that the same name is searched in the same @@ -1467,7 +1469,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, // if a file scope is given and it contains using statements we should // also use the file part in the key (as a class name can be in - // two different namespaces and a using statement in a file can select + // two different namespaces and a using statement in a file can select // one of them). if (hasUsingStatements) { @@ -1483,19 +1485,19 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, //printf("Searching for %s result=%p\n",key.data(),pval); if (pval) { - //printf("LookupInfo %p %p '%s' %p\n", - // pval->classDef, pval->typeDef, pval->templSpec.data(), - // pval->resolvedType.data()); + //printf("LookupInfo %p %p '%s' %p\n", + // pval->classDef, pval->typeDef, pval->templSpec.data(), + // pval->resolvedType.data()); if (pTemplSpec) *pTemplSpec=pval->templSpec; if (pTypeDef) *pTypeDef=pval->typeDef; if (pResolvedType) *pResolvedType=pval->resolvedType; //printf("] cachedMatch=%s\n", // pval->classDef?pval->classDef->name().data():""); - //if (pTemplSpec) + //if (pTemplSpec) // printf("templSpec=%s\n",pTemplSpec->data()); - return pval->classDef; + return pval->classDef; } - else // not found yet; we already add a 0 to avoid the possibility of + else // not found yet; we already add a 0 to avoid the possibility of // endless recursion. { Doxygen::lookupCache->insert(key,new LookupInfo); @@ -1529,7 +1531,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, bestResolvedType); } - if (pTypeDef) + if (pTypeDef) { *pTypeDef = bestTypedef; } @@ -1558,7 +1560,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, } //printf("] bestMatch=%s distance=%d\n", // bestMatch?bestMatch->name().data():"",minDistance); - //if (pTemplSpec) + //if (pTemplSpec) // printf("templSpec=%s\n",pTemplSpec->data()); return bestMatch; } @@ -1566,7 +1568,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope, /* Find the fully qualified class name referred to by the input class * or typedef name against the input scope. * Loops through scope and each of its parent scopes looking for a - * match against the input name. + * match against the input name. */ const ClassDef *getResolvedClass(const Definition *scope, const FileDef *fileScope, @@ -1581,7 +1583,7 @@ const ClassDef *getResolvedClass(const Definition *scope, static bool optimizeOutputVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL); g_resolvedTypedefs.clear(); if (scope==0 || - (scope->definitionType()!=Definition::TypeClass && + (scope->definitionType()!=Definition::TypeClass && scope->definitionType()!=Definition::TypeNamespace ) || (scope->getLanguage()==SrcLangExt_Java && QCString(n).find("::")!=-1) @@ -1610,7 +1612,7 @@ const ClassDef *getResolvedClass(const Definition *scope, { result = getClass(n); } - if (!mayBeUnlinkable && result && !result->isLinkable()) + if (!mayBeUnlinkable && result && !result->isLinkable()) { if (!mayBeHidden || !result->isHidden()) { @@ -1966,10 +1968,10 @@ bool rightScopeMatch(const QCString &scope, const QCString &name) { int sl=scope.length(); int nl=name.length(); - return (name==scope || // equal - (scope.right(nl)==name && // substring + return (name==scope || // equal + (scope.right(nl)==name && // substring sl-nl>1 && scope.at(sl-nl-1)==':' && scope.at(sl-nl-2)==':' // scope - ) + ) ); } @@ -1977,10 +1979,10 @@ bool leftScopeMatch(const QCString &scope, const QCString &name) { int sl=scope.length(); int nl=name.length(); - return (name==scope || // equal - (scope.left(nl)==name && // substring + return (name==scope || // equal + (scope.left(nl)==name && // substring sl>nl+1 && scope.at(nl)==':' && scope.at(nl+1)==':' // scope - ) + ) ); } @@ -2017,11 +2019,11 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, } // add non-word part to the result - bool insideString=FALSE; + bool insideString=FALSE; int i; - for (i=index;iname().data()); // add link to the result @@ -2128,10 +2130,10 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, int m = matchWord.findRev("::"); QCString scopeName; - if (scope && - (scope->definitionType()==Definition::TypeClass || + if (scope && + (scope->definitionType()==Definition::TypeClass || scope->definitionType()==Definition::TypeNamespace - ) + ) ) { scopeName=scope->name(); @@ -2143,19 +2145,19 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, } //printf("ScopeName=%s\n",scopeName.data()); - //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data()); - if (!found && - getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) && - //(md->isTypedef() || md->isEnumerate() || + //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data()); + if (!found && + getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) && + //(md->isTypedef() || md->isEnumerate() || // md->isReference() || md->isVariable() - //) && - (external ? md->isLinkable() : md->isLinkableInProject()) + //) && + (external ? md->isLinkable() : md->isLinkableInProject()) ) { //printf("Found ref scope=%s\n",d?d->name().data():""); //ol.writeObjectLink(d->getReference(),d->getOutputFileBase(), // md->anchor(),word); - if (md!=self && (self==0 || md->name()!=self->name())) + if (md!=self && (self==0 || md->name()!=self->name())) // name check is needed for overloaded members, where getDefs just returns one { /* in case of Fortran scop and the variable is a non Fortran variable: don't link, @@ -2202,7 +2204,7 @@ void writeExample(OutputList &ol,ExampleSDict *ed) ol.parseText(exampleLine.mid(index,newIndex-index)); uint entryIndex = exampleLine.mid(newIndex+1,matchLen-1).toUInt(&ok); Example *e=ed->at(entryIndex); - if (ok && e) + if (ok && e) { ol.pushGeneratorState(); //if (latexEnabled) ol.disable(OutputGenerator::Latex); @@ -2226,7 +2228,7 @@ void writeExample(OutputList &ol,ExampleSDict *ed) ol.popGeneratorState(); } index=newIndex+matchLen; - } + } ol.parseText(exampleLine.right(exampleLine.length()-index)); ol.writeString("."); } @@ -2376,7 +2378,7 @@ int filterCRLF(char *buf,int len) { c = '\n'; // each CR to LF if (src'%s'\n", inputEncoding.data(),outputEncoding); @@ -2501,7 +2503,7 @@ QCString transcodeCharacterStringToUTF8(const QCString &input) /*! reads a file with name \a name and returns it as a string. If \a filter * is TRUE the file will be filtered by any user specified input filter. - * If \a name is "-" the string will be read from standard input. + * If \a name is "-" the string will be read from standard input. */ QCString fileToString(const char *name,bool filter,bool isSourceCode) { @@ -2551,7 +2553,7 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode) return buf.data(); } } - if (!fileOpened) + if (!fileOpened) { err("cannot open file '%s' for reading\n",name); } @@ -2581,7 +2583,7 @@ static QDateTime getCurrentDateTime() static bool warnedOnce=FALSE; if (!warnedOnce) { - warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %llu; actual value %llu\n",UINT_MAX,epoch); + warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %d; actual value %" PRIu64 "\n",UINT_MAX, (uint64_t)epoch); warnedOnce=TRUE; } } @@ -2615,24 +2617,24 @@ QCString yearToString() } //---------------------------------------------------------------------- -// recursive function that returns the number of branches in the +// recursive function that returns the number of branches in the // inheritance tree that the base class 'bcd' is below the class 'cd' int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level) { - if (bcd->categoryOf()) // use class that is being extended in case of + if (bcd->categoryOf()) // use class that is being extended in case of // an Objective-C category { bcd=bcd->categoryOf(); } - if (cd==bcd) return level; + if (cd==bcd) return level; if (level==256) { warn_uncond("class %s seem to have a recursive " "inheritance relation!\n",cd->name().data()); return -1; } - int m=maxInheritanceDepth; + int m=maxInheritanceDepth; if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); @@ -2649,12 +2651,12 @@ int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level) Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot,int level) { - if (bcd->categoryOf()) // use class that is being extended in case of + if (bcd->categoryOf()) // use class that is being extended in case of // an Objective-C category { bcd=bcd->categoryOf(); } - if (cd==bcd) + if (cd==bcd) { goto exit; } @@ -2697,7 +2699,7 @@ void trimBaseClassScope(BaseClassList *bcl,QCString &s,int level=0) } //printf("base class '%s'\n",cd->name().data()); if (cd->baseClasses()) - trimBaseClassScope(cd->baseClasses(),s,level+1); + trimBaseClassScope(cd->baseClasses(),s,level+1); } } @@ -2795,7 +2797,7 @@ static void stripIrrelevantString(QCString &target,const QCString &str) if (i1==-1 && i2==-1) { // strip str from target at index i - target=target.left(i)+target.right(target.length()-i-l); + target=target.left(i)+target.right(target.length()-i-l); changed=TRUE; i-=l; } @@ -2824,8 +2826,8 @@ static void stripIrrelevantString(QCString &target,const QCString &str) \code const T param -> T param // not relevant - const T& param -> const T& param // const needed - T* const param -> T* param // not relevant + const T& param -> const T& param // const needed + T* const param -> T* param // not relevant const T* param -> const T* param // const needed \endcode */ @@ -2863,11 +2865,11 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec) { - + QCString templSpec = spec.stripWhiteSpace(); // this part had been commented out before... but it is needed to match for instance // std::list against list so it is now back again! - if (!templSpec.isEmpty() && templSpec.at(0) == '<') + if (!templSpec.isEmpty() && templSpec.at(0) == '<') { templSpec = "< " + extractCanonicalType(d,fs,templSpec.right(templSpec.length()-1).stripWhiteSpace()); } @@ -2889,7 +2891,7 @@ static QCString getCanonicalTypeForIdentifier( QCString symName,result,templSpec,tmpName; //DefinitionList *defList=0; - if (tSpec && !tSpec->isEmpty()) + if (tSpec && !tSpec->isEmpty()) templSpec = stripDeclKeywords(getCanonicalTemplateSpec(d,fs,*tSpec)); if (word.findRev("::")!=-1 && !(tmpName=stripScope(word)).isEmpty()) @@ -3051,7 +3053,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr QCString ct = getCanonicalTypeForIdentifier(d,fs,word,&templSpec); // in case the ct is empty it means that "word" represents scope "d" - // and this does not need to be added to the canonical + // and this does not need to be added to the canonical // type (it is redundant), so/ we skip it. This solves problem 589616. if (ct.isEmpty() && type.mid(p,2)=="::") { @@ -3065,7 +3067,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr // word.data(),templSpec.data(),canType.data(),ct.data()); if (!templSpec.isEmpty()) // if we didn't use up the templSpec already // (i.e. type is not a template specialization) - // then resolve any identifiers inside. + // then resolve any identifiers inside. { static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*"); int tp=0,tl,ti; @@ -3093,11 +3095,11 @@ static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,co QCString type = arg.type.stripWhiteSpace(); QCString name = arg.name; //printf("----- extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data()); - if ((type=="const" || type=="volatile") && !name.isEmpty()) + if ((type=="const" || type=="volatile") && !name.isEmpty()) { // name is part of type => correct type+=" "; type+=name; - } + } if (name=="const" || name=="volatile") { // name is part of type => correct if (!type.isEmpty()) type+=" "; @@ -3208,7 +3210,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons if (checkCV) { - if (srcAl.constSpecifier != dstAl.constSpecifier) + if (srcAl.constSpecifier != dstAl.constSpecifier) { NOMATCH return FALSE; // one member is const, the other not -> no match @@ -3243,7 +3245,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons } } MATCH - return TRUE; // all arguments match + return TRUE; // all arguments match } @@ -3405,11 +3407,11 @@ static void findMembersWithSpecificName(MemberName *mn, //printf(" md->name()='%s' md->args='%s' fd=%p gd=%p current=%p ref=%s\n", // md->name().data(),args,fd,gd,currentFile,md->getReference().data()); if ( - ((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) && + ((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) && md->getNamespaceDef()==0 && md->isLinkable() && - (!checkStatics || (!md->isStatic() && !md->isDefine()) || + (!checkStatics || (!md->isStatic() && !md->isDefine()) || currentFile==0 || fd==currentFile) // statics must appear in the same file - ) + ) { bool match=TRUE; if (args && !md->isDefine() && qstrcmp(args,"()")!=0) @@ -3422,7 +3424,7 @@ static void findMembersWithSpecificName(MemberName *mn, Doxygen::globalScope,fd,argList, checkCV); } - if (match && (forceTagFile==0 || md->getReference()==forceTagFile)) + if (match && (forceTagFile==0 || md->getReference()==forceTagFile)) { //printf("Found match!\n"); members.append(md); @@ -3436,17 +3438,17 @@ static void findMembersWithSpecificName(MemberName *mn, * memberName may also include a (partial) scope to indicate the scope * in which the member is located. * - * The parameter 'scName' is a string representing the name of the scope in + * The parameter 'scName' is a string representing the name of the scope in * which the link was found. * - * In case of a function args contains a string representation of the - * argument list. Passing 0 means the member has no arguments. + * In case of a function args contains a string representation of the + * argument list. Passing 0 means the member has no arguments. * Passing "()" means any argument list will do, but "()" is preferred. * * The function returns TRUE if the member is known and documented or * FALSE if it is not. - * If TRUE is returned parameter 'md' contains a pointer to the member - * definition. Furthermore exactly one of the parameter 'cd', 'nd', or 'fd' + * If TRUE is returned parameter 'md' contains a pointer to the member + * definition. Furthermore exactly one of the parameter 'cd', 'nd', or 'fd' * will be non-zero: * - if 'cd' is non zero, the member was found in a class pointed to by cd. * - if 'nd' is non zero, the member was found in a namespace pointed to by nd. @@ -3454,12 +3456,12 @@ static void findMembersWithSpecificName(MemberName *mn, * file fd. */ bool getDefs(const QCString &scName, - const QCString &mbName, + const QCString &mbName, const char *args, - const MemberDef *&md, - const ClassDef *&cd, - const FileDef *&fd, - const NamespaceDef *&nd, + const MemberDef *&md, + const ClassDef *&cd, + const FileDef *&fd, + const NamespaceDef *&nd, const GroupDef *&gd, bool forceEmptyScope, const FileDef *currentFile, @@ -3479,12 +3481,12 @@ bool getDefs(const QCString &scName, int is,im=0,pm=0; // strip common part of the scope from the scopeName - while ((is=scopeName.findRev("::"))!=-1 && + while ((is=scopeName.findRev("::"))!=-1 && (im=memberName.find("::",pm))!=-1 && (scopeName.right(scopeName.length()-is-2)==memberName.mid(pm,im-pm)) ) { - scopeName=scopeName.left(is); + scopeName=scopeName.left(is); pm=im+2; } //printf("result after scope corrections scope=%s name=%s\n", @@ -3494,11 +3496,11 @@ bool getDefs(const QCString &scName, QCString mScope; if (memberName.left(9)!="operator " && // treat operator conversion methods // as a special case - (im=memberName.findRev("::"))!=-1 && + (im=memberName.findRev("::"))!=-1 && im<(int)memberName.length()-2 // not A:: ) { - mScope=memberName.left(im); + mScope=memberName.left(im); mName=memberName.right(memberName.length()-im-2); } @@ -3537,13 +3539,13 @@ bool getDefs(const QCString &scName, //printf("Trying class scope %s: fcd=%p tmd=%p\n",className.data(),fcd,tmd); // todo: fill in correct fileScope! if (fcd && // is it a documented class - fcd->isLinkable() + fcd->isLinkable() ) { //printf(" Found fcd=%p\n",fcd); MemberNameIterator mmli(*mn); MemberDef *mmd; - int mdist=maxInheritanceDepth; + int mdist=maxInheritanceDepth; ArgumentList argList; if (args) { @@ -3600,9 +3602,9 @@ bool getDefs(const QCString &scName, } } //printf(" >Success=%d\n",mdistisLinkable() || md->isStrongEnumValue()) + if (!md->isLinkable() || md->isStrongEnumValue()) { md=0; // avoid returning things we cannot link to cd=0; @@ -3615,7 +3617,7 @@ bool getDefs(const QCString &scName, return TRUE; /* found match */ } } - } + } if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum { //printf("Found scoped enum!\n"); @@ -3729,7 +3731,7 @@ bool getDefs(const QCString &scName, namespaceName=mScope.copy(); } //printf("Trying namespace %s\n",namespaceName.data()); - if (!namespaceName.isEmpty() && + if (!namespaceName.isEmpty() && (fnd=Doxygen::namespaceSDict->find(namespaceName)) && fnd->isLinkable() ) @@ -3747,7 +3749,7 @@ bool getDefs(const QCString &scName, if (emd && emd->isStrong()) { //printf("yes match %s<->%s!\n",mScope.data(),emd->localName().data()); - if (emd->getNamespaceDef()==fnd && + if (emd->getNamespaceDef()==fnd && rightScopeMatch(mScope,emd->localName())) { //printf("found it!\n"); @@ -3783,8 +3785,8 @@ bool getDefs(const QCString &scName, } } } - if (!found && args && !qstrcmp(args,"()")) - // no exact match found, but if args="()" an arbitrary + if (!found && args && !qstrcmp(args,"()")) + // no exact match found, but if args="()" an arbitrary // member will do { for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli) @@ -3799,7 +3801,7 @@ bool getDefs(const QCString &scName, } if (found) { - if (!md->isLinkable()) + if (!md->isLinkable()) { md=0; // avoid returning things we cannot link to nd=0; @@ -3893,7 +3895,7 @@ bool getDefs(const QCString &scName, QListIterator mit(members); for (mit.toFirst();(md=mit.current());++mit) { - if (md->getFileDef() && md->getFileDef()->name() == currentFile->name()) + if (md->getFileDef() && md->getFileDef()->name() == currentFile->name()) { break; // found match in the current file } @@ -3908,7 +3910,7 @@ bool getDefs(const QCString &scName, md=members.getLast(); } } - if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong())) + if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong())) // found a matching global member, that is not a scoped enum value (or uniquely matches) { fd=md->getFileDef(); @@ -3926,14 +3928,14 @@ bool getDefs(const QCString &scName, /*! * Searches for a scope definition given its name as a string via parameter - * `scope`. + * `scope`. * - * The parameter `docScope` is a string representing the name of the scope in + * The parameter `docScope` is a string representing the name of the scope in * which the `scope` string was found. * * The function returns TRUE if the scope is known and documented or * FALSE if it is not. - * If TRUE is returned exactly one of the parameter `cd`, `nd` + * If TRUE is returned exactly one of the parameter `cd`, `nd` * will be non-zero: * - if `cd` is non zero, the scope was a class pointed to by cd. * - if `nd` is non zero, the scope was a namespace pointed to by nd. @@ -3950,7 +3952,7 @@ static bool getScopeDefs(const char *docScope,const char *scope, bool explicitGlobalScope=FALSE; if (scopeName.at(0)==':' && scopeName.at(1)==':') { - scopeName=scopeName.right(scopeName.length()-2); + scopeName=scopeName.right(scopeName.length()-2); explicitGlobalScope=TRUE; } if (scopeName.isEmpty()) @@ -3971,11 +3973,11 @@ static bool getScopeDefs(const char *docScope,const char *scope, //(cd=getClass(fullName+"-g")) // C# generic ) && cd->isLinkable()) { - return TRUE; // class link written => quit + return TRUE; // class link written => quit } else if ((nd=Doxygen::namespaceSDict->find(fullName)) && nd->isLinkable()) { - return TRUE; // namespace link written => quit + return TRUE; // namespace link written => quit } if (scopeOffset==0) { @@ -3996,10 +3998,10 @@ static bool isLowerCase(QCString &s) if (p==0) return TRUE; int c; while ((c=*p++)) if (!islower(c)) return FALSE; - return TRUE; + return TRUE; } -/*! Returns an object to reference to given its name and context +/*! Returns an object to reference to given its name and context * @post return value TRUE implies *resContext!=0 or *resMember!=0 */ bool resolveRef(/* in */ const char *scName, @@ -4043,10 +4045,10 @@ bool resolveRef(/* in */ const char *scName, ClassDef *cd=0; NamespaceDef *nd=0; - // the following if() was commented out for releases in the range + // the following if() was commented out for releases in the range // 1.5.2 to 1.6.1, but has been restored as a result of bug report 594787. if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName)) - { // link to lower case only name => do not try to autolink + { // link to lower case only name => do not try to autolink return FALSE; } @@ -4066,7 +4068,7 @@ bool resolveRef(/* in */ const char *scName, } return TRUE; } - else if (scName==fullName || (!inSeeBlock && scopePos==-1)) + else if (scName==fullName || (!inSeeBlock && scopePos==-1)) // nothing to link => output plain text { //printf("found scName=%s fullName=%s scName==fullName=%d " @@ -4086,7 +4088,7 @@ bool resolveRef(/* in */ const char *scName, if (bracePos!=-1) argsStr=fullName.right(fullName.length()-bracePos); // strip template specifier - // TODO: match against the correct partial template instantiation + // TODO: match against the correct partial template instantiation int templPos=nameStr.find('<'); bool tryUnspecializedVersion = FALSE; if (templPos!=-1 && nameStr.find("operator")==-1) @@ -4126,11 +4128,11 @@ bool resolveRef(/* in */ const char *scName, ) { //printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,nameStr.data(),cd,nd); - if (checkScope && md && md->getOuterScope()==Doxygen::globalScope && + if (checkScope && md && md->getOuterScope()==Doxygen::globalScope && !md->isStrongEnumValue() && (!scopeStr.isEmpty() || nameStr.find("::")>0)) { - // we did find a member, but it is a global one while we were explicitly + // we did find a member, but it is a global one while we were explicitly // looking for a scoped variable. See bug 616387 for an example why this check is needed. // note we do need to support autolinking to "::symbol" hence the >0 //printf("not global member!\n"); @@ -4209,20 +4211,20 @@ QCString linkToText(SrcLangExt lang,const char *link,bool isFileName) #if 0 /* * generate a reference to a class, namespace or member. - * 'scName' is the name of the scope that contains the documentation + * 'scName' is the name of the scope that contains the documentation * string that is returned. * 'name' is the name that we want to link to. * 'name' may have the following formats: * 1) "ScopeName" - * 2) "memberName()" one of the (overloaded) function or define + * 2) "memberName()" one of the (overloaded) function or define * with name memberName. - * 3) "memberName(...)" a specific (overloaded) function or define + * 3) "memberName(...)" a specific (overloaded) function or define * with name memberName * 4) "::name a global variable or define * 4) "\#memberName member variable, global variable or define - * 5) ("ScopeName::")+"memberName()" - * 6) ("ScopeName::")+"memberName(...)" - * 7) ("ScopeName::")+"memberName" + * 5) ("ScopeName::")+"memberName()" + * 6) ("ScopeName::")+"memberName(...)" + * 7) ("ScopeName::")+"memberName" * instead of :: the \# symbol may also be used. */ @@ -4384,7 +4386,7 @@ bool resolveLink(/* in */ const char *scName, //---------------------------------------------------------------------- // General function that generates the HTML code for a reference to some -// file, class or member from text 'lr' within the context of class 'clName'. +// file, class or member from text 'lr' within the context of class 'clName'. // This link has the text 'lt' (if not 0), otherwise 'lr' is used as a // basis for the link's text. // returns TRUE if a link could be generated. @@ -4402,14 +4404,14 @@ bool generateLink(OutputDocInterface &od,const char *clName, if (compound) // link to compound { if (lt==0 && anchor.isEmpty() && /* compound link */ - compound->definitionType()==Definition::TypeGroup /* is group */ + compound->definitionType()==Definition::TypeGroup /* is group */ ) { linkText=(dynamic_cast(compound))->groupTitle(); // use group's title as link } else if (compound->definitionType()==Definition::TypeFile) { - linkText=linkToText(compound->getLanguage(),lt,TRUE); + linkText=linkToText(compound->getLanguage(),lt,TRUE); } od.writeObjectLink(compound->getReference(), compound->getOutputFileBase(),anchor,linkText); @@ -4438,12 +4440,12 @@ void generateFileRef(OutputDocInterface &od,const char *name,const char *text) //FileInfo *fi; FileDef *fd; bool ambig; - if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) && - fd->isLinkable()) + if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) && + fd->isLinkable()) // link to documented input file od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,linkText); else - od.docify(linkText); + od.docify(linkText); } //---------------------------------------------------------------------- @@ -4520,7 +4522,7 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) if (slashPos!=-1) { path=name.left(slashPos+1); - name=name.right(name.length()-slashPos-1); + name=name.right(name.length()-slashPos-1); //printf("path=%s name=%s\n",path.data(),name.data()); } if (name.isEmpty()) goto exit; @@ -4553,10 +4555,10 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) for (fni.toFirst();(fd=fni.current());++fni) { QCString fdStripPath = stripFromIncludePath(fd->getPath()); - if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped) - { - count++; - lastMatch=fd; + if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped) + { + count++; + lastMatch=fd; } } //printf(">1 ===> add to cache %p\n",fd); @@ -4590,7 +4592,7 @@ QCString showFileDefMatches(const FileNameDict *fnDict,const char *n) if (slashPos!=-1) { path=name.left(slashPos+1); - name=name.right(name.length()-slashPos-1); + name=name.right(name.length()-slashPos-1); } FileName *fn; if ((fn=(*fnDict)[name])) @@ -4743,7 +4745,7 @@ QCString substituteKeywords(const QCString &s,const char *title, /*! Returns the character index within \a name of the first prefix * in Config_getList(IGNORE_PREFIX) that matches \a name at the left hand side, * or zero if no match was found - */ + */ int getPrefixIndex(const QCString &name) { if (name.isEmpty()) return 0; @@ -4791,7 +4793,7 @@ bool classHasVisibleChildren(const ClassDef *cd) if (cd->baseClasses()==0) return FALSE; bcl=cd->baseClasses(); } - else + else { if (cd->subClasses()==0) return FALSE; bcl=cd->subClasses(); @@ -4882,7 +4884,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor case '@': growBuf.addStr("_0d"); break; case ']': growBuf.addStr("_0e"); break; case '[': growBuf.addStr("_0f"); break; - default: + default: if (c<0) { char ids[5]; @@ -4944,7 +4946,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor else { growBuf.addChar('_'); - growBuf.addChar((char)tolower(c)); + growBuf.addChar((char)tolower(c)); } break; } @@ -5024,7 +5026,7 @@ QCString unescapeCharsInString(const char *s) } /*! This function determines the file name on disk of an item - * given its name, which could be a class name with template + * given its name, which could be a class name with template * arguments, so special characters need to be escaped. */ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore) @@ -5050,7 +5052,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore) { num = *value; } - result.sprintf("a%05d",num); + result.sprintf("a%05d",num); } else // long names { @@ -5063,17 +5065,17 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore) QCString sigStr(33); MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig); MD5SigToString(md5_sig,sigStr.rawData(),33); - result=result.left(128-32)+sigStr; + result=result.left(128-32)+sigStr; } } if (createSubdirs) { int l1Dir=0,l2Dir=0; -#if MAP_ALGO==ALGO_COUNT +#if MAP_ALGO==ALGO_COUNT // old algorithm, has the problem that after regeneration the // output can be located in a different dir. - if (Doxygen::htmlDirMap==0) + if (Doxygen::htmlDirMap==0) { Doxygen::htmlDirMap=new QDict(100003); Doxygen::htmlDirMap->setAutoDelete(TRUE); @@ -5082,7 +5084,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore) int *dirNum = Doxygen::htmlDirMap->find(result); if (dirNum==0) // new name { - Doxygen::htmlDirMap->insert(result,new int(curDirNum)); + Doxygen::htmlDirMap->insert(result,new int(curDirNum)); l1Dir = (curDirNum)&0xf; // bits 0-3 l2Dir = (curDirNum>>4)&0xff; // bits 4-11 curDirNum++; @@ -5166,7 +5168,7 @@ void extractNamespaceName(const QCString &scopeName, goto done; } p=clName.length()-2; - while (p>=0 && (i=clName.findRev("::",p))!=-1) + while (p>=0 && (i=clName.findRev("::",p))!=-1) // see if the first part is a namespace (and not a class) { //printf("Trying %s\n",clName.left(i).data()); @@ -5176,7 +5178,7 @@ void extractNamespaceName(const QCString &scopeName, namespaceName=nd->name().copy(); className=clName.right(clName.length()-i-2); goto done; - } + } p=i-2; // try a smaller piece of the scope } //printf("not found!\n"); @@ -5213,12 +5215,12 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te ((cd=getClass(scope.left(si)))==0 || cd->templateArguments().empty()) ) { - //printf("Tried '%s'\n",(scope.left(si)+templ).data()); - pi=si+2; + //printf("Tried '%s'\n",(scope.left(si)+templ).data()); + pi=si+2; } if (si==-1) // not nested => append template specifier { - result+=templ; + result+=templ; } else // nested => insert template specifier before after first class name { @@ -5247,7 +5249,7 @@ QCString stripScope(const char *name) char c=result.at(p); switch (c) { - case ':': + case ':': //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); return result.right(l-p-1); case '>': @@ -5262,7 +5264,7 @@ QCString stripScope(const char *name) { case '>': count++; break; case '<': count--; if (count<=0) done=TRUE; break; - default: + default: //printf("c=%c count=%d\n",c,count); break; } @@ -5296,7 +5298,7 @@ QCString stripScope(const char *name) char c=result.at(p); switch (c) { - case ':': + case ':': // only exit in the case of :: //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); if (p>0 && result.at(p-1)==':') return result.right(l-p-1); @@ -5323,10 +5325,10 @@ QCString stripScope(const char *name) c=result.at(p--); switch (c) { - case '>': - count++; + case '>': + count++; break; - case '<': + case '<': if (p>0) { if (result.at(p-1) == '<') // skip << operator @@ -5335,10 +5337,10 @@ QCString stripScope(const char *name) break; } } - count--; + count--; foundMatch = count==0; break; - default: + default: //printf("c=%c count=%d\n",c,count); break; } @@ -5428,7 +5430,7 @@ QCString convertToXML(const char *s, bool keepEntities) growBuf.addStr("&"); } break; - case '\'': growBuf.addStr("'"); break; + case '\'': growBuf.addStr("'"); break; case '"': growBuf.addStr("""); break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: @@ -5538,10 +5540,10 @@ QCString convertToHtml(const char *s,bool keepEntities) } else { - growBuf.addStr("&"); + growBuf.addStr("&"); } break; - case '\'': growBuf.addStr("'"); break; + case '\'': growBuf.addStr("'"); break; case '"': growBuf.addStr("""); break; default: growBuf.addChar(c); break; } @@ -5783,11 +5785,11 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri int brCount=1; while (te') + if (type.at(te)=='>') { if (te') te++; else brCount--; } @@ -5795,7 +5797,7 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri } } name = type.mid(i,l); - if (te>ts) + if (te>ts) { templSpec = type.mid(ts,te-ts),tl+=te-ts; pos=i+l+tl; @@ -5925,23 +5927,23 @@ QCString substituteTemplateArgumentsInString( if (formArg.name==n && actIt!=actualArgs.end() && !actArg.type.isEmpty()) // base class is a template argument { // replace formal argument with the actual argument of the instance - if (!leftScopeMatch(actArg.type,n)) - // the scope guard is to prevent recursive lockup for - // template class C : public, - // where A::T would become A::T::T here, + if (!leftScopeMatch(actArg.type,n)) + // the scope guard is to prevent recursive lockup for + // template class C : public, + // where A::T would become A::T::T here, // since n==A and actArg->type==A::T // see bug595833 for an example { if (actArg.name.isEmpty()) { - result += actArg.type+" "; + result += actArg.type+" "; found=TRUE; } - else + else // for case where the actual arg is something like "unsigned int" // the "int" part is in actArg->name. { - result += actArg.type+" "+actArg.name+" "; + result += actArg.type+" "+actArg.name+" "; found=TRUE; } } @@ -5983,12 +5985,12 @@ QCString substituteTemplateArgumentsInString( } -/*! Strips template specifiers from scope \a fullName, except those - * that make up specialized classes. The switch \a parentOnly - * determines whether or not a template "at the end" of a scope - * should be considered, e.g. with \a parentOnly is \c TRUE, \c A::B will - * try to strip `` and not ``, while \a parentOnly is \c FALSE will - * strip both unless `A` or `B` are specialized template classes. +/*! Strips template specifiers from scope \a fullName, except those + * that make up specialized classes. The switch \a parentOnly + * determines whether or not a template "at the end" of a scope + * should be considered, e.g. with \a parentOnly is \c TRUE, \c A::B will + * try to strip `` and not ``, while \a parentOnly is \c FALSE will + * strip both unless `A` or `B` are specialized template classes. */ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, @@ -6007,11 +6009,11 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, while (e') + else if (c=='>') { count--; done = count==0; @@ -6019,7 +6021,7 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, } int si= fullName.find("::",e); - if (parentOnly && si==-1) break; + if (parentOnly && si==-1) break; // we only do the parent scope, so we stop here if needed result+=fullName.mid(p,i-p); @@ -6046,10 +6048,10 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, * Example1: \c A::B and \c B::C will result in \c A::B::C
      * Example2: \c A and \c B will be \c A::B
      * Example3: \c A::B and B will be \c A::B - * + * * @param leftScope the left hand part of the scope. * @param rightScope the right hand part of the scope. - * @returns the merged scope. + * @returns the merged scope. */ QCString mergeScopes(const QCString &leftScope,const QCString &rightScope) { @@ -6158,7 +6160,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle, else // new page { QCString baseName=name; - if (baseName.right(4)==".tex") + if (baseName.right(4)==".tex") baseName=baseName.left(baseName.length()-4); else if (baseName.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension) baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length()); @@ -6190,7 +6192,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle, { file=gd->getOutputFileBase(); } - else + else { file=pd->getOutputFileBase(); } @@ -6224,7 +6226,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle, //---------------------------------------------------------------------------- void addRefItem(const std::vector &sli, - const char *key, + const char *key, const char *prefix, const char *name,const char *title,const char *args,const Definition *scope) { //printf("addRefItem(sli=%d,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",(int)sli.size(),key,prefix,name,title,args); @@ -6374,9 +6376,9 @@ void filterLatexString(FTextStream &t,const char *str, } break; case '*': t << "$\\ast$"; break; - case '_': if (!insideTabbing) t << "\\+"; - t << "\\_"; - if (!insideTabbing) t << "\\+"; + case '_': if (!insideTabbing) t << "\\+"; + t << "\\_"; + if (!insideTabbing) t << "\\+"; break; case '{': t << "\\{"; break; case '}': t << "\\}"; break; @@ -6384,8 +6386,8 @@ void filterLatexString(FTextStream &t,const char *str, case '>': t << "$>$"; break; case '|': t << "$\\vert$"; break; case '~': t << "$\\sim$"; break; - case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem) - t << "\\mbox{[}"; + case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem) + t << "\\mbox{[}"; else t << "["; break; @@ -6393,12 +6395,12 @@ void filterLatexString(FTextStream &t,const char *str, if (Config_getBool(PDF_HYPERLINKS) || insideItem) t << "\\mbox{]}"; else - t << "]"; + t << "]"; break; case '-': t << "-\\/"; break; case '\\': t << "\\textbackslash{}"; - break; + break; case '"': t << "\\char`\\\"{}"; break; case '`': t << "\\`{}"; @@ -6408,9 +6410,9 @@ void filterLatexString(FTextStream &t,const char *str, case ' ': if (keepSpaces) { if (insideTabbing) t << "\\>"; else t << '~'; } else t << ' '; break; - default: + default: //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ') - if (!insideTabbing && + if (!insideTabbing && ((c>='A' && c<='Z' && pc!=' ' && pc!='\0' && *p) || (c==':' && pc!=':') || (pc=='.' && isId(c))) ) { @@ -6444,7 +6446,7 @@ QCString latexEscapeLabelName(const char *s) case '}': t << "\\rcurly{}"; break; case '~': t << "````~"; break; // to get it a bit better in index together with other special characters // NOTE: adding a case here, means adding it to while below as well! - default: + default: i=0; // collect as long string as possible, before handing it to docify tmp[i++]=c; @@ -6483,7 +6485,7 @@ QCString latexEscapeIndexChars(const char *s) case '{': t << "\\lcurly{}"; break; case '}': t << "\\rcurly{}"; break; // NOTE: adding a case here, means adding it to while below as well! - default: + default: i=0; // collect as long string as possible, before handing it to docify tmp[i++]=c; @@ -6667,9 +6669,9 @@ bool findAndRemoveWord(QCString &s,const QCString &word) int p=0,i,l; while ((i=wordExp.match(s,p,&l))!=-1) { - if (s.mid(i,l)==word) + if (s.mid(i,l)==word) { - if (i>0 && isspace((uchar)s.at(i-1))) + if (i>0 && isspace((uchar)s.at(i-1))) i--,l++; else if (i+l<(int)s.length() && isspace((uchar)s.at(i+l))) l++; @@ -6753,7 +6755,7 @@ static struct Lang2ExtMap const char *langName; const char *parserName; SrcLangExt parserId; -} +} g_lang2extMap[] = { // language parser parser option @@ -6909,7 +6911,7 @@ QCString getFileNameExtension(QCString fn) //-------------------------------------------------------------------------- -MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope, +MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope, const char *n) { if (scope==0 || @@ -7122,8 +7124,8 @@ struct Marker int size; // size of the marker }; -/** For a string \a s that starts with a command name, returns the character - * offset within that string representing the first character after the +/** For a string \a s that starts with a command name, returns the character + * offset within that string representing the first character after the * command. For an alias with argument, this is the offset to the * character just after the argument list. * @@ -7150,8 +7152,8 @@ static int findEndOfCommand(const char *s) return i; } -/** Replaces the markers in an alias definition \a aliasValue - * with the corresponding values found in the comma separated argument +/** Replaces the markers in an alias definition \a aliasValue + * with the corresponding values found in the comma separated argument * list \a argList and the returns the result after recursive alias expansion. */ static QCString replaceAliasArguments(const QCString &aliasValue,const QCString &argList) @@ -7166,7 +7168,7 @@ static QCString replaceAliasArguments(const QCString &aliasValue,const QCString for (i=0;i1 && aliasText==0) - { // in case there is no command with numArgs parameters, but there is a command with 1 parameter, + if (numArgs>1 && aliasText==0) + { // in case there is no command with numArgs parameters, but there is a command with 1 parameter, // we also accept all text as the argument of that command (so you don't have to escape commas) aliasText=Doxygen::aliasDict.find(cmdNoArgs+"{1}"); if (aliasText) @@ -7341,7 +7343,7 @@ int countAliasArguments(const QCString argList) int count=1; int l = argList.length(); int i; - for (i=0;i'%s'\n",args.data(),args.mid(pos+1,i-pos-1).data()); return args.mid(pos+1,i-pos-1); @@ -7411,7 +7413,7 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue) void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al) { if (al.empty()) return; - ol.startConstraintList(theTranslator->trTypeConstraints()); + ol.startConstraintList(theTranslator->trTypeConstraints()); for (const Argument &a : al) { ol.startConstraintParam(); @@ -7437,7 +7439,7 @@ void stackTrace() static char cmd[40960]; char *p = cmd; p += sprintf(p,"/usr/bin/atos -p %d ", (int)getpid()); - for (int x = 0; x < frameCount; x++) + for (int x = 0; x < frameCount; x++) { p += sprintf(p,"%p ", backtraceFrames[x]); } @@ -7470,7 +7472,7 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size if (inputEncoding==0 || outputEncoding==0) return size; if (qstricmp(inputEncoding,outputEncoding)==0) return size; void *cd = portable_iconv_open(outputEncoding,inputEncoding); - if (cd==(void *)(-1)) + if (cd==(void *)(-1)) { term("unsupported character conversion: '%s'->'%s': %s\n" "Check the INPUT_ENCODING setting in the config file!\n", @@ -7723,7 +7725,7 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href) return result; } -/** Writes the intensity only bitmap represented by \a data as an image to +/** Writes the intensity only bitmap represented by \a data as an image to * directory \a dir using the colors defined by HTML_COLORSTYLE_*. */ void writeColoredImgData(const char *dir,ColoredImgDataItem data[]) @@ -7752,8 +7754,8 @@ void writeColoredImgData(const char *dir,ColoredImgDataItem data[]) } /** Replaces any markers of the form \#\#AA in input string \a str - * by new markers of the form \#AABBCC, where \#AABBCC represents a - * valid color, based on the intensity represented by hex number AA + * by new markers of the form \#AABBCC, where \#AABBCC represents a + * valid color, based on the intensity represented by hex number AA * and the current HTML_COLORSTYLE_* settings. */ QCString replaceColorMarkers(const char *str) @@ -7774,7 +7776,7 @@ QCString replaceColorMarkers(const char *str) #define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \ ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \ ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0) - + double r,g,b; int red,green,blue; int level = HEXTONUM(lumStr[0])*16+HEXTONUM(lumStr[1]); @@ -7800,7 +7802,7 @@ QCString replaceColorMarkers(const char *str) return result; } -/** Copies the contents of file with name \a src to the newly created +/** Copies the contents of file with name \a src to the newly created * file with name \a dest. Returns TRUE if successful. */ bool copyFile(const QCString &src,const QCString &dest) @@ -7832,7 +7834,7 @@ bool copyFile(const QCString &src,const QCString &dest) return TRUE; } -/** Returns the section of text, in between a pair of markers. +/** Returns the section of text, in between a pair of markers. * Full lines are returned, excluding the lines on which the markers appear. * \sa routine lineBlock */ @@ -7952,7 +7954,7 @@ QCString replaceScopeSeparator(QCString str) bool isURL(const QCString &url) { QCString loc_url = url.stripWhiteSpace(); - return loc_url.left(5)=="http:" || loc_url.left(6)=="https:" || + return loc_url.left(5)=="http:" || loc_url.left(6)=="https:" || loc_url.left(4)=="ftp:" || loc_url.left(5)=="file:"; } /** Corrects URL \a url according to the relative path \a relPath. @@ -7975,8 +7977,8 @@ bool protectionLevelVisible(Protection prot) static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); static bool extractPackage = Config_getBool(EXTRACT_PACKAGE); - return (prot!=Private && prot!=Package) || - (prot==Private && extractPrivate) || + return (prot!=Private && prot!=Package) || + (prot==Private && extractPrivate) || (prot==Package && extractPackage); } @@ -7999,7 +8001,7 @@ QCString stripIndentation(const QCString &s) if (c=='\t') indent+=tabSize - (indent%tabSize); else if (c=='\n') indent=0,searchIndent=TRUE; else if (c==' ') indent++; - else if (searchIndent) + else if (searchIndent) { searchIndent=FALSE; if (indentgenerateSourceFile(); return ( ((allExternals && fd->isLinkable()) || fd->isLinkableInProject() - ) && + ) && !isDocFile ); } @@ -8065,7 +8067,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst) { //printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data()); if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types - if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) && + if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) && src->showInCallGraph() ) { @@ -8081,7 +8083,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst) mdDecl->addSourceReferencedBy(src); } } - if ((src->hasReferencesRelation() || src->hasCallGraph()) && + if ((src->hasReferencesRelation() || src->hasCallGraph()) && src->showInCallGraph() ) { @@ -8137,7 +8139,7 @@ uint getUtf8Code( const QCString& s, int idx ) } -/*! @brief Returns one unicode character as an unsigned integer +/*! @brief Returns one unicode character as an unsigned integer * from utf-8 string, making the character lower case if it was upper case. * * @param s utf-8 encoded string @@ -8152,7 +8154,7 @@ uint getUtf8CodeToLower( const QCString& s, int idx ) } -/*! @brief Returns one unicode character as an unsigned integer +/*! @brief Returns one unicode character as an unsigned integer * from utf-8 string, making the character upper case if it was lower case. * * @param s utf-8 encoded string @@ -8473,7 +8475,7 @@ bool openOutputFile(const char *outFile,QFile &f) if (backup.exists()) // remove existing backup dir.remove(backup.fileName()); dir.rename(fi.fileName(),fi.fileName()+".bak"); - } + } f.setName(outFile); fileOpened = f.open(IO_WriteOnly|IO_Translate); } @@ -8484,7 +8486,7 @@ void writeExtraLatexPackages(FTextStream &t) { // User-specified packages QStrList &extraPackages = Config_getList(EXTRA_PACKAGES); - if (!extraPackages.isEmpty()) + if (!extraPackages.isEmpty()) { t << "% Packages requested by user\n"; const char *pkgName=extraPackages.first(); @@ -8558,5 +8560,3 @@ int usedTableLevels() } //------------------------------------------------------ - - diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 8e11601..3528627 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1957,7 +1957,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, QCString ltype(mdef->typeString()); QCString largs(mdef->argsString()); - + ClassDef *kl=0; const ArgumentList &al = mdef->argumentList(); QCString nn; @@ -2136,7 +2136,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, case VhdlDocGen::UNITS: writeRecordUnit(largs,ltype,ol,mdef); break; - + default: break; } @@ -2814,20 +2814,20 @@ ferr: void VhdlDocGen::writeRecordUnit(QCString & largs,QCString & ltype,OutputList& ol ,const MemberDef *mdef) { - int i=mdef->name().find('~'); + int i=mdef->name().find('~'); if(i>0){ //sets the real record member name const_cast(mdef)->setName(mdef->name().left(i).data()); } - + writeLink(mdef,ol); ol.startBold(); ol.insertMemberAlign(); if (!ltype.isEmpty()){ VhdlDocGen::formatString(ltype,ol,mdef); - } + } ol.endBold(); - + } @@ -3933,7 +3933,7 @@ int FlowChart::findLabel(int index,QCString &label) return j; } } - err("could not find label: ",label.data()); + err("could not find label: %s",label.data()); return 0; } @@ -4148,5 +4148,3 @@ void FlowChart::writeFlowLinks(FTextStream &t) } } //for } //writeFlowLinks - - -- cgit v0.12