summaryrefslogtreecommitdiffstats
path: root/src/pycode.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-02-18 19:29:38 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-02-28 19:55:47 (GMT)
commit960bae7191faf07f142b1ae5b0038905d33e2b1f (patch)
treefb5ce28720b56945588c77c3f5ab19c61cc8ef32 /src/pycode.l
parent79ace06168f1e09fce00515248d83571302a67ae (diff)
downloadDoxygen-960bae7191faf07f142b1ae5b0038905d33e2b1f.zip
Doxygen-960bae7191faf07f142b1ae5b0038905d33e2b1f.tar.gz
Doxygen-960bae7191faf07f142b1ae5b0038905d33e2b1f.tar.bz2
Refactored Definition and derived classes such that they are abstract interfaces
Diffstat (limited to 'src/pycode.l')
-rw-r--r--src/pycode.l10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pycode.l b/src/pycode.l
index 8f2279e..4fb27f1 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -786,13 +786,13 @@ static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *s
sym->getOuterScope()->definitionType()==Definition::TypeClass &&
g_currentDefinition->definitionType()==Definition::TypeClass)
{
- ClassDef *cd = (ClassDef*)sym->getOuterScope();
- ClassDef *thisCd = (ClassDef *)g_currentDefinition;
+ ClassDef *cd = dynamic_cast<ClassDef*>(sym->getOuterScope());
+ ClassDef *thisCd = dynamic_cast<ClassDef *>(g_currentDefinition);
if (sym->definitionType()==Definition::TypeMember)
{
if (g_currentMemberDef && g_collectXRefs)
{
- addDocCrossReference(g_currentMemberDef,(MemberDef*)sym);
+ addDocCrossReference(g_currentMemberDef,dynamic_cast<MemberDef*>(sym));
}
}
DBG_CTX((stderr,"cd=%s thisCd=%s\n",cd?cd->name().data():"<none>",thisCd?thisCd->name().data():"<none>"));
@@ -1086,7 +1086,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
// Push a class scope
- ClassDef *classDefToAdd = new ClassDef("<code>",1,1,g_curClassName,ClassDef::Class,0,0,FALSE);
+ ClassDef *classDefToAdd = createClassDef("<code>",1,1,g_curClassName,ClassDef::Class,0,0,FALSE);
g_codeClassSDict.append(g_curClassName,classDefToAdd);
char *s=g_curClassBases.first();
while (s)
@@ -1594,7 +1594,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
if (exBlock && fd==0)
{
// create a dummy filedef for the example
- g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
+ g_sourceFileDef = createFileDef("",(exName?exName:"generated"));
cleanupSourceDef = TRUE;
}
if (g_sourceFileDef)