From 8c81723ca5c1f383ce6849b70ff6f464c7128ee9 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 22 Jan 2021 22:46:02 +0100 Subject: Fix size_t related compiler errors & warnings for win64 --- src/docbookvisitor.cpp | 2 +- src/docparser.cpp | 42 +++++++++++++++++++++--------------------- src/dotdirdeps.cpp | 2 +- src/latexdocvisitor.cpp | 4 ++-- src/rtfdocvisitor.cpp | 2 +- src/vhdldocgen.cpp | 40 +++++++++++++++++++--------------------- src/vhdldocgen.h | 15 +++++++-------- src/xmldocvisitor.cpp | 4 ++-- 8 files changed, 54 insertions(+), 57 deletions(-) diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index e4eb299..a448ac5 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -1007,7 +1007,7 @@ DB_VIS_C m_bodySet.push(false); if (m_hide) return; m_t << "" << endl; - m_t << " numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl; + m_t << " numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl; for (uint i = 0; i numColumns(); i++) { // do something with colwidth based of cell width specification (be aware of possible colspan in the header)? diff --git a/src/docparser.cpp b/src/docparser.cpp index b0815b1..65ccff7 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -908,7 +908,7 @@ static void handleStyleEnter(DocNode *parent,DocNodeList &children, DocStyleChange::Style s,const QCString &tagName,const HtmlAttribList *attribs) { DBG(("HandleStyleEnter\n")); - DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.size(),s,tagName,TRUE,attribs); + DocStyleChange *sc= new DocStyleChange(parent,(uint)g_nodeStack.size(),s,tagName,TRUE,attribs); children.push_back(std::unique_ptr(sc)); g_styleStack.push(sc); } @@ -952,7 +952,7 @@ static void handleStyleLeave(DocNode *parent,DocNodeList &children, { children.push_back( std::make_unique( - parent,g_nodeStack.size(),s,g_styleStack.top()->tagName(),FALSE)); + parent,(uint)g_nodeStack.size(),s,g_styleStack.top()->tagName(),FALSE)); g_styleStack.pop(); } } @@ -968,7 +968,7 @@ static void handlePendingStyleCommands(DocNode *parent,DocNodeList &children) const DocStyleChange *sc = g_styleStack.top(); while (sc && sc->position()>=g_nodeStack.size()) { // there are unclosed style modifiers in the paragraph - children.push_back(std::make_unique(parent,g_nodeStack.size(),sc->style(),sc->tagName(),FALSE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),sc->style(),sc->tagName(),FALSE)); g_initialStyleStack.push(sc); g_styleStack.pop(); sc = g_styleStack.top(); @@ -1396,9 +1396,9 @@ reparsetoken: break; case CMD_EMPHASIS: { - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Italic,tokenName,TRUE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Italic,tokenName,TRUE)); tok=handleStyleArgument(parent,children,tokenName); - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Italic,tokenName,FALSE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Italic,tokenName,FALSE)); if (tok!=TK_WORD) children.push_back(std::make_unique(parent," ")); if (tok==TK_NEWPARA) goto handlepara; else if (tok==TK_WORD || tok==TK_HTMLTAG) @@ -1410,9 +1410,9 @@ reparsetoken: break; case CMD_BOLD: { - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Bold,tokenName,TRUE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Bold,tokenName,TRUE)); tok=handleStyleArgument(parent,children,tokenName); - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Bold,tokenName,FALSE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Bold,tokenName,FALSE)); if (tok!=TK_WORD) children.push_back(std::make_unique(parent," ")); if (tok==TK_NEWPARA) goto handlepara; else if (tok==TK_WORD || tok==TK_HTMLTAG) @@ -1424,9 +1424,9 @@ reparsetoken: break; case CMD_CODE: { - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Code,tokenName,TRUE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Code,tokenName,TRUE)); tok=handleStyleArgument(parent,children,tokenName); - children.push_back(std::make_unique(parent,g_nodeStack.size(),DocStyleChange::Code,tokenName,FALSE)); + children.push_back(std::make_unique(parent,(uint)g_nodeStack.size(),DocStyleChange::Code,tokenName,FALSE)); if (tok!=TK_WORD) children.push_back(std::make_unique(parent," ")); if (tok==TK_NEWPARA) goto handlepara; else if (tok==TK_WORD || tok==TK_HTMLTAG) @@ -5279,21 +5279,21 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unknown command '%c%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName)); break; case CMD_EMPHASIS: - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE)); if (retval!=TK_WORD) m_children.push_back(std::make_unique(this," ")); break; case CMD_BOLD: - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE)); if (retval!=TK_WORD) m_children.push_back(std::make_unique(this," ")); break; case CMD_CODE: - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Code,cmdName,TRUE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Code,cmdName,TRUE)); retval=handleStyleArgument(this,m_children,cmdName); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Code,cmdName,FALSE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Code,cmdName,FALSE)); if (retval!=TK_WORD) m_children.push_back(std::make_unique(this," ")); break; case CMD_BSLASH: @@ -6026,9 +6026,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta if (findAttribute(tagHtmlAttribs,"name",¶mName)) { //printf("paramName=%s\n",paramName.data()); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Italic,tagName,TRUE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,tagName,TRUE)); m_children.push_back(std::make_unique(this,paramName)); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Italic,tagName,FALSE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,tagName,FALSE)); if (retval!=TK_WORD) m_children.push_back(std::make_unique(this," ")); } else @@ -6073,7 +6073,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta g_hasReturnCommand=TRUE; break; case XML_TERM: - //m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Bold,TRUE)); + //m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,TRUE)); if (insideTable(this)) { retval=RetVal_TableCell; @@ -6118,9 +6118,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta bool inSeeBlock = g_inSeeBlock; g_token->name = cref; g_inSeeBlock = TRUE; - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Code,tagName,TRUE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Code,tagName,TRUE)); handleLinkedWord(this,m_children,TRUE); - m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Code,tagName,FALSE)); + m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Code,tagName,FALSE)); g_inSeeBlock = inSeeBlock; } else @@ -6362,7 +6362,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) break; case XML_TERM: - //m_children.push_back(std::make_unique(this,g_nodeStack.size(),DocStyleChange::Bold,FALSE)); + //m_children.push_back(std::make_unique(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,FALSE)); break; case XML_SUMMARY: case XML_REMARKS: diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp index 4b8f1c3..a4e556e 100644 --- a/src/dotdirdeps.cpp +++ b/src/dotdirdeps.cpp @@ -169,7 +169,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) size_t nrefs = udir->filePairs().size(); t << " " << dir->getOutputFileBase() << "->" << usedDir->getOutputFileBase(); - t << " [headlabel=\"" << nrefs << "\", labeldistance=1.5"; + t << " [headlabel=\"" << (uint)nrefs << "\", labeldistance=1.5"; if (linkRelations) { t << " headhref=\"" << relationName << Doxygen::htmlFileExtension << "\""; diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index f2f9e41..019030d 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1083,7 +1083,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) m_t << endl; } - writeStartTableCommand(m_t,t->parent(),t->numColumns()); + writeStartTableCommand(m_t,t->parent(),(uint)t->numColumns()); if (t->hasCaption()) { @@ -1095,7 +1095,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) m_t << "\\\\\n"; } - setNumCols(t->numColumns()); + setNumCols((uint)t->numColumns()); m_t << "\\hline\n"; // check if first row is a heading and then render the row already here diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 1f7c609..797e3a2 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1013,7 +1013,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n"); - uint i,columnWidth=r->numCells()>0 ? rtf_pageWidth/r->numCells() : 10; + uint i,columnWidth=(uint)r->numCells()>0 ? rtf_pageWidth/(uint)r->numCells() : 10; m_t << "\\trowd \\trgaph108\\trleft-108" "\\trbrdrt\\brdrs\\brdrw10 " "\\trbrdrl\\brdrs\\brdrw10 " diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index c736ce3..ce1224f 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -3175,7 +3175,7 @@ void FlowChart::buildCommentNodes(FTextStream & t) FlowChart &fll=flowList[j]; if (fll.type & (COMMENT_NO | BEGIN_NO)) { - int diff=FLOWLEN-(j+1); + size_t diff=FLOWLEN-(j+1); if ((fll.type & COMMENT_NO) && diff > 1) { @@ -3674,7 +3674,7 @@ void FlowChart::alignFuncProc( QCString & q,const ArgumentList &al,bool isFunc) q+=temp; } -int FlowChart::findNextLoop(int index,int stamp) +size_t FlowChart::findNextLoop(size_t index,int stamp) { for (size_t j=index+1; j0;j--) { @@ -3714,7 +3714,7 @@ int FlowChart::findPrevLoop(int index,int stamp,bool endif) return flowList.size()-1; } -int FlowChart::findLabel(int index,const QCString &label) +size_t FlowChart::findLabel(size_t index,const QCString &label) { for (size_t j=index;j>0;j--) { @@ -3728,7 +3728,7 @@ int FlowChart::findLabel(int index,const QCString &label) return 0; } -int FlowChart::findNode(int index,int stamp,int type) +size_t FlowChart::findNode(size_t index,int stamp,int type) { for (size_t j=index+1; j-1); + size_t start = index+1; + size_t endifNode = findNode(start,stamp,ENDIF_NO); + size_t elseifNode = findNode(start,stamp,ELSIF_NO); + size_t elseNode = findNode(start,stamp,ELSE_NO); if (elseifNode>0 && elseifNode-1); writeEdge(t,fll,flowList[z],1); } @@ -3849,7 +3847,7 @@ void FlowChart::writeFlowLinks(FTextStream &t) } kind=END_LOOP; - int z=findNode(j+1,fll.stamp,kind); + size_t z=findNode(j+1,fll.stamp,kind); z=getNextNode(z,flowList[z].stamp); // assert(z>-1); @@ -3858,7 +3856,7 @@ void FlowChart::writeFlowLinks(FTextStream &t) } else if (kind & (TEXT_NO | VARIABLE_NO)) { - int z=getNextNode(j,stamp); + size_t z=getNextNode(j,stamp); writeEdge(t,fll,flowList[z],2); } else if (kind & WHEN_NO) @@ -3872,8 +3870,8 @@ void FlowChart::writeFlowLinks(FTextStream &t) writeEdge(t,fll,flowList[j+1],0); - int u=findNode(j,stamp,WHEN_NO); - int v=findNode(j,stamp-1,END_CASE); + size_t u=findNode(j,stamp,WHEN_NO); + size_t v=findNode(j,stamp-1,END_CASE); if (u>0 && unumRows() - << "\" cols=\"" << t->numColumns() << "\"" ; + m_t << "numRows() + << "\" cols=\"" << (uint)t->numColumns() << "\"" ; for (const auto &opt : t->attribs()) { if (opt.name=="width") -- cgit v0.12