diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-05 14:23:52 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-05 14:23:52 (GMT) |
commit | a216d135700190d0b064c872d5c78a286c3682c4 (patch) | |
tree | ac2df5c5192d4c347458fc529d606ef72da4f6c5 /src | |
parent | c637dede9ec30c2e35f19636edc0b3fd424b45e5 (diff) | |
download | Doxygen-a216d135700190d0b064c872d5c78a286c3682c4.zip Doxygen-a216d135700190d0b064c872d5c78a286c3682c4.tar.gz Doxygen-a216d135700190d0b064c872d5c78a286c3682c4.tar.bz2 |
Add const correctness for argument lists
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 4 | ||||
-rw-r--r-- | src/code.l | 4 | ||||
-rw-r--r-- | src/context.cpp | 14 | ||||
-rw-r--r-- | src/defgen.cpp | 2 | ||||
-rw-r--r-- | src/docparser.cpp | 12 | ||||
-rw-r--r-- | src/doxygen.cpp | 35 | ||||
-rw-r--r-- | src/groupdef.cpp | 12 | ||||
-rw-r--r-- | src/memberdef.cpp | 66 | ||||
-rw-r--r-- | src/memberdef.h | 13 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 12 | ||||
-rw-r--r-- | src/sqlite3gen.cpp | 14 | ||||
-rw-r--r-- | src/util.cpp | 18 | ||||
-rw-r--r-- | src/util.h | 6 | ||||
-rw-r--r-- | src/vhdlcode.l | 4 | ||||
-rw-r--r-- | src/vhdldocgen.cpp | 2 | ||||
-rw-r--r-- | src/xmlgen.cpp | 16 |
16 files changed, 124 insertions, 110 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index c6d1bca..19c8fac 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -3697,8 +3697,8 @@ void ClassDefImpl::mergeMembers() if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE)) // member is in the same or a base class { - ArgumentList *srcAl = srcMd->argumentList(); - ArgumentList *dstAl = dstMd->argumentList(); + const ArgumentList *srcAl = srcMd->argumentList(); + const ArgumentList *dstAl = dstMd->argumentList(); found=matchArguments2( srcMd->getOuterScope(),srcMd->getFileDef(),srcAl, dstMd->getOuterScope(),dstMd->getFileDef(),dstAl, @@ -677,10 +677,10 @@ static void addUsingDirective(const char *name) static void setParameterList(const MemberDef *md) { g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : ""; - ArgumentList *al = md->argumentList(); + const ArgumentList *al = md->argumentList(); if (al==0) return; ArgumentListIterator it(*al); - Argument *a; + const Argument *a; for (;(a=it.current());++it) { g_parmName = a->name.copy(); diff --git a/src/context.cpp b/src/context.cpp index 6ecf142..26a5b0e 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -4638,7 +4638,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> return createLinkedText(m_memberDef,relPathAsString(), m_memberDef->displayDefinition()); } - ArgumentList *getDefArgList() const + const ArgumentList *getDefArgList() const { return (m_memberDef->isDocsForDefinition()) ? m_memberDef->argumentList() : m_memberDef->declArgumentList(); @@ -4648,7 +4648,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> Cachable &cache = getCache(); if (!cache.arguments) { - ArgumentList *defArgList = getDefArgList(); + const ArgumentList *defArgList = getDefArgList(); if (defArgList && !m_memberDef->isProperty()) { cache.arguments.reset(ArgumentListContext::alloc(defArgList,m_memberDef,relPathAsString())); @@ -4666,27 +4666,27 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } TemplateVariant hasConstQualifier() const { - ArgumentList *al = getDefArgList(); + const ArgumentList *al = getDefArgList(); return al ? al->constSpecifier : FALSE; } TemplateVariant hasVolatileQualifier() const { - ArgumentList *al = getDefArgList(); + const ArgumentList *al = getDefArgList(); return al ? al->volatileSpecifier : FALSE; } TemplateVariant hasRefQualifierLValue() const { - ArgumentList *al = getDefArgList(); + const ArgumentList *al = getDefArgList(); return al ? al->refQualifier==RefQualifierLValue : FALSE; } TemplateVariant hasRefQualifierRValue() const { - ArgumentList *al = getDefArgList(); + const ArgumentList *al = getDefArgList(); return al ? al->refQualifier==RefQualifierRValue : FALSE; } TemplateVariant trailingReturnType() const { - ArgumentList *al = getDefArgList(); + const ArgumentList *al = getDefArgList(); if (al && !al->trailingReturnType.isEmpty()) { return createLinkedText(m_memberDef,relPathAsString(), diff --git a/src/defgen.cpp b/src/defgen.cpp index de11057..6601f6e 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -144,7 +144,7 @@ void generateDEFForMember(MemberDef *md, if (isFunc) //function { ArgumentList *declAl = new ArgumentList; - ArgumentList *defAl = md->argumentList(); + const ArgumentList *defAl = md->argumentList(); stringToArgumentList(md->argsString(),declAl); QCString fcnPrefix = " " + memPrefix + "param-"; diff --git a/src/docparser.cpp b/src/docparser.cpp index b265093..ab5bd7d 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -406,9 +406,9 @@ static void checkArgumentName(const QCString &name,bool isParam) { if (!Config_getBool(WARN_IF_DOC_ERROR)) return; if (g_memberDef==0) return; // not a member - ArgumentList *al=g_memberDef->isDocsForDefinition() ? - g_memberDef->argumentList() : - g_memberDef->declArgumentList(); + const ArgumentList *al=g_memberDef->isDocsForDefinition() ? + g_memberDef->argumentList() : + g_memberDef->declArgumentList(); SrcLangExt lang = g_memberDef->getLanguage(); //printf("isDocsForDefinition()=%d\n",g_memberDef->isDocsForDefinition()); if (al==0) return; // no argument list @@ -421,7 +421,7 @@ static void checkArgumentName(const QCString &name,bool isParam) if (lang==SrcLangExt_Fortran) aName=aName.lower(); //printf("aName=`%s'\n",aName.data()); ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; bool found=FALSE; for (ali.toFirst();(a=ali.current());++ali) { @@ -476,14 +476,14 @@ static void checkUnOrMultipleDocumentedParams() { if (g_memberDef && g_hasParamCommand && Config_getBool(WARN_IF_DOC_ERROR)) { - ArgumentList *al=g_memberDef->isDocsForDefinition() ? + const ArgumentList *al=g_memberDef->isDocsForDefinition() ? g_memberDef->argumentList() : g_memberDef->declArgumentList(); SrcLangExt lang = g_memberDef->getLanguage(); if (al!=0) { ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; bool found=FALSE; for (ali.toFirst();(a=ali.current());++ali) { diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 347cd2a..4fcd157 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2150,8 +2150,8 @@ static void findUsingDeclImports(Entry *root) { fileName = root->tagInfo->tagName; } - ArgumentList *templAl = md->templateArguments(); - ArgumentList *al = md->templateArguments(); + const ArgumentList *templAl = md->templateArguments(); + const ArgumentList *al = md->templateArguments(); newMd = createMemberDef( fileName,root->startLine,root->startColumn, md->typeString(),memName,md->argsString(), @@ -3607,7 +3607,7 @@ static void buildFunctionList(Entry *root) //printf("matching arguments for %s%s %s%s\n", // md->name().data(),md->argsString(),rname.data(),argListToString(root->argList).data()); ArgumentList *mdAl = md->argumentList(); - ArgumentList *mdTempl = md->templateArguments(); + const ArgumentList *mdTempl = md->templateArguments(); // in case of template functions, we need to check if the // functions have the same number of template parameters @@ -3927,17 +3927,18 @@ static void findFriends() //printf("Checking for matching arguments // mmd->isRelated()=%d mmd->isFriend()=%d mmd->isFunction()=%d\n", // mmd->isRelated(),mmd->isFriend(),mmd->isFunction()); - ArgumentList *mmdAl = cmmd->argumentList(); - ArgumentList *fmdAl = cfmd->argumentList(); if ((cmmd->isFriend() || (cmmd->isRelated() && cmmd->isFunction())) && - matchArguments2(cmmd->getOuterScope(), cmmd->getFileDef(), mmdAl, - cfmd->getOuterScope(), cfmd->getFileDef(), fmdAl, + !fmd->isAlias() && !mmd->isAlias() && + matchArguments2(cmmd->getOuterScope(), cmmd->getFileDef(), cmmd->argumentList(), + cfmd->getOuterScope(), cfmd->getFileDef(), cfmd->argumentList(), TRUE ) ) // if the member is related and the arguments match then the // function is actually a friend. { + ArgumentList *mmdAl = mmd->argumentList(); + ArgumentList *fmdAl = fmd->argumentList(); mergeArguments(mmdAl,fmdAl); if (!fmd->documentation().isEmpty()) { @@ -4018,7 +4019,10 @@ static void transferFunctionDocumentation() MemberNameIterator mni2(*mn); for (;(mdef=mni2.current());++mni2) { - combineDeclarationAndDefinition(mdec,mdef); + if (!mdec->isAlias() && !mdef->isAlias()) + { + combineDeclarationAndDefinition(mdec,mdef); + } } } } @@ -4141,12 +4145,11 @@ static void transferRelatedFunctionDocumentation() MemberNameIterator rmni(*rmn); for (rmni.toFirst();(rmd=rmni.current());++rmni) // for each member with the same name { - ArgumentList *mdAl = md->argumentList(); - ArgumentList *rmdAl = rmd->argumentList(); //printf(" Member found: related=`%d'\n",rmd->isRelated()); if ((rmd->isRelated() || rmd->isForeign()) && // related function - matchArguments2( md->getOuterScope(), md->getFileDef(), mdAl, - rmd->getOuterScope(),rmd->getFileDef(),rmdAl, + !md->isAlias() && !rmd->isAlias() && + matchArguments2( md->getOuterScope(), md->getFileDef(), md->argumentList(), + rmd->getOuterScope(),rmd->getFileDef(),rmd->argumentList(), TRUE ) ) @@ -5551,7 +5554,7 @@ static bool findGlobalMember(Entry *root, // different functions. if (matching && root->tArgLists) { - ArgumentList *mdTempl = md->templateArguments(); + const ArgumentList *mdTempl = md->templateArguments(); if (mdTempl) { if (root->tArgLists->getLast()->count()!=mdTempl->count()) @@ -6170,7 +6173,7 @@ static void findMember(Entry *root, // get the template parameter lists found at the member declaration QList<ArgumentList> declTemplArgs; cd->getTemplateParameterLists(declTemplArgs); - ArgumentList *templAl = md->templateArguments(); + const ArgumentList *templAl = md->templateArguments(); if (templAl) { declTemplArgs.append(templAl); @@ -6327,7 +6330,7 @@ static void findMember(Entry *root, //printf("ccd->name()==%s className=%s\n",ccd->name().data(),className.data()); if (ccd!=0 && rightScopeMatch(ccd->name(),className)) { - ArgumentList *templAl = md->templateArguments(); + const ArgumentList *templAl = md->templateArguments(); if (root->tArgLists && templAl!=0 && root->tArgLists->getLast()->count()<=templAl->count()) { @@ -6404,7 +6407,7 @@ static void findMember(Entry *root, const ClassDef *cd=md->getClassDef(); if (cd!=0 && rightScopeMatch(cd->name(),className)) { - ArgumentList *templAl = md->templateArguments(); + const ArgumentList *templAl = md->templateArguments(); if (templAl!=0) { warnMsg+=" 'template "; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index e151f5a..01c4cc4 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -384,10 +384,10 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) if ((mni=(*allMemberNameInfoSDict)[md->name()])) { // member with this name already found MemberNameInfoIterator srcMnii(*mni); - MemberInfo *srcMi; + const MemberInfo *srcMi; for ( ; (srcMi=srcMnii.current()) ; ++srcMnii ) { - MemberDef *srcMd = srcMi->memberDef; + const MemberDef *srcMd = srcMi->memberDef; if (srcMd==md) return FALSE; // already added before! bool sameScope = srcMd->getOuterScope()==md->getOuterScope() || // same class or namespace @@ -395,10 +395,10 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) (srcMd->getOuterScope()->definitionType()==Definition::TypeFile && md->getOuterScope()->definitionType()==Definition::TypeFile); - ArgumentList *srcMdAl = srcMd->argumentList(); - ArgumentList *mdAl = md->argumentList(); - ArgumentList *tSrcMdAl = srcMd->templateArguments(); - ArgumentList *tMdAl = md->templateArguments(); + const ArgumentList *srcMdAl = srcMd->argumentList(); + const ArgumentList *mdAl = md->argumentList(); + const ArgumentList *tSrcMdAl = srcMd->templateArguments(); + const ArgumentList *tMdAl = md->templateArguments(); if (srcMd->isFunction() && md->isFunction() && // both are a function ((tSrcMdAl==0 && tMdAl==0) || diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 273c96a..cd3cc46 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -200,10 +200,11 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual bool hasExamples() const; virtual ExampleSDict *getExamples() const; virtual bool isPrototype() const; - virtual ArgumentList *argumentList() const; - virtual ArgumentList *declArgumentList() const; - virtual ArgumentList *templateArguments() const; - virtual QList<ArgumentList> *definitionTemplateParameterLists() const; + virtual const ArgumentList *argumentList() const; + virtual ArgumentList *argumentList(); + virtual const ArgumentList *declArgumentList() const; + virtual const ArgumentList *templateArguments() const; + virtual const QList<ArgumentList> *definitionTemplateParameterLists() const; virtual int getMemberGroupId() const; virtual MemberGroup *getMemberGroup() const; virtual bool fromAnonymousScope() const; @@ -224,7 +225,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual MemberDef *memberDefinition() const; virtual MemberDef *memberDeclaration() const; virtual MemberDef *inheritsDocsFrom() const; - virtual MemberDef *getGroupAlias() const; + virtual const MemberDef *getGroupAlias() const; virtual ClassDef *category() const; virtual MemberDef *categoryRelation() const; virtual QCString displayName(bool=TRUE) const; @@ -292,7 +293,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setTemplateMaster(MemberDef *mt); virtual void addListReference(Definition *d); virtual void setDocsForDefinition(bool b); - virtual void setGroupAlias(MemberDef *md); + virtual void setGroupAlias(const MemberDef *md); virtual void cacheTypedefVal(ClassDef *val,const QCString &templSpec,const QCString &resolvedType); virtual void invalidateTypedefValCache(); virtual void invalidateCachedArgumentTypes(); @@ -655,13 +656,13 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef { return getMdAlias()->getExamples(); } virtual bool isPrototype() const { return getMdAlias()->isPrototype(); } - virtual ArgumentList *argumentList() const + virtual const ArgumentList *argumentList() const { return getMdAlias()->argumentList(); } - virtual ArgumentList *declArgumentList() const + virtual const ArgumentList *declArgumentList() const { return getMdAlias()->declArgumentList(); } - virtual ArgumentList *templateArguments() const + virtual const ArgumentList *templateArguments() const { return getMdAlias()->templateArguments(); } - virtual QList<ArgumentList> *definitionTemplateParameterLists() const + virtual const QList<ArgumentList> *definitionTemplateParameterLists() const { return getMdAlias()->definitionTemplateParameterLists(); } virtual int getMemberGroupId() const { return getMdAlias()->getMemberGroupId(); } @@ -703,7 +704,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef { return getMdAlias()->memberDeclaration(); } virtual MemberDef *inheritsDocsFrom() const { return getMdAlias()->inheritsDocsFrom(); } - virtual MemberDef *getGroupAlias() const + virtual const MemberDef *getGroupAlias() const { return getMdAlias()->getGroupAlias(); } virtual ClassDef *category() const { return getMdAlias()->category(); } @@ -741,6 +742,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef { err("non-const getNamespaceDef() called on aliased member. Please report as a bug.\n"); return 0; } virtual GroupDef *getGroupDef() { err("non-const getGroupDef() called on aliased member. Please report as a bug.\n"); return 0; } + virtual ArgumentList *argumentList() + { err("non-const argumentList() called on aliased member. Please report as bug.\n"); return 0; } virtual void setEnumBaseType(const QCString &type) {} virtual void setMemberType(MemberType t) {} @@ -797,7 +800,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef virtual void setTemplateMaster(MemberDef *mt) {} virtual void addListReference(Definition *d) {} virtual void setDocsForDefinition(bool b) {} - virtual void setGroupAlias(MemberDef *md) {} + virtual void setGroupAlias(const MemberDef *md) {} virtual void cacheTypedefVal(ClassDef *val,const QCString &templSpec,const QCString &resolvedType) {} virtual void invalidateTypedefValCache() {} virtual void invalidateCachedArgumentTypes() {} @@ -923,7 +926,7 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md) { - ArgumentList *defArgList=(md->isDocsForDefinition()) ? + const ArgumentList *defArgList=(md->isDocsForDefinition()) ? md->argumentList() : md->declArgumentList(); //printf("writeDefArgumentList `%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition()); if (defArgList==0 || md->isProperty()) @@ -1350,7 +1353,7 @@ class MemberDefImpl::IMPL // cached here. SDict<MemberList> *classSectionSDict; // not accessible - MemberDef *groupAlias; // Member containing the definition + const MemberDef *groupAlias; // Member containing the definition int grpId; // group id MemberGroup *memberGroup; // group's member definition GroupDef *group; // group in which this member is in @@ -4133,8 +4136,8 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn } else if (!m_impl->hasDocumentedParams) { - ArgumentList *al = argumentList(); - ArgumentList *declAl = declArgumentList(); + const ArgumentList *al = argumentList(); + const ArgumentList *declAl = declArgumentList(); bool allDoc=TRUE; // no parameter => all parameters are documented if ( // member has parameters al!=0 && // but the member has a parameter list @@ -5542,22 +5545,27 @@ bool MemberDefImpl::isPrototype() const return m_impl->proto; } -ArgumentList *MemberDefImpl::argumentList() const +const ArgumentList *MemberDefImpl::argumentList() const { return m_impl->defArgList; } -ArgumentList *MemberDefImpl::declArgumentList() const +ArgumentList *MemberDefImpl::argumentList() +{ + return m_impl->defArgList; +} + +const ArgumentList *MemberDefImpl::declArgumentList() const { return m_impl->declArgList; } -ArgumentList *MemberDefImpl::templateArguments() const +const ArgumentList *MemberDefImpl::templateArguments() const { return m_impl->tArgList; } -QList<ArgumentList> *MemberDefImpl::definitionTemplateParameterLists() const +const QList<ArgumentList> *MemberDefImpl::definitionTemplateParameterLists() const { return m_impl->defTmpArgLists; } @@ -5648,7 +5656,7 @@ MemberDef *MemberDefImpl::inheritsDocsFrom() const return m_impl->docProvider; } -MemberDef *MemberDefImpl::getGroupAlias() const +const MemberDef *MemberDefImpl::getGroupAlias() const { return m_impl->groupAlias; } @@ -5848,7 +5856,7 @@ void MemberDefImpl::setDocsForDefinition(bool b) m_impl->docsForDefinition = b; } -void MemberDefImpl::setGroupAlias(MemberDef *md) +void MemberDefImpl::setGroupAlias(const MemberDef *md) { m_impl->groupAlias = md; } @@ -5911,12 +5919,13 @@ void MemberDefImpl::cacheTypedefVal(ClassDef*val, const QCString & templSpec, co void MemberDefImpl::copyArgumentNames(MemberDef *bmd) { { - ArgumentList *arguments = bmd->argumentList(); + const ArgumentList *arguments = bmd->argumentList(); if (m_impl->defArgList && arguments) { ArgumentListIterator aliDst(*m_impl->defArgList); ArgumentListIterator aliSrc(*arguments); - Argument *argDst, *argSrc; + Argument *argDst; + const Argument *argSrc; for (;(argDst=aliDst.current()) && (argSrc=aliSrc.current());++aliDst,++aliSrc) { argDst->name = argSrc->name; @@ -5924,12 +5933,13 @@ void MemberDefImpl::copyArgumentNames(MemberDef *bmd) } } { - ArgumentList *arguments = bmd->declArgumentList(); + const ArgumentList *arguments = bmd->declArgumentList(); if (m_impl->declArgList && arguments) { ArgumentListIterator aliDst(*m_impl->declArgList); ArgumentListIterator aliSrc(*arguments); - Argument *argDst, *argSrc; + Argument *argDst; + const Argument *argSrc; for (;(argDst=aliDst.current()) && (argSrc=aliSrc.current());++aliDst,++aliSrc) { argDst->name = argSrc->name; @@ -6032,8 +6042,8 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef) const MemberDef *cmdec = const_cast<const MemberDef*>(mdec); const MemberDef *cmdef = const_cast<const MemberDef*>(mdef); - ArgumentList *mdefAl = cmdef->argumentList(); - ArgumentList *mdecAl = cmdec->argumentList(); + ArgumentList *mdefAl = mdef->argumentList(); + ArgumentList *mdecAl = mdec->argumentList(); if (matchArguments2(cmdef->getOuterScope(),cmdef->getFileDef(),mdefAl, cmdec->getOuterScope(),cmdec->getFileDef(),mdecAl, TRUE diff --git a/src/memberdef.h b/src/memberdef.h index ecaebcd..a742117 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -220,10 +220,11 @@ class MemberDef : virtual public Definition virtual bool isPrototype() const = 0; // argument related members - virtual ArgumentList *argumentList() const = 0; - virtual ArgumentList *declArgumentList() const = 0; - virtual ArgumentList *templateArguments() const = 0; - virtual QList<ArgumentList> *definitionTemplateParameterLists() const = 0; + virtual const ArgumentList *argumentList() const = 0; + virtual ArgumentList *argumentList() = 0; + virtual const ArgumentList *declArgumentList() const = 0; + virtual const ArgumentList *templateArguments() const = 0; + virtual const QList<ArgumentList> *definitionTemplateParameterLists() const = 0; // member group related members virtual int getMemberGroupId() const = 0; @@ -254,7 +255,7 @@ class MemberDef : virtual public Definition virtual MemberDef *memberDefinition() const = 0; virtual MemberDef *memberDeclaration() const = 0; virtual MemberDef *inheritsDocsFrom() const = 0; - virtual MemberDef *getGroupAlias() const = 0; + virtual const MemberDef *getGroupAlias() const = 0; virtual ClassDef *category() const = 0; virtual MemberDef *categoryRelation() const = 0; @@ -354,7 +355,7 @@ class MemberDef : virtual public Definition virtual void setTemplateMaster(MemberDef *mt) = 0; virtual void addListReference(Definition *d) = 0; virtual void setDocsForDefinition(bool b) = 0; - virtual void setGroupAlias(MemberDef *md) = 0; + virtual void setGroupAlias(const MemberDef *md) = 0; virtual void cacheTypedefVal(ClassDef *val,const QCString &templSpec,const QCString &resolvedType) = 0; virtual void invalidateTypedefValCache() = 0; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index d6e2af6..3813c56 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1617,23 +1617,23 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini md->memberType()!=MemberType_Enumeration) m_output.addFieldQuotedString("type", md->typeString()); - ArgumentList *al = md->argumentList(); + const ArgumentList *al = md->argumentList(); if (isFunc) //function { m_output.addFieldBoolean("const", al!=0 && al->constSpecifier) .addFieldBoolean("volatile", al!=0 && al->volatileSpecifier); m_output.openList("parameters"); - ArgumentList *declAl = md->declArgumentList(); - ArgumentList *defAl = md->argumentList(); + const ArgumentList *declAl = md->declArgumentList(); + const ArgumentList *defAl = md->argumentList(); if (declAl && defAl && declAl->count()>0) { ArgumentListIterator declAli(*declAl); ArgumentListIterator defAli(*defAl); - Argument *a; + const Argument *a; for (declAli.toFirst();(a=declAli.current());++declAli) { - Argument *defArg = defAli.current(); + const Argument *defArg = defAli.current(); m_output.openHash(); if (!a->name.isEmpty()) @@ -1665,7 +1665,7 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini { m_output.openList("parameters"); ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; for (ali.toFirst();(a=ali.current());++ali) { m_output.openHash() diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index eceea06..9805d7f 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -1015,16 +1015,16 @@ static void insertMemberReference(const MemberDef *src, const MemberDef *dst, co static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, const Definition *def) { - ArgumentList *declAl = md->declArgumentList(); - ArgumentList *defAl = md->argumentList(); + const ArgumentList *declAl = md->declArgumentList(); + const ArgumentList *defAl = md->argumentList(); if (declAl!=0 && defAl!=0 && declAl->count()>0) { ArgumentListIterator declAli(*declAl); ArgumentListIterator defAli(*defAl); - Argument *a; + const Argument *a; for (declAli.toFirst();(a=declAli.current());++declAli) { - Argument *defArg = defAli.current(); + const Argument *defArg = defAli.current(); if (!a->attrib.isEmpty()) { @@ -1410,7 +1410,7 @@ static void writeTemplateArgumentList(const ArgumentList * al, static void writeMemberTemplateLists(const MemberDef *md) { - ArgumentList *templMd = md->templateArguments(); + const ArgumentList *templMd = md->templateArguments(); if (templMd) // function template prefix { writeTemplateArgumentList(templMd,md->getClassDef(),md->getFileDef()); @@ -1434,7 +1434,7 @@ QCString getSQLDocBlock(const Definition *scope, fileName, lineNr, const_cast<Definition*>(scope), - const_cast<MemberDef*>(reinterpret_cast<const MemberDef*>(def)), + dynamic_cast<const MemberDef*>(def), doc, FALSE, FALSE @@ -1675,7 +1675,7 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref if (isFunc) { - ArgumentList *al = md->argumentList(); + const ArgumentList *al = md->argumentList(); if (al!=0) { bindIntParameter(memberdef_insert,":const",al->constSpecifier); diff --git a/src/util.cpp b/src/util.cpp index 5c66dd1..2654ccf 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3765,8 +3765,8 @@ static bool matchArgument2( // new algorithm for argument matching -bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,ArgumentList *srcAl, - const Definition *dstScope,const FileDef *dstFileScope,ArgumentList *dstAl, +bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList *srcAl, + const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl, bool checkCV) { //printf("*** matchArguments2\n"); @@ -3793,7 +3793,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,Argu { // special case for finding match between func() and func(void) Argument *a=new Argument; a->type = "void"; - srcAl->append(a); + const_cast<ArgumentList*>(srcAl)->append(a); MATCH return TRUE; } @@ -3802,7 +3802,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,Argu { // special case for finding match between func(void) and func() Argument *a=new Argument; a->type = "void"; - dstAl->append(a); + const_cast<ArgumentList*>(dstAl)->append(a); MATCH return TRUE; } @@ -4016,7 +4016,7 @@ static void findMembersWithSpecificName(MemberName *mn, if (args && !md->isDefine() && qstrcmp(args,"()")!=0) { argList=new ArgumentList; - ArgumentList *mdAl = md->argumentList(); + const ArgumentList *mdAl = md->argumentList(); stringToArgumentList(args,argList); match=matchArguments2( md->getOuterScope(),fd,mdAl, @@ -4367,7 +4367,7 @@ bool getDefs(const QCString &scName, if (args && qstrcmp(args,"()")!=0) { argList=new ArgumentList; - ArgumentList *mmdAl = mmd->argumentList(); + const ArgumentList *mmdAl = mmd->argumentList(); stringToArgumentList(args,argList); match=matchArguments2( mmd->getOuterScope(),mmd->getFileDef(),mmdAl, @@ -6346,7 +6346,7 @@ QCString normalizeNonTemplateArgumentsInString( if (formalArgs) // check that n is not a formal template argument { ArgumentListIterator formAli(*formalArgs); - Argument *formArg; + const Argument *formArg; for (formAli.toFirst(); (formArg=formAli.current()) && !found; ++formAli @@ -7933,12 +7933,12 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue) return result; } -void writeTypeConstraints(OutputList &ol,const Definition *d,ArgumentList *al) +void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList *al) { if (al==0) return; ol.startConstraintList(theTranslator->trTypeConstraints()); ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; for (;(a=ali.current());++ali) { ol.startConstraintParam(); @@ -185,8 +185,8 @@ void writePageRef(OutputDocInterface &od,const char *cn,const char *mn); QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec); -bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,ArgumentList *srcAl, - const Definition *dstScope,const FileDef *dstFileScope,ArgumentList *dstAl, +bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList *srcAl, + const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl, bool checkCV ); @@ -416,7 +416,7 @@ int countAliasArguments(const QCString argList); QCString resolveAliasCmd(const QCString aliasCmd); QCString expandAlias(const QCString &aliasName,const QCString &aliasValue); -void writeTypeConstraints(OutputList &ol,const Definition *d,ArgumentList *al); +void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList *al); QCString convertCharEntitiesToUTF8(const QCString &s); diff --git a/src/vhdlcode.l b/src/vhdlcode.l index f52a539..7c6cfa4 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -433,10 +433,10 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol, static void setParameterList(const MemberDef *md) { g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : ""; - ArgumentList *al = md->argumentList(); + const ArgumentList *al = md->argumentList(); if (al==0) return; ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; for (ali.toFirst();(a=ali.current());++ali) { g_parmName = a->name.copy(); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 55c1c17..bba249a 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -2002,7 +2002,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, QCString ltype(mdef->typeString()); QCString largs(mdef->argsString()); ClassDef *kl=0; - ArgumentList *alp = mdef->argumentList(); + const ArgumentList *alp = mdef->argumentList(); QCString nn; //VhdlDocGen::adjustRecordMember(mdef); if (gd) gd=0; diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index a96b4f9..fe324be 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -336,7 +336,7 @@ void XMLCodeGenerator::finish() if (m_insideCodeLine) endCodeLine(); } -static void writeTemplateArgumentList(ArgumentList *al, +static void writeTemplateArgumentList(const ArgumentList *al, FTextStream &t, const Definition *scope, const FileDef *fileScope, @@ -348,7 +348,7 @@ static void writeTemplateArgumentList(ArgumentList *al, { t << indentStr << "<templateparamlist>" << endl; ArgumentListIterator ali(*al); - Argument *a; + const Argument *a; for (ali.toFirst();(a=ali.current());++ali) { t << indentStr << " <param>" << endl; @@ -383,7 +383,7 @@ static void writeTemplateArgumentList(ArgumentList *al, static void writeMemberTemplateLists(const MemberDef *md,FTextStream &t) { - ArgumentList *templMd = md->templateArguments(); + const ArgumentList *templMd = md->templateArguments(); if (templMd) // function template prefix { writeTemplateArgumentList(templMd,t,md->getClassDef(),md->getFileDef(),8); @@ -589,7 +589,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream if (isFunc) { - ArgumentList *al = md->argumentList(); + const ArgumentList *al = md->argumentList(); t << " const=\""; if (al!=0 && al->constSpecifier) t << "yes"; else t << "no"; t << "\""; @@ -838,13 +838,13 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream if (isFunc) //function { - ArgumentList *declAl = md->declArgumentList(); - ArgumentList *defAl = md->argumentList(); + const ArgumentList *declAl = md->declArgumentList(); + const ArgumentList *defAl = md->argumentList(); if (declAl && defAl && declAl->count()>0) { ArgumentListIterator declAli(*declAl); ArgumentListIterator defAli(*defAl); - Argument *a; + const Argument *a; for (declAli.toFirst();(a=declAli.current());++declAli) { Argument *defArg = defAli.current(); @@ -908,7 +908,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream else { ArgumentListIterator ali(*md->argumentList()); - Argument *a; + const Argument *a; for (ali.toFirst();(a=ali.current());++ali) { t << " <param><defname>" << a->type << "</defname></param>" << endl; |