summaryrefslogtreecommitdiffstats
path: root/src/pycode.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-07-29 21:03:09 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-07-29 21:03:09 (GMT)
commit25d7cd240edb02510bed86677d3021a2cfd96cd1 (patch)
treeb23024c9f5ff4a188dc7446a6279c44e2bac86b8 /src/pycode.l
parentc7952fe7141cdc8762c907a09338f98322f15933 (diff)
downloadDoxygen-25d7cd240edb02510bed86677d3021a2cfd96cd1.zip
Doxygen-25d7cd240edb02510bed86677d3021a2cfd96cd1.tar.gz
Doxygen-25d7cd240edb02510bed86677d3021a2cfd96cd1.tar.bz2
Improved constness and avoid using non-const members of aliases
Diffstat (limited to 'src/pycode.l')
-rw-r--r--src/pycode.l22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pycode.l b/src/pycode.l
index 1a87bca..010d188 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -162,7 +162,7 @@ void PyVariableContext::addVariable(const QCString &type,const QCString &name)
QCString lname = name.simplifyWhiteSpace();
Scope *scope = m_scopes.count()==0 ? &m_globalScope : m_scopes.getLast();
- ClassDef *varType;
+ const ClassDef *varType;
if (
(varType=g_codeClassSDict[ltype]) || // look for class definitions inside the code block
(varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,ltype)) // look for global class definitions
@@ -212,7 +212,7 @@ class PyCallContext
Ctx() : name(g_name), type(g_type), cd(0) {}
QCString name;
QCString type;
- ClassDef *cd;
+ const ClassDef *cd;
};
PyCallContext()
@@ -223,7 +223,7 @@ class PyCallContext
virtual ~PyCallContext() {}
- void setClass(ClassDef *cd)
+ void setClass(const ClassDef *cd)
{
Ctx *ctx = m_classList.getLast();
if (ctx)
@@ -259,7 +259,7 @@ class PyCallContext
m_classList.append(new Ctx);
}
- ClassDef *getClass() const
+ const ClassDef *getClass() const
{
Ctx *ctx = m_classList.getLast();
@@ -320,7 +320,7 @@ static void addToSearchIndex(const char *text)
}
-static ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
+static const ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
{
int pos=0;
QCString type = s;
@@ -330,7 +330,7 @@ static ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
{
QCString clName=className+templSpec;
- ClassDef *cd=0;
+ const ClassDef *cd=0;
if (!g_classScope.isEmpty())
{
cd=getResolvedClass(d,g_sourceFileDef,g_classScope+"::"+clName);
@@ -616,8 +616,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
DBG_CTX((stderr,"generateClassOrGlobalLink(className=%s)\n",className.data()));
- ClassDef *cd=0,*lcd=0; /** Class def that we may find */
- MemberDef *md=0; /** Member def that we may find */
+ const ClassDef *cd=0,*lcd=0; /** Class def that we may find */
+ const MemberDef *md=0; /** Member def that we may find */
//bool isLocal=FALSE;
if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable
@@ -669,7 +669,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
{
- addDocCrossReference(g_currentMemberDef,md);
+ addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(md));
}
}
}
@@ -1091,7 +1091,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
char *s=g_curClassBases.first();
while (s)
{
- ClassDef *baseDefToAdd=g_codeClassSDict[s];
+ const ClassDef *baseDefToAdd=g_codeClassSDict[s];
// Try to find class in global
// scope
@@ -1102,7 +1102,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
if (baseDefToAdd && baseDefToAdd!=classDefToAdd)
{
- classDefToAdd->insertBaseClass(baseDefToAdd,s,Public,Normal);
+ classDefToAdd->insertBaseClass(const_cast<ClassDef*>(baseDefToAdd),s,Public,Normal);
}
s=g_curClassBases.next();