From 774ea08686e6fddd13dd905bee0b81c8833975da Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 5 Feb 2021 20:08:17 +0100 Subject: Fixed a couple of issues found by running Coverity --- src/context.cpp | 6 +++--- src/docparser.cpp | 3 ++- src/dotgroupcollaboration.cpp | 1 + src/vhdldocgen.cpp | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/context.cpp b/src/context.cpp index 572e0d3..d2cfa9e 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -4046,11 +4046,11 @@ class MemberContext::Private : public DefinitionContext s_inst.addProperty("nameWithContextFor", &Private::nameWithContextFor); init=TRUE; } - if (md && !md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); } + if (!md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); } Cachable &cache = getCache(); cache.propertyAttrs.reset(TemplateList::alloc()); - if (md && md->isProperty()) + if (md->isProperty()) { if (md->isGettable()) cache.propertyAttrs->append("get"); if (md->isPrivateGettable()) cache.propertyAttrs->append("private get"); @@ -4060,7 +4060,7 @@ class MemberContext::Private : public DefinitionContext if (md->isProtectedSettable()) cache.propertyAttrs->append("protected set"); } cache.eventAttrs.reset(TemplateList::alloc()); - if (md && md->isEvent()) + if (md->isEvent()) { if (md->isAddable()) cache.eventAttrs->append("add"); if (md->isRemovable()) cache.eventAttrs->append("remove"); diff --git a/src/docparser.cpp b/src/docparser.cpp index a179904..5e68c52 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -829,6 +829,7 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok, { case TK_COMMAND_AT: cmd_start = "@"; + // fall through case TK_COMMAND_BS: children.push_back(std::make_unique(parent,TK_COMMAND_CHAR(tok) + g_token->name)); warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Illegal command %s as part of a %s", @@ -1519,7 +1520,7 @@ reparsetoken: { QCString scope; doctokenizerYYsetStateSetScope(); - doctokenizerYYlex(); + (void)doctokenizerYYlex(); scope = g_token->name; g_context = scope; //printf("Found scope='%s'\n",scope.data()); diff --git a/src/dotgroupcollaboration.cpp b/src/dotgroupcollaboration.cpp index 3a14577..1dc1380 100644 --- a/src/dotgroupcollaboration.cpp +++ b/src/dotgroupcollaboration.cpp @@ -288,6 +288,7 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const { if (first) first=FALSE; else t << "\\n"; t << DotNode::convertLabel(link.label); + count++; } if (count==maxLabels) t << "\\n..."; t << "\""; diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index ce1224f..299ae26 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -3046,8 +3046,9 @@ void FlowChart::colTextNodes() const FlowChart &ftemp = flowList[j+1]; if (ftemp.type & EMPTY) { - flowList.insert(flowList.begin()+j+1,FlowChart(TEXT_NO,"empty ",0)); - flowList[j+1].stamp = flo.stamp; + FlowChart fc(TEXT_NO,"empty ",0); + fc.stamp = flo.stamp; + flowList.insert(flowList.begin()+j+1,fc); } } } -- cgit v0.12