diff options
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 222 |
1 files changed, 112 insertions, 110 deletions
diff --git a/src/util.cpp b/src/util.cpp index fa3c55f..a6ae004 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -346,8 +346,8 @@ int guessSection(const char *name) return 0; } -QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, - Definition **typedefContext) +QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, + const Definition **typedefContext) { //printf("<<resolveTypeDef(%s,%s)\n", // context ? context->name().data() : "<none>",qualifiedName.data()); @@ -358,7 +358,7 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, return result; } - Definition *mContext=context; + const Definition *mContext=context; if (typedefContext) *typedefContext=context; // see if the qualified name has a scope part @@ -378,7 +378,7 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, while (mContext && md==0) { // step 1: get the right scope - Definition *resScope=mContext; + const Definition *resScope=mContext; if (scopeIndex!=-1) { // split-off scope part @@ -559,7 +559,7 @@ ClassDef *newResolveTypedef(const FileDef *fileScope,MemberDef *md, g_resolvedTypedefs.insert(qname,md); // put on the trace list - ClassDef *typeClass = md->getClassDef(); + const ClassDef *typeClass = md->getClassDef(); QCString type = md->typeString(); // get the "value" of the typedef if (typeClass && typeClass->isTemplate() && actTemplParams && actTemplParams->count()>0) @@ -730,7 +730,7 @@ static QCString substTypedef(const Definition *scope,const FileDef *fileScope,co return result; } -static Definition *endOfPathIsUsedClass(SDict<Definition> *cl,const QCString &localName) +static const Definition *endOfPathIsUsedClass(const SDict<Definition> *cl,const QCString &localName) { if (cl) { @@ -852,18 +852,21 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl, //printf("] found it\n"); return TRUE; } - QCString key=und->name(); - if (und->getUsedNamespaces() && visitedDict.find(key)==0) + if (item->getLanguage()==SrcLangExt_Cpp) { - visitedDict.insert(key,(void *)0x08); - - if (accessibleViaUsingNamespace(und->getUsedNamespaces(),fileScope,item,explicitScopePart)) + QCString key=und->name(); + if (und->getUsedNamespaces() && visitedDict.find(key)==0) { - //printf("] found it via recursion\n"); - return TRUE; - } + visitedDict.insert(key,(void *)0x08); + + if (accessibleViaUsingNamespace(und->getUsedNamespaces(),fileScope,item,explicitScopePart)) + { + //printf("] found it via recursion\n"); + return TRUE; + } - visitedDict.remove(key); + visitedDict.remove(key); + } } //printf("] Try via used namespace done\n"); } @@ -1011,13 +1014,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi { const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope); //printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses()); - SDict<Definition> *cl = nscope->getUsedClasses(); + const SDict<Definition> *cl = nscope->getUsedClasses(); if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); @@ -1115,11 +1118,11 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop // in A via a using directive. //printf("newScope is a namespace: %s!\n",newScope->name().data()); const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(newScope); - SDict<Definition> *cl = nscope->getUsedClasses(); + const SDict<Definition> *cl = nscope->getUsedClasses(); if (cl) { SDict<Definition>::Iterator cli(*cl); - Definition *cd; + const Definition *cd; for (cli.toFirst();(cd=cli.current());++cli) { //printf("Trying for class %s\n",cd->name().data()); @@ -1130,11 +1133,11 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop } } } - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (nl) { NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (g_visitedNamespaces.find(nd->name())==0) @@ -1166,7 +1169,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop if (scope->definitionType()==Definition::TypeNamespace) { const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope); - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); @@ -1177,7 +1180,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop { if (fileScope) { - NamespaceSDict *nl = fileScope->getUsedNamespaces(); + const NamespaceSDict *nl = fileScope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); @@ -1869,7 +1872,7 @@ QCString removeRedundantWhiteSpace(const QCString &s) case '@': // '@name' -> ' @name' case '$': // '$name' -> ' $name' case '\'': // ''name' -> '' name' - if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace(pc) && + if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace((uchar)pc) && isId(nc) && osp<8) // ")id" -> ") id" { *dst++=' '; @@ -1913,14 +1916,14 @@ QCString removeRedundantWhiteSpace(const QCString &s) default: *dst++=c; if (c=='t' && csp==5 && i<l-1 && // found 't' in 'const' - !(isId(nc) || nc==')' || nc==',' || isspace(nc)) + !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc)) ) // prevent const ::A from being converted to const::A { *dst++=' '; csp=0; } else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual' - !(isId(nc) || nc==')' || nc==',' || isspace(nc)) + !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc)) ) // prevent virtual ::A from being converted to virtual::A { *dst++=' '; @@ -2077,11 +2080,11 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, bool found=FALSE; if (!insideString) { - ClassDef *cd=0; - FileDef *fd=0; - MemberDef *md=0; - NamespaceDef *nd=0; - GroupDef *gd=0; + const MemberDef *md=0; + const ClassDef *cd=0; + const FileDef *fd=0; + const NamespaceDef *nd=0; + const GroupDef *gd=0; //printf("** Match word '%s'\n",matchWord.data()); MemberDef *typeDef=0; @@ -2249,12 +2252,12 @@ void writeExample(OutputList &ol,ExampleSDict *ed) } -QCString argListToString(ArgumentList *al,bool useCanonicalType,bool showDefVals) +QCString argListToString(const ArgumentList *al,bool useCanonicalType,bool showDefVals) { QCString result; if (al==0) return result; ArgumentListIterator ali(*al); - Argument *a=ali.current(); + const Argument *a=ali.current(); result+="("; while (a) { @@ -2297,13 +2300,13 @@ QCString argListToString(ArgumentList *al,bool useCanonicalType,bool showDefVals return removeRedundantWhiteSpace(result); } -QCString tempArgListToString(ArgumentList *al,SrcLangExt lang) +QCString tempArgListToString(const ArgumentList *al,SrcLangExt lang) { QCString result; if (al==0) return result; result="<"; ArgumentListIterator ali(*al); - Argument *a=ali.current(); + const Argument *a=ali.current(); while (a) { if (!a->name.isEmpty()) // add template argument name @@ -2662,7 +2665,7 @@ int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level) return m; } -Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection prot,int level) +Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot,int level) { if (bcd->categoryOf()) // use class that is being extended in case of // an Objective-C category @@ -2681,7 +2684,7 @@ Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection p else if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); - BaseClassDef *bcdi; + const BaseClassDef *bcdi; for (;(bcdi=bcli.current()) && prot!=Private;++bcli) { Protection baseProt = classInheritedProtectionLevel(bcdi->classDef,bcd,bcdi->prot,level+1); @@ -3448,9 +3451,9 @@ static QCString stripDeclKeywords(const QCString &s) } // forward decl for circular dependencies -static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type); +static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCString type); -QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec) +QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec) { QCString templSpec = spec.stripWhiteSpace(); @@ -3471,7 +3474,7 @@ QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec static QCString getCanonicalTypeForIdentifier( - Definition *d,FileDef *fs,const QCString &word, + const Definition *d,const FileDef *fs,const QCString &word, QCString *tSpec,int count=0) { if (count>10) return word; // oops recursion @@ -3607,7 +3610,7 @@ static QCString getCanonicalTypeForIdentifier( return result; } -static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) +static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCString type) { type = type.stripWhiteSpace(); @@ -3677,7 +3680,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) return removeRedundantWhiteSpace(canType); } -static QCString extractCanonicalArgType(Definition *d,FileDef *fs,const Argument *arg) +static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,const Argument *arg) { QCString type = arg->type.stripWhiteSpace(); QCString name = arg->name; @@ -3701,8 +3704,8 @@ static QCString extractCanonicalArgType(Definition *d,FileDef *fs,const Argument } static bool matchArgument2( - Definition *srcScope,FileDef *srcFileScope,Argument *srcA, - Definition *dstScope,FileDef *dstFileScope,Argument *dstA + const Definition *srcScope,const FileDef *srcFileScope,Argument *srcA, + const Definition *dstScope,const FileDef *dstFileScope,Argument *dstA ) { //printf(">> match argument: %s::`%s|%s' (%s) <-> %s::`%s|%s' (%s)\n", @@ -3762,10 +3765,9 @@ static bool matchArgument2( // new algorithm for argument matching -bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *srcAl, - Definition *dstScope,FileDef *dstFileScope,ArgumentList *dstAl, - bool checkCV - ) +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"); ASSERT(srcScope!=0 && dstScope!=0); @@ -3791,7 +3793,7 @@ bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *sr { // 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; } @@ -3800,7 +3802,7 @@ bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *sr { // 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; } @@ -3987,7 +3989,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr static void findMembersWithSpecificName(MemberName *mn, const char *args, bool checkStatics, - FileDef *currentFile, + const FileDef *currentFile, bool checkCV, const char *forceTagFile, QList<MemberDef> &members) @@ -3995,11 +3997,11 @@ static void findMembersWithSpecificName(MemberName *mn, //printf(" Function with global scope name `%s' args=`%s'\n", // mn->memberName(),args); MemberNameIterator mli(*mn); - MemberDef *md; + const MemberDef *md = 0; for (mli.toFirst();(md=mli.current());++mli) { - FileDef *fd=md->getFileDef(); - GroupDef *gd=md->getGroupDef(); + const FileDef *fd=md->getFileDef(); + const GroupDef *gd=md->getGroupDef(); //printf(" md->name()=`%s' md->args=`%s' fd=%p gd=%p current=%p ref=%s\n", // md->name().data(),args,fd,gd,currentFile,md->getReference().data()); if ( @@ -4014,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, @@ -4056,13 +4058,13 @@ static void findMembersWithSpecificName(MemberName *mn, bool getDefs(const QCString &scName, const QCString &mbName, const char *args, - MemberDef *&md, - ClassDef *&cd, - FileDef *&fd, - NamespaceDef *&nd, - GroupDef *&gd, + const MemberDef *&md, + const ClassDef *&cd, + const FileDef *&fd, + const NamespaceDef *&nd, + const GroupDef *&gd, bool forceEmptyScope, - FileDef *currentFile, + const FileDef *currentFile, bool checkCV, const char *forceTagFile ) @@ -4225,7 +4227,7 @@ bool getDefs(const QCString &scName, if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum { //printf("Found scoped enum!\n"); - MemberList *tml = tmd->enumFieldList(); + const MemberList *tml = tmd->enumFieldList(); if (tml) { MemberListIterator tmi(*tml); @@ -4334,12 +4336,12 @@ bool getDefs(const QCString &scName, // namespaceName.data(),mn->count()); bool found=FALSE; MemberNameIterator mmli(*mn); - MemberDef *mmd; + const MemberDef *mmd; for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli) { //printf("mmd->getNamespaceDef()=%p fnd=%p\n", // mmd->getNamespaceDef(),fnd); - MemberDef *emd = mmd->getEnumScope(); + const MemberDef *emd = mmd->getEnumScope(); if (emd && emd->isStrong()) { //printf("yes match %s<->%s!\n",mScope.data(),emd->localName().data()); @@ -4358,14 +4360,14 @@ bool getDefs(const QCString &scName, return FALSE; } } - else if (mmd->getNamespaceDef()==fnd /* && mmd->isLinkable() */ ) + else if (mmd->getOuterScope()==fnd /* && mmd->isLinkable() */ ) { // namespace is found bool match=TRUE; ArgumentList *argList=0; 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, @@ -4398,7 +4400,7 @@ bool getDefs(const QCString &scName, } } } - if (found) + if (found) { if (!md->isLinkable()) { @@ -4408,7 +4410,7 @@ bool getDefs(const QCString &scName, } else { - gd=md->getGroupDef(); + gd=md->resolveAlias()->getGroupDef(); if (gd && gd->isLinkable()) nd=0; else gd=0; return TRUE; } @@ -4421,7 +4423,7 @@ bool getDefs(const QCString &scName, MemberDef *mmd; for (mmli.toFirst();(mmd=mmli.current());++mmli) { - MemberDef *tmd = mmd->getEnumScope(); + const MemberDef *tmd = mmd->getEnumScope(); //printf("try member %s tmd=%s\n",mmd->name().data(),tmd?tmd->name().data():"<none>"); int ni=namespaceName.findRev("::"); //printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni); @@ -4475,7 +4477,7 @@ bool getDefs(const QCString &scName, //printf("member is linkable md->name()=`%s'\n",md->name().data()); fd=md->getFileDef(); gd=md->getGroupDef(); - MemberDef *tmd = md->getEnumScope(); + const MemberDef *tmd = md->getEnumScope(); if ( (gd && gd->isLinkable()) || (fd && fd->isLinkable()) || (tmd && tmd->isStrong()) @@ -4602,10 +4604,10 @@ static bool isLowerCase(QCString &s) bool resolveRef(/* in */ const char *scName, /* in */ const char *name, /* in */ bool inSeeBlock, - /* out */ Definition **resContext, - /* out */ MemberDef **resMember, + /* out */ const Definition **resContext, + /* out */ const MemberDef **resMember, bool lookForSpecialization, - FileDef *currentFile, + const FileDef *currentFile, bool checkScope ) { @@ -4704,11 +4706,11 @@ bool resolveRef(/* in */ const char *scName, QCString scopeStr=scName; - MemberDef *md = 0; - ClassDef *cd = 0; - FileDef *fd = 0; - NamespaceDef *nd = 0; - GroupDef *gd = 0; + const MemberDef *md = 0; + const ClassDef *cd = 0; + const FileDef *fd = 0; + const NamespaceDef *nd = 0; + const GroupDef *gd = 0; // check if nameStr is a member or global. //printf("getDefs(scope=%s,name=%s,args=%s checkScope=%d)\n", @@ -4876,7 +4878,7 @@ bool generateRef(OutputDocInterface &od,const char *scName, bool resolveLink(/* in */ const char *scName, /* in */ const char *lr, /* in */ bool /*inSeeBlock*/, - /* out */ Definition **resContext, + /* out */ const Definition **resContext, /* out */ QCString &resAnchor ) { @@ -4885,12 +4887,12 @@ bool resolveLink(/* in */ const char *scName, QCString linkRef=lr; QCString linkRefWithoutTemplates = stripTemplateSpecifiersFromScope(linkRef,FALSE); //printf("ResolveLink linkRef=%s\n",lr); - FileDef *fd; - GroupDef *gd; - PageDef *pd; - ClassDef *cd; - DirDef *dir; - NamespaceDef *nd; + const FileDef *fd; + const GroupDef *gd; + const PageDef *pd; + const ClassDef *cd; + const DirDef *dir; + const NamespaceDef *nd; SectionInfo *si=0; bool ambig; if (linkRef.isEmpty()) // no reference name! @@ -4899,7 +4901,7 @@ bool resolveLink(/* in */ const char *scName, } else if ((pd=Doxygen::pageSDict->find(linkRef))) // link to a page { - GroupDef *gd = pd->getGroupDef(); + const GroupDef *gd = pd->getGroupDef(); if (gd) { if (!pd->name().isEmpty()) si=Doxygen::sectionDict->find(pd->name()); @@ -4971,7 +4973,7 @@ bool resolveLink(/* in */ const char *scName, } else // probably a member reference { - MemberDef *md; + const MemberDef *md = 0; bool res = resolveRef(scName,lr,TRUE,resContext,&md); if (md) resAnchor=md->anchor(); return res; @@ -4990,7 +4992,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, const char *lr,bool inSeeBlock,const char *lt) { //printf("generateLink(clName=%s,lr=%s,lr=%s)\n",clName,lr,lt); - Definition *compound; + const Definition *compound = 0; //PageDef *pageDef=0; QCString anchor,linkText=linkToText(SrcLangExt_Unknown,lt,FALSE); //printf("generateLink linkText=%s\n",linkText.data()); @@ -5002,7 +5004,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, compound->definitionType()==Definition::TypeGroup /* is group */ ) { - linkText=(dynamic_cast<GroupDef *>(compound))->groupTitle(); // use group's title as link + linkText=(dynamic_cast<const GroupDef *>(compound))->groupTitle(); // use group's title as link } else if (compound->definitionType()==Definition::TypeFile) { @@ -5379,7 +5381,7 @@ static void initBaseClassHierarchy(BaseClassList *bcl) } //---------------------------------------------------------------------------- -bool classHasVisibleChildren(ClassDef *cd) +bool classHasVisibleChildren(const ClassDef *cd) { BaseClassList *bcl; @@ -5421,14 +5423,14 @@ void initClassHierarchy(ClassSDict *cl) //---------------------------------------------------------------------------- -bool hasVisibleRoot(BaseClassList *bcl) +bool hasVisibleRoot(const BaseClassList *bcl) { if (bcl) { BaseClassListIterator bcli(*bcl); for ( ; bcli.current(); ++bcli) { - ClassDef *cd=bcli.current()->classDef; + const ClassDef *cd=bcli.current()->classDef; if (cd->isVisibleInHierarchy()) return TRUE; hasVisibleRoot(cd->baseClasses()); } @@ -6154,7 +6156,7 @@ QCString getOverloadDocs() void addMembersToMemberGroup(MemberList *ml, MemberGroupSDict **ppMemberGroupSDict, - Definition *context) + const Definition *context) { ASSERT(context!=0); //printf("addMemberToMemberGroup()\n"); @@ -6166,7 +6168,7 @@ void addMembersToMemberGroup(MemberList *ml, { if (md->isEnumerate()) // insert enum value of this enum into groups { - MemberList *fmdl=md->enumFieldList(); + const MemberList *fmdl=md->enumFieldList(); if (fmdl!=0) { MemberListIterator fmli(*fmdl); @@ -6324,7 +6326,7 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri QCString normalizeNonTemplateArgumentsInString( const QCString &name, - Definition *context, + const Definition *context, const ArgumentList * formalArgs) { // skip until < @@ -6344,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 @@ -6656,7 +6658,7 @@ found: PageDef *addRelatedPage(const char *name,const QCString &ptitle, const QCString &doc, - QList<SectionInfo> * /*anchors*/, + const QList<SectionInfo> * /*anchors*/, const char *fileName,int startLine, const QList<ListItemInfo> *sli, GroupDef *gd, @@ -6782,7 +6784,7 @@ void addRefItem(const QList<ListItemInfo> *sli, } } -bool recursivelyAddGroupListToTitle(OutputList &ol,Definition *d,bool root) +bool recursivelyAddGroupListToTitle(OutputList &ol,const Definition *d,bool root) { GroupList *groups = d->partOfGroups(); if (groups) // write list of group to which this definition belongs @@ -6815,7 +6817,7 @@ bool recursivelyAddGroupListToTitle(OutputList &ol,Definition *d,bool root) return false; } -void addGroupListToTitle(OutputList &ol,Definition *d) +void addGroupListToTitle(OutputList &ol,const Definition *d) { recursivelyAddGroupListToTitle(ol,d,TRUE); } @@ -7200,7 +7202,7 @@ bool findAndRemoveWord(QCString &s,const QCString &word) { if (i>0 && isspace((uchar)s.at(i-1))) i--,l++; - else if (i+l<(int)s.length() && isspace(s.at(i+l))) + else if (i+l<(int)s.length() && isspace((uchar)s.at(i+l))) l++; s = s.left(i)+s.mid(i+l); // remove word + spacing return TRUE; @@ -7432,7 +7434,7 @@ SrcLangExt getLanguageFromFileName(const QCString& fileName) //-------------------------------------------------------------------------- -MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope, +MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope, const char *n) { if (scope==0 || @@ -7504,7 +7506,7 @@ MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope, } /*! Returns true iff the given name string appears to be a typedef in scope. */ -bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n) +bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char *n) { MemberDef *bestMatch = getMemberFromSymbol(scope,fileScope,n); @@ -7931,12 +7933,12 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue) return result; } -void writeTypeConstraints(OutputList &ol,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(); @@ -8553,7 +8555,7 @@ QCString stripIndentation(const QCString &s) } -bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile) +bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile) { static bool allExternals = Config_getBool(ALLEXTERNALS); bool isDocFile = fd->isDocumentationFile(); @@ -8672,12 +8674,12 @@ uint getUtf8CodeToUpper( const QCString& s, int idx ) //-------------------------------------------------------------------------------------- -bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct) +bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct) { if (nd->getNamespaceSDict()) { NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict()); - NamespaceDef *cnd; + const NamespaceDef *cnd; for (cnli.toFirst();(cnd=cnli.current());++cnli) { if (cnd->isLinkableInProject() && cnd->localName().find('@')==-1) @@ -8692,7 +8694,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl } if (includeClasses) { - ClassSDict *d = nd->getClassSDict(); + const ClassSDict *d = nd->getClassSDict(); if (filterClasses) { if (ct == ClassDef::Interface) @@ -8712,7 +8714,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl if (d) { ClassSDict::Iterator cli(*d); - ClassDef *cd; + const ClassDef *cd; for (;(cd=cli.current());++cli) { if (cd->isLinkableInProject() && cd->templateMaster()==0) @@ -8727,7 +8729,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl //---------------------------------------------------------------------------- -bool classVisibleInIndex(ClassDef *cd) +bool classVisibleInIndex(const ClassDef *cd) { static bool allExternals = Config_getBool(ALLEXTERNALS); return (allExternals && cd->isLinkable()) || cd->isLinkableInProject(); |