From 99f948c038b763028fcb95ef2a65fdbc1d5f9520 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 13 Sep 2018 18:01:21 +0200 Subject: Fixing coverity messages Note: especially latexdocvisitor (dead code that should not be dead code). --- src/clangparser.cpp | 1 + src/context.cpp | 12 ++++++++---- src/definition.cpp | 1 + src/docparser.h | 2 +- src/htmlgen.cpp | 1 + src/latexdocvisitor.cpp | 2 +- src/layout.cpp | 2 +- src/layout.h | 3 ++- src/perlmodgen.cpp | 2 +- src/pyscanner.l | 1 - src/tagreader.cpp | 4 ++-- src/tclscanner.l | 1 - 12 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/clangparser.cpp b/src/clangparser.cpp index 78b8faa..18dd404 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -964,6 +964,7 @@ void ClangParser::writeSources(CodeOutputInterface &,FileDef *) ClangParser::ClangParser() { + p = NULL; } ClangParser::~ClangParser() diff --git a/src/context.cpp b/src/context.cpp index c9a6bb3..33e7dcf 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -6978,7 +6978,8 @@ class NamespaceTreeContext::Private SharedPtr m_namespaceTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7352,7 +7353,8 @@ class PageTreeContext::Private SharedPtr m_pageTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7604,7 +7606,8 @@ class ModuleTreeContext::Private SharedPtr m_moduleTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7807,7 +7810,8 @@ class ExampleTreeContext::Private SharedPtr m_exampleTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; diff --git a/src/definition.cpp b/src/definition.cpp index cbfad94..9a4bd08 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -304,6 +304,7 @@ Definition::Definition(const Definition &d) : DefinitionIntf(), m_cookie(0) { m_name = d.m_name; m_defLine = d.m_defLine; + m_defColumn = d.m_defColumn; m_impl = new DefinitionImpl; *m_impl = *d.m_impl; m_impl->sectionDict = 0; diff --git a/src/docparser.h b/src/docparser.h index 6b75426..25602cf 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1370,7 +1370,7 @@ class DocHtmlTable : public CompAccept { public: DocHtmlTable(DocNode *parent,const HtmlAttribList &attribs) - : m_attribs(attribs) { m_caption=0; m_parent = parent; } + : m_attribs(attribs) { m_caption=0; m_numCols=0; m_parent = parent; } ~DocHtmlTable() { delete m_caption; } Kind kind() const { return Kind_HtmlTable; } uint numRows() const { return m_children.count(); } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index ee23fb8..8819078 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -690,6 +690,7 @@ HtmlGenerator::HtmlGenerator() : OutputGenerator() { dir=Config_getString(HTML_OUTPUT); m_emptySection=FALSE; + m_sectionCount=0; } HtmlGenerator::~HtmlGenerator() diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index c35ef11..452a481 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1177,8 +1177,8 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) m_t << "r|}{"; break; case DocHtmlCell::Center: - break; m_t << "c|}{"; + break; default: m_t << "l|}{"; break; diff --git a/src/layout.cpp b/src/layout.cpp index 1d9a5ed..a3849b5 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -1268,7 +1268,7 @@ class LayoutParser : public QXmlDefaultHandler } private: - LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE) { } + LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE), m_part(0), m_rootNav(NULL) { } ~LayoutParser() { delete m_rootNav; } QDict m_sHandler; diff --git a/src/layout.h b/src/layout.h index 0b9ad9e..1906a3d 100644 --- a/src/layout.h +++ b/src/layout.h @@ -119,6 +119,7 @@ struct LayoutNavEntry { public: enum Kind { + None = -1, MainPage, Pages, Modules, @@ -158,7 +159,7 @@ struct LayoutNavEntry LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const; private: - LayoutNavEntry() : m_parent(0) {} + LayoutNavEntry() : m_parent(0), m_kind(None), m_visible(FALSE) {} LayoutNavEntry *m_parent; Kind m_kind; bool m_visible; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index f805383..5b4b6ea 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -428,7 +428,7 @@ private: }; PerlModDocVisitor::PerlModDocVisitor(PerlModOutput &output) - : DocVisitor(DocVisitor_Other), m_output(output), m_textmode(false) + : DocVisitor(DocVisitor_Other), m_output(output), m_textmode(false), m_textblockstart(FALSE) { m_output.openList("doc"); } diff --git a/src/pyscanner.l b/src/pyscanner.l index 7b5a424..19dc1ad 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1401,7 +1401,6 @@ STARTDOCSYMS "##" BEGIN(Search); } <> { yyterminate(); - newEntry(); } } diff --git a/src/tagreader.cpp b/src/tagreader.cpp index cf64a35..82e4712 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -95,8 +95,8 @@ class TagMemberInfo class TagClassInfo { public: - enum Kind { Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton }; - TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; } + enum Kind { None=-1, Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton }; + TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; kind = None; } ~TagClassInfo() { delete bases; delete templateArguments; } QCString name; QCString filename; diff --git a/src/tclscanner.l b/src/tclscanner.l index 7ca5ade..ca5294b 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -1431,7 +1431,6 @@ tcl_inf("(%d) ?%s?\n",what,tcl.string_last.data()); yyless(0); tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.data()); return; - myWhite=0; break; default: tcl_err("wrong state: %d\n",what); -- cgit v0.12