summaryrefslogtreecommitdiffstats
path: root/src/memberdef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-03-24 11:51:51 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-03-24 11:51:51 (GMT)
commitdeaa34e0c1d990f37fe00e465ac7a22f705904f0 (patch)
tree8d5749ba8d587d7b753162c524b18f7e7cdf6a0b /src/memberdef.cpp
parentaacd1557af129e2bff3514169e04168376a2431b (diff)
downloadDoxygen-deaa34e0c1d990f37fe00e465ac7a22f705904f0.zip
Doxygen-deaa34e0c1d990f37fe00e465ac7a22f705904f0.tar.gz
Doxygen-deaa34e0c1d990f37fe00e465ac7a22f705904f0.tar.bz2
Release-1.8.3.1-20130324
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r--src/memberdef.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 0c89554..e01ab6a 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -48,10 +48,6 @@
#define START_MARKER 0x4D454D5B // MEM[
#define END_MARKER 0x4D454D5D // MEM]
-#if defined(_OS_WIN32_)
-#define snprintf _snprintf
-#endif
-
// Put this macro at the start of any method of MemberDef that can directly
// or indirectly access other MemberDefs. It prevents that the content
// pointed to by m_impl gets flushed to disk in the middle of the method call!
@@ -540,7 +536,7 @@ class MemberDefImpl
ClassDef *category;
MemberDef *categoryRelation;
- bool tagDataWritten;
+ unsigned tagDataWritten;
};
MemberDefImpl::MemberDefImpl() :
@@ -670,7 +666,7 @@ void MemberDefImpl::init(Definition *def,
hasDocumentedReturnType = FALSE;
docProvider = 0;
isDMember = def->getDefFileName().right(2).lower()==".d";
- tagDataWritten = FALSE;
+ tagDataWritten = 0; // save separate written status for file, group, class, etc.
}
@@ -1382,8 +1378,8 @@ bool MemberDef::isBriefSectionVisible() const
void MemberDef::writeDeclaration(OutputList &ol,
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
- bool inGroup,ClassDef *inheritedFrom,const char *inheritId
- )
+ bool inGroup, const DefType compoundType,
+ ClassDef *inheritedFrom,const char *inheritId)
{
//printf("%s MemberDef::writeDeclaration() inGroup=%d\n",qualifiedName().data(),inGroup);
@@ -1399,7 +1395,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
ASSERT (cd!=0 || nd!=0 || fd!=0 || gd!=0); // member should belong to something
if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd;
- _writeTagData();
+ _writeTagData(compoundType);
QCString cname = d->name();
QCString cdname = d->displayName();
@@ -1513,7 +1509,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
ltype.left(i), // text
TRUE // autoBreak
);
- getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd);
+ getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,compoundType);
//ol+=*getAnonymousEnumType()->enumDecl();
linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,this,ltype.right(ltype.length()-i-l),TRUE);
}
@@ -2436,7 +2432,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline);
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i));
- vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef());
+ vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),definitionType());
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l));
found=TRUE;
@@ -3146,7 +3142,7 @@ void MemberDef::setAnchor()
if (m_impl->tArgList)
{
char buf[20];
- snprintf(buf,20,"%d:",m_impl->tArgList->count());
+ qsnprintf(buf,20,"%d:",m_impl->tArgList->count());
buf[19]='\0';
memAnchor.prepend(buf);
}
@@ -3390,9 +3386,10 @@ Specifier MemberDef::virtualness(int count) const
return v;
}
-void MemberDef::_writeTagData()
-{
- if (m_impl->tagDataWritten) return;
+void MemberDef::_writeTagData(const DefType compoundType)
+{
+ unsigned typeMask = 1 << compoundType;
+ if ((m_impl->tagDataWritten) & typeMask) return; // member already written for this type
static bool generateTagFile = !Config_getString("GENERATE_TAGFILE").isEmpty();
// write tag file information of this member
if (generateTagFile && isLinkableInProject())
@@ -3457,12 +3454,13 @@ void MemberDef::_writeTagData()
Doxygen::tagFile << " <anchor>" << convertToXML(fmd->anchor()) << "</anchor>" << endl;
Doxygen::tagFile << " <arglist>" << convertToXML(fmd->argsString()) << "</arglist>" << endl;
Doxygen::tagFile << " </member>" << endl;
+ fmd->m_impl->tagDataWritten |= typeMask;
fmd->_addToSearchIndex();
}
}
}
}
- m_impl->tagDataWritten=TRUE;
+ m_impl->tagDataWritten |= typeMask;
}
void MemberDef::_computeIsConstructor()
@@ -3563,7 +3561,8 @@ bool MemberDef::isDestructor() const
}
void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
- ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd)
+ ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
+ const DefType compoundType)
{
KEEP_RESIDENT_DURING_CALL;
@@ -3592,7 +3591,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
{
if (isLinkableInProject() || hasDocumentedEnumValues())
{
- _writeTagData();
+ _writeTagData(compoundType);
writeLink(typeDecl,cd,nd,fd,gd);
}
else
@@ -3639,7 +3638,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
if (fmd->hasDocumentation()) // enum value has docs
{
- fmd->_writeTagData();
+ fmd->_writeTagData(compoundType);
fmd->writeLink(typeDecl,cd,nd,fd,gd);
}
else // no docs for this enum value
@@ -4833,7 +4832,7 @@ void MemberDef::flushToDisk() const
marshalBool (Doxygen::symbolStorage,m_impl->docsForDefinition);
marshalObjPointer (Doxygen::symbolStorage,m_impl->category);
marshalObjPointer (Doxygen::symbolStorage,m_impl->categoryRelation);
- marshalBool (Doxygen::symbolStorage,m_impl->tagDataWritten);
+ marshalUInt (Doxygen::symbolStorage,m_impl->tagDataWritten);
marshalUInt(Doxygen::symbolStorage,END_MARKER);
// function doesn't modify the object conceptually but compiler doesn't know this.
@@ -4938,7 +4937,7 @@ void MemberDef::loadFromDisk() const
m_impl->docsForDefinition = unmarshalBool (Doxygen::symbolStorage);
m_impl->category = (ClassDef*)unmarshalObjPointer (Doxygen::symbolStorage);
m_impl->categoryRelation = (MemberDef*)unmarshalObjPointer (Doxygen::symbolStorage);
- m_impl->tagDataWritten = unmarshalBool (Doxygen::symbolStorage);
+ m_impl->tagDataWritten = unmarshalUInt (Doxygen::symbolStorage);
marker = unmarshalUInt(Doxygen::symbolStorage);
assert(marker==END_MARKER);