Skip to content

Commit

Permalink
Use smartpointers to manage the lifetime of Entry objects
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Oct 7, 2019
1 parent 40f187c commit ae0a5ec
Show file tree
Hide file tree
Showing 29 changed files with 1,021 additions and 1,114 deletions.
18 changes: 7 additions & 11 deletions src/commentscan.l
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,8 @@ static GuardType guardType; // kind of guard for conditional se
static bool enabledSectionFound;
static QCString functionProto; // function prototype
static QStack<GuardedSection> guards; // tracks nested conditional sections (if,ifnot,..)
static Entry* current = 0 ; // working entry
//static Entry* current_root = 0 ; // parent of working entry
static Entry *current = 0; // working entry


//static Entry* previous = 0 ; // TODO: remove need for this
static bool needNewEntry;

static QCString g_sectionLabel;
Expand Down Expand Up @@ -533,7 +530,6 @@ static QCString stripQuotes(const char *s)
static void addXRefItem(const char *listName,const char *itemTitle,
const char *listTitle,bool append)
{
Entry *docEntry = current; // inBody && previous ? previous : current;
if (listName==0) return;
//printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append);

Expand All @@ -545,9 +541,9 @@ static void addXRefItem(const char *listName,const char *itemTitle,
Doxygen::xrefLists->insert(listName,refList);
//printf("new list!\n");
}
if (docEntry->sli)
if (current->sli)
{
QListIterator<ListItemInfo> slii(*docEntry->sli);
QListIterator<ListItemInfo> slii(*current->sli);
for (slii.toLast();(lii=slii.current());--slii)
{
if (qstrcmp(lii->type,listName)==0)
Expand Down Expand Up @@ -580,16 +576,16 @@ static void addXRefItem(const char *listName,const char *itemTitle,
ASSERT(item!=0);
item->text = outputXRef;
item->listAnchor = anchorLabel;
docEntry->addSpecialListItem(listName,itemId);
current->addSpecialListItem(listName,itemId);
QCString cmdString;
cmdString.sprintf(" \\xrefitem %s %d.",listName,itemId);
if (inBody)
{
docEntry->inbodyDocs += cmdString;
current->inbodyDocs += cmdString;
}
else
{
docEntry->doc += cmdString;
current->doc += cmdString;
}
SectionInfo *si = Doxygen::sectionDict->find(anchorLabel);
if (si)
Expand All @@ -609,7 +605,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
g_sectionTitle,SectionInfo::Anchor,
g_sectionLevel);
Doxygen::sectionDict->append(anchorLabel,si);
docEntry->anchors->append(si);
current->anchors->append(si);
}
}
outputXRef.resize(0);
Expand Down
15 changes: 15 additions & 0 deletions src/docgroup.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/******************************************************************************
*
* Copyright (C) 1997-2019 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/

#include "doxygen.h"
#include "util.h"
#include "entry.h"
Expand Down
Loading

0 comments on commit ae0a5ec

Please sign in to comment.