summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classdef.cpp43
-rw-r--r--src/code.l1
-rw-r--r--src/context.cpp2
-rw-r--r--src/definition.cpp7
-rw-r--r--src/diagram.cpp2
-rw-r--r--src/doxygen.cpp317
-rw-r--r--src/groupdef.cpp11
-rw-r--r--src/template.cpp5
-rw-r--r--src/util.cpp6
-rw-r--r--src/vhdlcode.l2
10 files changed, 215 insertions, 181 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 6ddc3f9..88bc44c 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -3969,28 +3969,31 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
Doxygen::classLinkedMap->add(tcname,
std::unique_ptr<ClassDef>(
new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
- templateClass->setTemplateMaster(this);
- templateClass->setOuterScope(getOuterScope());
- templateClass->setHidden(isHidden());
- templateClass->setArtificial(isArtificial());
- m_impl->templateInstances->insert(templSpec,templateClass);
-
- // also add nested classes
- for (const auto &innerCd : m_impl->innerClasses)
+ if (templateClass)
{
- QCString innerName = tcname+"::"+innerCd->localName();
- ClassDefMutable *innerClass =
- toClassDefMutable(
- Doxygen::classLinkedMap->add(innerName,
- std::unique_ptr<ClassDef>(
- new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
- if (innerClass)
+ templateClass->setTemplateMaster(this);
+ templateClass->setOuterScope(getOuterScope());
+ templateClass->setHidden(isHidden());
+ templateClass->setArtificial(isArtificial());
+ m_impl->templateInstances->insert(templSpec,templateClass);
+
+ // also add nested classes
+ for (const auto &innerCd : m_impl->innerClasses)
{
- templateClass->addInnerCompound(innerClass);
- innerClass->setOuterScope(templateClass);
- innerClass->setHidden(isHidden());
- innerClass->setArtificial(TRUE);
- freshInstance=TRUE;
+ QCString innerName = tcname+"::"+innerCd->localName();
+ ClassDefMutable *innerClass =
+ toClassDefMutable(
+ Doxygen::classLinkedMap->add(innerName,
+ std::unique_ptr<ClassDef>(
+ new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
+ if (innerClass)
+ {
+ templateClass->addInnerCompound(innerClass);
+ innerClass->setOuterScope(templateClass);
+ innerClass->setHidden(isHidden());
+ innerClass->setArtificial(TRUE);
+ freshInstance=TRUE;
+ }
}
}
}
diff --git a/src/code.l b/src/code.l
index a2dd6e2..6feda35 100644
--- a/src/code.l
+++ b/src/code.l
@@ -537,7 +537,6 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
<SkipCPP>"//"/[^/!] {
REJECT;
- yyextra->code->codify(yytext);
}
<Body,FuncCall>"{" {
yyextra->theVarContext.pushScope();
diff --git a/src/context.cpp b/src/context.cpp
index 95fb82d..7f3a33e 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -4062,7 +4062,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
s_inst.addProperty("nameWithContextFor", &Private::nameWithContextFor);
init=TRUE;
}
- if (!md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
+ if (md && !md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
Cachable &cache = getCache();
cache.propertyAttrs.reset(TemplateList::alloc());
diff --git a/src/definition.cpp b/src/definition.cpp
index 71980d5..2a03ef9 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -291,11 +291,8 @@ DefinitionImpl::~DefinitionImpl()
{
removeFromMap(m_impl->symbolName,m_impl->def);
}
- if (m_impl)
- {
- delete m_impl;
- m_impl=0;
- }
+ delete m_impl;
+ m_impl=0;
}
void DefinitionImpl::setName(const char *name)
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 64ea491..80c85c6 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -1054,7 +1054,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
p->base.computeExtremes(&baseMaxLabelWidth,&baseMaxX);
p->super.computeExtremes(&superMaxLabelWidth,&superMaxX);
- uint rows=baseRows+superRows-1;
+ uint rows=QMAX(1,baseRows+superRows-1);
uint cols=(QMAX(baseMaxX,superMaxX)+gridWidth*2-1)/gridWidth;
// Estimate the image aspect width and height in pixels.
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 547c79e..dded2e7 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -775,11 +775,13 @@ static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt l
"[generated]",1,1,fullScope,
tagInfo?tagInfo->tagName:QCString(),
tagInfo?tagInfo->fileName:QCString()))));
- newNd->setLanguage(lang);
- newNd->setArtificial(TRUE);
-
- // add namespace to the list
- innerScope = newNd;
+ if (newNd)
+ {
+ newNd->setLanguage(lang);
+ newNd->setArtificial(TRUE);
+ // add namespace to the list
+ innerScope = newNd;
+ }
}
else // scope is a namespace
{
@@ -1129,27 +1131,30 @@ static void addClassToContext(const Entry *root)
}
}
- cd->addSectionsToDefinition(root->anchors);
- if (!root->subGrouping) cd->setSubGrouping(FALSE);
- if ((root->spec&Entry::ForwardDecl)==0)
+ if (cd)
{
- if (cd->hasDocumentation())
- {
- addIncludeFile(cd,fd,root);
- }
- if (fd && (root->section & Entry::COMPOUND_MASK))
+ cd->addSectionsToDefinition(root->anchors);
+ if (!root->subGrouping) cd->setSubGrouping(FALSE);
+ if ((root->spec&Entry::ForwardDecl)==0)
{
- //printf(">> Inserting class '%s' in file '%s' (root->fileName='%s')\n",
- // cd->name().data(),
- // fd->name().data(),
- // root->fileName.data()
- // );
- cd->setFileDef(fd);
- fd->insertClass(cd);
+ if (cd->hasDocumentation())
+ {
+ addIncludeFile(cd,fd,root);
+ }
+ if (fd && (root->section & Entry::COMPOUND_MASK))
+ {
+ //printf(">> Inserting class '%s' in file '%s' (root->fileName='%s')\n",
+ // cd->name().data(),
+ // fd->name().data(),
+ // root->fileName.data()
+ // );
+ cd->setFileDef(fd);
+ fd->insertClass(cd);
+ }
}
+ addClassToGroups(root,cd);
+ cd->setRefItems(root->sli);
}
- addClassToGroups(root,cd);
- cd->setRefItems(root->sli);
}
//----------------------------------------------------------------------
@@ -1589,81 +1594,88 @@ static void buildNamespaceList(const Entry *root)
Doxygen::namespaceLinkedMap->add(fullName,
std::unique_ptr<NamespaceDef>(
createNamespaceDef(tagInfo?tagName:root->fileName,root->startLine,
- root->startColumn,fullName,tagName,tagFileName,
- root->type,root->spec&Entry::Published))));
- nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
- nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- nd->addSectionsToDefinition(root->anchors);
- nd->setHidden(root->hidden);
- nd->setArtificial(root->artificial);
- nd->setLanguage(root->lang);
- nd->setId(root->id);
- nd->setMetaData(root->metaData);
- nd->setInline((root->spec&Entry::Inline)!=0);
-
- //printf("Adding namespace to group\n");
- addNamespaceToGroups(root,nd);
- nd->setRefItems(root->sli);
-
- // file definition containing the namespace nd
- FileDef *fd=root->fileDef();
- // insert the namespace in the file definition
- if (fd) fd->insertNamespace(nd);
-
- // the empty string test is needed for extract all case
- nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- nd->insertUsedFile(fd);
- nd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
- nd->setBodyDef(fd);
-
- // also add namespace to the correct structural context
- Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName,0,tagInfo);
- //printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"<none>");
- if (d==0) // we didn't find anything, create the scope artificially
- // anyway, so we can at least relate scopes properly.
- {
- d = buildScopeFromQualifiedName(fullName,nd->getLanguage(),tagInfo);
- DefinitionMutable *dm = toDefinitionMutable(d);
- if (dm)
- {
- dm->addInnerCompound(nd);
- }
- nd->setOuterScope(d);
- // TODO: Due to the order in which the tag file is written
- // a nested class can be found before its parent!
- }
- else
+ root->startColumn,fullName,tagName,tagFileName,
+ root->type,root->spec&Entry::Published))));
+ if (nd)
{
- DefinitionMutable *dm = toDefinitionMutable(d);
- if (dm)
+ nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
+ nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ nd->addSectionsToDefinition(root->anchors);
+ nd->setHidden(root->hidden);
+ nd->setArtificial(root->artificial);
+ nd->setLanguage(root->lang);
+ nd->setId(root->id);
+ nd->setMetaData(root->metaData);
+ nd->setInline((root->spec&Entry::Inline)!=0);
+
+ //printf("Adding namespace to group\n");
+ addNamespaceToGroups(root,nd);
+ nd->setRefItems(root->sli);
+
+ // file definition containing the namespace nd
+ FileDef *fd=root->fileDef();
+ // insert the namespace in the file definition
+ if (fd) fd->insertNamespace(nd);
+
+ // the empty string test is needed for extract all case
+ nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ nd->insertUsedFile(fd);
+ nd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
+ nd->setBodyDef(fd);
+
+ // also add namespace to the correct structural context
+ Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName,0,tagInfo);
+ //printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"<none>");
+ if (d==0) // we didn't find anything, create the scope artificially
+ // anyway, so we can at least relate scopes properly.
{
- dm->addInnerCompound(nd);
+ d = buildScopeFromQualifiedName(fullName,nd->getLanguage(),tagInfo);
+ DefinitionMutable *dm = toDefinitionMutable(d);
+ if (dm)
+ {
+ dm->addInnerCompound(nd);
+ }
+ nd->setOuterScope(d);
+ // TODO: Due to the order in which the tag file is written
+ // a nested class can be found before its parent!
}
- nd->setOuterScope(d);
- // in case of d is an inline namespace, alias insert nd in the part scope of d.
- while (d->definitionType()==Definition::TypeNamespace)
+ else
{
- NamespaceDef *pnd = toNamespaceDef(d);
- if (pnd && pnd->isInline())
+ DefinitionMutable *dm = toDefinitionMutable(d);
+ if (dm)
{
- d = d->getOuterScope();
- if (d)
+ dm->addInnerCompound(nd);
+ }
+ nd->setOuterScope(d);
+ // in case of d is an inline namespace, alias insert nd in the part scope of d.
+ while (d->definitionType()==Definition::TypeNamespace)
+ {
+ NamespaceDef *pnd = toNamespaceDef(d);
+ if (pnd && pnd->isInline())
{
- dm = toDefinitionMutable(d);
- if (dm)
+ d = d->getOuterScope();
+ if (d)
+ {
+ dm = toDefinitionMutable(d);
+ if (dm)
+ {
+ NamespaceDef *aliasNd = createNamespaceDefAlias(d,nd);
+ dm->addInnerCompound(aliasNd);
+ QCString aliasName = aliasNd->name();
+ //printf("adding alias %s (%p) to %s\n",qPrint(aliasName),aliasNd,qPrint(d->name()));
+ Doxygen::namespaceLinkedMap->add(
+ aliasName,std::unique_ptr<NamespaceDef>(aliasNd));
+ }
+ }
+ else
{
- NamespaceDef *aliasNd = createNamespaceDefAlias(d,nd);
- dm->addInnerCompound(aliasNd);
- QCString aliasName = aliasNd->name();
- //printf("adding alias %s (%p) to %s\n",qPrint(aliasName),aliasNd,qPrint(d->name()));
- Doxygen::namespaceLinkedMap->add(
- aliasName,std::unique_ptr<NamespaceDef>(aliasNd));
+ break;
}
}
- }
- else
- {
- break;
+ else
+ {
+ break;
+ }
}
}
}
@@ -3989,13 +4001,13 @@ static void findUsedClassesForClass(const Entry *root,
{
if (arg.name==usedName) // type is a template argument
{
- found=TRUE;
Debug::print(Debug::Classes,0," New used class '%s'\n", qPrint(usedName));
- ClassDefMutable *usedCd = toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(usedName));
+ ClassDef *usedCd = Doxygen::hiddenClassLinkedMap->find(usedName);
+ ClassDefMutable *usedCdm = toClassDefMutable(usedCd);
if (usedCd==0)
{
- usedCd = toClassDefMutable(
+ usedCdm = toClassDefMutable(
Doxygen::hiddenClassLinkedMap->add(usedName,
std::unique_ptr<ClassDef>(
createClassDef(
@@ -4003,24 +4015,32 @@ static void findUsedClassesForClass(const Entry *root,
masterCd->getDefColumn(),
usedName,
ClassDef::Class))));
- if (usedCd)
+ if (usedCdm)
{
//printf("making %s a template argument!!!\n",usedCd->name().data());
- usedCd->makeTemplateArgument();
- usedCd->setUsedOnly(TRUE);
- usedCd->setLanguage(masterCd->getLanguage());
+ usedCdm->makeTemplateArgument();
+ usedCdm->setUsedOnly(TRUE);
+ usedCdm->setLanguage(masterCd->getLanguage());
+ usedCd = usedCdm;
+ }
+ }
+ if (usedCd)
+ {
+ found=TRUE;
+ Debug::print(Debug::Classes,0," Adding used class '%s' (1)\n", qPrint(usedCd->name()));
+ instanceCd->addUsedClass(usedCd,md->name(),md->protection());
+ if (usedCdm)
+ {
+ if (isArtificial) usedCdm->setArtificial(TRUE);
+ usedCdm->addUsedByClass(instanceCd,md->name(),md->protection());
}
}
- if (isArtificial) usedCd->setArtificial(TRUE);
- Debug::print(Debug::Classes,0," Adding used class '%s' (1)\n", qPrint(usedCd->name()));
- instanceCd->addUsedClass(usedCd,md->name(),md->protection());
- usedCd->addUsedByClass(instanceCd,md->name(),md->protection());
}
}
if (!found)
{
- ClassDefMutable *usedCd=toClassDefMutable(findClassWithinClassContext(context,masterCd,usedName));
+ ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName);
//printf("Looking for used class %s: result=%s master=%s\n",
// usedName.data(),usedCd?usedCd->name().data():"<none>",masterCd?masterCd->name().data():"<none>");
@@ -4029,7 +4049,11 @@ static void findUsedClassesForClass(const Entry *root,
found=TRUE;
Debug::print(Debug::Classes,0," Adding used class '%s' (2)\n", qPrint(usedCd->name()));
instanceCd->addUsedClass(usedCd,md->name(),md->protection()); // class exists
- usedCd->addUsedByClass(instanceCd,md->name(),md->protection());
+ ClassDefMutable *usedCdm = toClassDefMutable(usedCd);
+ if (usedCdm)
+ {
+ usedCdm->addUsedByClass(instanceCd,md->name(),md->protection());
+ }
}
}
if (delTempNames)
@@ -4040,7 +4064,8 @@ static void findUsedClassesForClass(const Entry *root,
}
if (!found && !type.isEmpty()) // used class is not documented in any scope
{
- ClassDefMutable *usedCd = toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(type));
+ ClassDef *usedCd = Doxygen::hiddenClassLinkedMap->find(type);
+ ClassDefMutable *usedCdm = toClassDefMutable(usedCd);
if (usedCd==0 && !Config_getBool(HIDE_UNDOC_RELATIONS))
{
if (type.right(2)=="(*" || type.right(2)=="(^") // type is a function pointer
@@ -4048,25 +4073,29 @@ static void findUsedClassesForClass(const Entry *root,
type+=md->argsString();
}
Debug::print(Debug::Classes,0," New undocumented used class '%s'\n", qPrint(type));
- usedCd = toClassDefMutable(
+ usedCdm = toClassDefMutable(
Doxygen::hiddenClassLinkedMap->add(type,
std::unique_ptr<ClassDef>(
createClassDef(
masterCd->getDefFileName(),masterCd->getDefLine(),
masterCd->getDefColumn(),
type,ClassDef::Class))));
- if (usedCd)
+ if (usedCdm)
{
- usedCd->setUsedOnly(TRUE);
- usedCd->setLanguage(masterCd->getLanguage());
+ usedCdm->setUsedOnly(TRUE);
+ usedCdm->setLanguage(masterCd->getLanguage());
+ usedCd = usedCdm;
}
}
if (usedCd)
{
- if (isArtificial) usedCd->setArtificial(TRUE);
Debug::print(Debug::Classes,0," Adding used class '%s' (3)\n", qPrint(usedCd->name()));
instanceCd->addUsedClass(usedCd,md->name(),md->protection());
- usedCd->addUsedByClass(instanceCd,md->name(),md->protection());
+ if (usedCdm)
+ {
+ if (isArtificial) usedCdm->setArtificial(TRUE);
+ usedCdm->addUsedByClass(instanceCd,md->name(),md->protection());
+ }
}
}
}
@@ -4130,7 +4159,7 @@ static void findBaseClassesForClass(
//----------------------------------------------------------------------
-static bool findTemplateInstanceRelation(const Entry *root,
+static void findTemplateInstanceRelation(const Entry *root,
Definition *context,
ClassDefMutable *templateClass,const QCString &templSpec,
QDict<int> *templateNames,
@@ -4154,47 +4183,49 @@ static bool findTemplateInstanceRelation(const Entry *root,
bool existingClass = (templSpec ==
tempArgListToString(templateClass->templateArguments(),root->lang,false)
);
- if (existingClass) return TRUE;
+ if (existingClass) return;
bool freshInstance=FALSE;
ClassDefMutable *instanceClass = toClassDefMutable(
templateClass->insertTemplateInstance(
root->fileName,root->startLine,root->startColumn,templSpec,freshInstance));
- if (isArtificial)
- {
- instanceClass->setArtificial(TRUE);
- }
- instanceClass->setLanguage(root->lang);
-
- if (freshInstance)
+ if (instanceClass)
{
- Debug::print(Debug::Classes,0," found fresh instance '%s'!\n",qPrint(instanceClass->name()));
- instanceClass->setTemplateBaseClassNames(templateNames);
+ if (isArtificial)
+ {
+ instanceClass->setArtificial(TRUE);
+ }
+ instanceClass->setLanguage(root->lang);
- // search for new template instances caused by base classes of
- // instanceClass
- auto it_pair = g_classEntries.equal_range(templateClass->name().data());
- for (auto it=it_pair.first ; it!=it_pair.second ; ++it)
+ if (freshInstance)
{
- const Entry *templateRoot = it->second;
- Debug::print(Debug::Classes,0," template root found %s templSpec=%s!\n",
- qPrint(templateRoot->name),qPrint(templSpec));
- std::unique_ptr<ArgumentList> templArgs = stringToArgumentList(root->lang,templSpec);
- findBaseClassesForClass(templateRoot,context,templateClass,instanceClass,
- TemplateInstances,isArtificial,templArgs,templateNames);
+ Debug::print(Debug::Classes,0," found fresh instance '%s'!\n",qPrint(instanceClass->name()));
+ instanceClass->setTemplateBaseClassNames(templateNames);
- findUsedClassesForClass(templateRoot,context,templateClass,instanceClass,
- isArtificial,templArgs,templateNames);
- }
+ // search for new template instances caused by base classes of
+ // instanceClass
+ auto it_pair = g_classEntries.equal_range(templateClass->name().data());
+ for (auto it=it_pair.first ; it!=it_pair.second ; ++it)
+ {
+ const Entry *templateRoot = it->second;
+ Debug::print(Debug::Classes,0," template root found %s templSpec=%s!\n",
+ qPrint(templateRoot->name),qPrint(templSpec));
+ std::unique_ptr<ArgumentList> templArgs = stringToArgumentList(root->lang,templSpec);
+ findBaseClassesForClass(templateRoot,context,templateClass,instanceClass,
+ TemplateInstances,isArtificial,templArgs,templateNames);
- //Debug::print(Debug::Classes,0," Template instance %s : \n",instanceClass->name().data());
- //ArgumentList *tl = templateClass->templateArguments();
- }
- else
- {
- Debug::print(Debug::Classes,0," instance already exists!\n");
+ findUsedClassesForClass(templateRoot,context,templateClass,instanceClass,
+ isArtificial,templArgs,templateNames);
+ }
+
+ //Debug::print(Debug::Classes,0," Template instance %s : \n",instanceClass->name().data());
+ //ArgumentList *tl = templateClass->templateArguments();
+ }
+ else
+ {
+ Debug::print(Debug::Classes,0," instance already exists!\n");
+ }
}
- return TRUE;
}
static bool isRecursiveBaseClass(const QCString &scope,const QCString &name)
@@ -4578,7 +4609,7 @@ static bool findClassRelation(
baseClass = toClassDefMutable(Doxygen::classLinkedMap->find(baseClassName));
//printf("*** classDDict->find(%s)=%p biName=%s templSpec=%s\n",
// baseClassName.data(),baseClass,biName.data(),templSpec.data());
- if (baseClass==0)
+ if (baseClass==0) // not found (or alias)
{
baseClass = toClassDefMutable(
Doxygen::classLinkedMap->add(baseClassName,
@@ -4586,7 +4617,7 @@ static bool findClassRelation(
createClassDef(root->fileName,root->startLine,root->startColumn,
baseClassName,
ClassDef::Class))));
- if (baseClass)
+ if (baseClass) // really added (not alias)
{
if (isArtificial) baseClass->setArtificial(TRUE);
baseClass->setLanguage(root->lang);
@@ -4999,6 +5030,7 @@ static void addMemberDocs(const Entry *root,
uint64 spec
)
{
+ if (md==0) return;
//printf("addMemberDocs: '%s'::'%s' '%s' funcDecl='%s' mSpec=%lld\n",
// root->parent()->name.data(),md->name().data(),md->argsString(),funcDecl,spec);
QCString fDecl=funcDecl;
@@ -5580,6 +5612,7 @@ static void addMemberFunction(const Entry *root,
MemberDefMutable *md = toMemberDefMutable(imd.get());
if (md==0) continue;
ClassDefMutable *cd=md->getClassDefMutable();
+ if (cd==0) continue;
Debug::print(Debug::FindMembers,0,
"3. member definition found, "
"scope needed='%s' scope='%s' args='%s' fileName=%s\n",
@@ -7374,7 +7407,7 @@ static void findEnumDocumentation(const Entry *root)
const ClassDef *mcd = md->getClassDef();
const NamespaceDef *mnd = md->getNamespaceDef();
const FileDef *mfd = md->getFileDef();
- if (mcd==cd)
+ if (cd && mcd==cd)
{
Debug::print(Debug::FindMembers,0,"2. Match found for class scope\n");
addEnumDocs(root,md);
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index cd3cc01..d8526d9 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -1485,11 +1485,11 @@ void addMemberToGroups(const Entry *root,MemberDef *md)
{
//printf("insertMember successful\n");
mdm->setGroupDef(fgd,pri,root->fileName,root->startLine,!root->doc.isEmpty());
- }
- ClassDefMutable *cdm = toClassDefMutable(mdm->getClassDefOfAnonymousType());
- if (cdm)
- {
- cdm->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);
+ ClassDefMutable *cdm = toClassDefMutable(mdm->getClassDefOfAnonymousType());
+ if (cdm)
+ {
+ cdm->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);
+ }
}
}
}
@@ -1584,7 +1584,6 @@ static void groupClassesWithSameScope(Vec &vec)
idx = k;
k++;
}
- idx = std::distance(vec.begin(),it);
// swap the items such that i is inserted after idx
for (size_t j=i; j<idx; j++)
{
diff --git a/src/template.cpp b/src/template.cpp
index 58188fe..d5e8275 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -2669,7 +2669,10 @@ void TemplateContextImpl::addIndexEntry(const QCString &indexName,const std::vec
if (list->count()>0)
{
TemplateStruct *lastEntry = dynamic_cast<TemplateStruct*>(list->at(list->count()-1).toStruct());
- lastEntry->set("last",false);
+ if (lastEntry)
+ {
+ lastEntry->set("last",false);
+ }
}
entry->set("is_leaf_node",true);
entry->set("first",list->count()==0);
diff --git a/src/util.cpp b/src/util.cpp
index 0c6d8fd..7fcd5ed 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -3553,10 +3553,10 @@ bool hasVisibleRoot(const BaseClassList &bcl)
for (const auto &bcd : bcl)
{
const ClassDef *cd=bcd.classDef;
- if (cd->isVisibleInHierarchy()) return TRUE;
- hasVisibleRoot(cd->baseClasses());
+ if (cd->isVisibleInHierarchy()) return true;
+ if (hasVisibleRoot(cd->baseClasses())) return true;
}
- return FALSE;
+ return false;
}
//----------------------------------------------------------------------
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index 1139d29..0f52356 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -1268,7 +1268,7 @@ static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,MemberDe
//printf("generateFuncLink(FuncName=%s)\n",mdef->name().data());
QCString memberName=mdef->name();
- if (mdef && mdef->isLinkable()) // is it a linkable class
+ if (mdef->isLinkable()) // is it a linkable class
{
writeMultiLineCodeLink(yyscanner,ol,mdef,mdef->name());
addToSearchIndex(yyscanner,memberName);