Skip to content

Commit 774ea08

Browse files
committed
Fixed a couple of issues found by running Coverity
1 parent 0e61eb4 commit 774ea08

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/context.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -4046,11 +4046,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
40464046
s_inst.addProperty("nameWithContextFor", &Private::nameWithContextFor);
40474047
init=TRUE;
40484048
}
4049-
if (md && !md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
4049+
if (!md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
40504050

40514051
Cachable &cache = getCache();
40524052
cache.propertyAttrs.reset(TemplateList::alloc());
4053-
if (md && md->isProperty())
4053+
if (md->isProperty())
40544054
{
40554055
if (md->isGettable()) cache.propertyAttrs->append("get");
40564056
if (md->isPrivateGettable()) cache.propertyAttrs->append("private get");
@@ -4060,7 +4060,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
40604060
if (md->isProtectedSettable()) cache.propertyAttrs->append("protected set");
40614061
}
40624062
cache.eventAttrs.reset(TemplateList::alloc());
4063-
if (md && md->isEvent())
4063+
if (md->isEvent())
40644064
{
40654065
if (md->isAddable()) cache.eventAttrs->append("add");
40664066
if (md->isRemovable()) cache.eventAttrs->append("remove");

src/docparser.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok,
829829
{
830830
case TK_COMMAND_AT:
831831
cmd_start = "@";
832+
// fall through
832833
case TK_COMMAND_BS:
833834
children.push_back(std::make_unique<DocWord>(parent,TK_COMMAND_CHAR(tok) + g_token->name));
834835
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Illegal command %s as part of a %s",
@@ -1519,7 +1520,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, DocNodeList &children,bo
15191520
{
15201521
QCString scope;
15211522
doctokenizerYYsetStateSetScope();
1522-
doctokenizerYYlex();
1523+
(void)doctokenizerYYlex();
15231524
scope = g_token->name;
15241525
g_context = scope;
15251526
//printf("Found scope='%s'\n",scope.data());

src/dotgroupcollaboration.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const
288288
{
289289
if (first) first=FALSE; else t << "\\n";
290290
t << DotNode::convertLabel(link.label);
291+
count++;
291292
}
292293
if (count==maxLabels) t << "\\n...";
293294
t << "\"";

src/vhdldocgen.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3046,8 +3046,9 @@ void FlowChart::colTextNodes()
30463046
const FlowChart &ftemp = flowList[j+1];
30473047
if (ftemp.type & EMPTY)
30483048
{
3049-
flowList.insert(flowList.begin()+j+1,FlowChart(TEXT_NO,"empty ",0));
3050-
flowList[j+1].stamp = flo.stamp;
3049+
FlowChart fc(TEXT_NO,"empty ",0);
3050+
fc.stamp = flo.stamp;
3051+
flowList.insert(flowList.begin()+j+1,fc);
30513052
}
30523053
}
30533054
}

0 commit comments

Comments
 (0)