diff options
author | Adrian Negreanu <groleo@gmail.com> | 2017-09-25 12:44:20 (GMT) |
---|---|---|
committer | Adrian Negreanu <groleo@gmail.com> | 2017-09-25 13:35:17 (GMT) |
commit | 5df4341210ec2374b8b7c09f5df3cd8f4ff60f65 (patch) | |
tree | c05d14bc4383d98a1cdc5a4bc94ae738c133f65b /src/util.cpp | |
parent | 47d679b67952949d639ea9a206535e97a6154bb5 (diff) | |
download | Doxygen-5df4341210ec2374b8b7c09f5df3cd8f4ff60f65.zip Doxygen-5df4341210ec2374b8b7c09f5df3cd8f4ff60f65.tar.gz Doxygen-5df4341210ec2374b8b7c09f5df3cd8f4ff60f65.tar.bz2 |
const-ify
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/util.cpp b/src/util.cpp index 0cda153..1b169cb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -516,14 +516,14 @@ static QDict<MemberDef> g_resolvedTypedefs; static QDict<Definition> g_visitedNamespaces; // forward declaration -static ClassDef *getResolvedClassRec(Definition *scope, - FileDef *fileScope, +static ClassDef *getResolvedClassRec(const Definition *scope, + const FileDef *fileScope, const char *n, MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType ); -int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,Definition *item, +int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScope,const Definition *item, const QCString &explicitScopePart); /*! Returns the class representing the value of the typedef represented by \a md @@ -533,7 +533,7 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,Definition * * Example: typedef int T; will return 0, since "int" is not a class. */ -ClassDef *newResolveTypedef(FileDef *fileScope,MemberDef *md, +ClassDef *newResolveTypedef(const FileDef *fileScope,MemberDef *md, MemberDef **pMemType,QCString *pTemplSpec, QCString *pResolvedType, ArgumentList *actTemplParams) @@ -664,7 +664,7 @@ done: /*! Substitutes a simple unqualified \a name within \a scope. Returns the * value of the typedef or \a name if no typedef was found. */ -static QCString substTypedef(Definition *scope,FileDef *fileScope,const QCString &name, +static QCString substTypedef(const Definition *scope,const FileDef *fileScope,const QCString &name, MemberDef **pTypeDef=0) { QCString result=name; @@ -750,11 +750,11 @@ static Definition *endOfPathIsUsedClass(SDict<Definition> *cl,const QCString &lo * searched. If found the scope definition is returned, otherwise 0 * is returned. */ -static Definition *followPath(Definition *start,FileDef *fileScope,const QCString &path) +static const Definition *followPath(const Definition *start,const FileDef *fileScope,const QCString &path) { int is,ps; int l; - Definition *current=start; + const Definition *current=start; ps=0; //printf("followPath: start='%s' path='%s'\n",start?start->name().data():"<none>",path.data()); // for each part of the explicit scope @@ -773,7 +773,7 @@ static Definition *followPath(Definition *start,FileDef *fileScope,const QCStrin return type; } } - Definition *next = current->findInnerCompound(qualScopePart); + const Definition *next = current->findInnerCompound(qualScopePart); //printf("++ Looking for %s inside %s result %s\n", // qualScopePart.data(), // current->name().data(), @@ -807,8 +807,8 @@ static Definition *followPath(Definition *start,FileDef *fileScope,const QCStrin } bool accessibleViaUsingClass(const SDict<Definition> *cl, - FileDef *fileScope, - Definition *item, + const FileDef *fileScope, + const Definition *item, const QCString &explicitScopePart="" ) { @@ -821,7 +821,7 @@ bool accessibleViaUsingClass(const SDict<Definition> *cl, for (cli.toFirst();(ucd=cli.current());++cli) { //printf("Trying via used class %s\n",ucd->name().data()); - Definition *sc = explicitScopePartEmpty ? ucd : followPath(ucd,fileScope,explicitScopePart); + const Definition *sc = explicitScopePartEmpty ? ucd : followPath(ucd,fileScope,explicitScopePart); if (sc && sc==item) return TRUE; //printf("Try via used class done\n"); } @@ -830,8 +830,8 @@ bool accessibleViaUsingClass(const SDict<Definition> *cl, } bool accessibleViaUsingNamespace(const NamespaceSDict *nl, - FileDef *fileScope, - Definition *item, + const FileDef *fileScope, + const Definition *item, const QCString &explicitScopePart="") { static QDict<void> visitedDict; @@ -844,7 +844,7 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl, { //printf("[Trying via used namespace %s: count=%d/%d\n",und->name().data(), // count,nl->count()); - Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart); + const Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart); if (sc && item->getOuterScope()==sc) { //printf("] found it\n"); @@ -878,7 +878,7 @@ class AccessStack { public: AccessStack() : m_index(0) {} - void push(Definition *scope,FileDef *fileScope,Definition *item) + void push(const Definition *scope,const FileDef *fileScope,const Definition *item) { if (m_index<MAX_STACK_SIZE) { @@ -888,7 +888,7 @@ class AccessStack m_index++; } } - void push(Definition *scope,FileDef *fileScope,Definition *item,const QCString &expScope) + void push(const Definition *scope,const FileDef *fileScope,const Definition *item,const QCString &expScope) { if (m_index<MAX_STACK_SIZE) { @@ -903,7 +903,7 @@ class AccessStack { if (m_index>0) m_index--; } - bool find(Definition *scope,FileDef *fileScope, Definition *item) + bool find(const Definition *scope,const FileDef *fileScope, const Definition *item) { int i=0; for (i=0;i<m_index;i++) @@ -916,7 +916,7 @@ class AccessStack } return FALSE; } - bool find(Definition *scope,FileDef *fileScope, Definition *item,const QCString &expScope) + bool find(const Definition *scope,const FileDef *fileScope, const Definition *item,const QCString &expScope) { int i=0; for (i=0;i<m_index;i++) @@ -934,9 +934,9 @@ class AccessStack /** Element in the stack. */ struct AccessElem { - Definition *scope; - FileDef *fileScope; - Definition *item; + const Definition *scope; + const FileDef *fileScope; + const Definition *item; QCString expScope; }; int m_index; @@ -946,7 +946,7 @@ class AccessStack /* Returns the "distance" (=number of levels up) from item to scope, or -1 * if item in not inside scope. */ -int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item) +int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Definition *item) { //printf("<isAccesibleFrom(scope=%s,item=%s itemScope=%s)\n", // scope->name().data(),item->name().data(),item->getOuterScope()->name().data()); @@ -1049,8 +1049,8 @@ done: * not found and then A::I is searched in the global scope, which matches and * thus the result is 1. */ -int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope, - Definition *item,const QCString &explicitScopePart) +int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScope, + const Definition *item,const QCString &explicitScopePart) { if (explicitScopePart.isEmpty()) { @@ -1070,7 +1070,7 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope, // item?item->name().data():"<none>", // explicitScopePart.data()); int result=0; // assume we found it - Definition *newScope = followPath(scope,fileScope,explicitScopePart); + const Definition *newScope = followPath(scope,fileScope,explicitScopePart); if (newScope) // explicitScope is inside scope => newScope is the result { Definition *itemScope = item->getOuterScope(); @@ -1207,8 +1207,8 @@ int computeQualifiedIndex(const QCString &name) return name.findRev("::",i==-1 ? name.length() : i); } -static void getResolvedSymbol(Definition *scope, - FileDef *fileScope, +static void getResolvedSymbol(const Definition *scope, + const FileDef *fileScope, Definition *d, const QCString &explicitScopePart, ArgumentList *actTemplParams, @@ -1372,8 +1372,8 @@ static void getResolvedSymbol(Definition *scope, * match against the input name. Can recursively call itself when * resolving typedefs. */ -static ClassDef *getResolvedClassRec(Definition *scope, - FileDef *fileScope, +static ClassDef *getResolvedClassRec(const Definition *scope, + const FileDef *fileScope, const char *n, MemberDef **pTypeDef, QCString *pTemplSpec, @@ -1561,8 +1561,8 @@ static ClassDef *getResolvedClassRec(Definition *scope, * Loops through scope and each of its parent scopes looking for a * match against the input name. */ -ClassDef *getResolvedClass(Definition *scope, - FileDef *fileScope, +ClassDef *getResolvedClass(const Definition *scope, + const FileDef *fileScope, const char *n, MemberDef **pTypeDef, QCString *pTemplSpec, @@ -1993,8 +1993,8 @@ bool leftScopeMatch(const QCString &scope, const QCString &name) } -void linkifyText(const TextGeneratorIntf &out,Definition *scope, - FileDef *fileScope,Definition *self, +void linkifyText(const TextGeneratorIntf &out, const Definition *scope, + const FileDef *fileScope,const Definition *self, const char *text, bool autoBreak,bool external, bool keepSpaces,int indentLevel) { |