Skip to content

Commit 481e12d

Browse files
authored
Merge pull request doxygen#11813 from artyom-fedosov/fix/clang-tidy-warnings
Fix/clang-tidy-warnings
2 parents 81dc757 + 860a8e8 commit 481e12d

File tree

6 files changed

+10
-17
lines changed

6 files changed

+10
-17
lines changed

src/message.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static void format_warn(const QCString &file,int line,const QCString &text)
5757
{
5858
QCString fileSubst = file.isEmpty() ? "<unknown>" : file;
5959
QCString lineSubst; lineSubst.setNum(line);
60-
QCString textSubst = text;
6160
QCString versionSubst;
6261
// substitute markers by actual values
6362
QCString msgText =
@@ -72,7 +71,7 @@ static void format_warn(const QCString &file,int line,const QCString &text)
7271
),
7372
"$version",versionSubst
7473
),
75-
"$text",textSubst
74+
"$text",text
7675
);
7776
if (g_warnBehavior == WARN_AS_ERROR_t::YES)
7877
{

src/namespacedef.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@ void NamespaceDefImpl::insertMember(MemberDef *md)
575575
}
576576
if (aliasMd)
577577
{
578-
QCString name = md->name();
579-
MemberName *mn = Doxygen::functionNameLinkedMap->add(name);
578+
MemberName *mn = Doxygen::functionNameLinkedMap->add(md->name());
580579
mn->push_back(std::move(aliasMd));
581580
}
582581
}

src/pagedef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
242242
PageDef *pd = this;
243243
while (pd->hasParentPage())
244244
{
245-
pd = (PageDef *)pd->getOuterScope();
245+
pd = dynamic_cast<PageDef *>(pd->getOuterScope());
246246
++hierarchyLevel;
247247
}
248248

src/searchindex_js.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static void addMemberToSearchIndex(const MemberDef *md)
224224
)
225225
)
226226
{
227-
QCString n = md->name();
227+
const QCString &n = md->name();
228228
if (!n.isEmpty())
229229
{
230230
bool isFriendToHide = hideFriendCompounds &&
@@ -284,7 +284,7 @@ static void addMemberToSearchIndex(const MemberDef *md)
284284
)
285285
)
286286
{
287-
QCString n = md->name();
287+
const QCString &n = md->name();
288288
if (!n.isEmpty())
289289
{
290290
g_searchIndexInfo[SEARCH_INDEX_ALL].add(SearchTerm(n,md));

src/vhdldocgen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,13 @@ void VhdlDocGen::findAllArchitectures(std::vector<QCString>& qll,const ClassDef
548548

549549
const ClassDef* VhdlDocGen::findArchitecture(const ClassDef *cd)
550550
{
551-
QCString nn=cd->name();
552551
for (const auto &citer : *Doxygen::classLinkedMap)
553552
{
554553
QCString jj=citer->name();
555554
StringVector ql=split(jj.str(),":");
556555
if (ql.size()>1)
557556
{
558-
if (ql[0]==nn)
557+
if (ql[0]==cd->name())
559558
{
560559
return citer.get();
561560
}

src/vhdljjparser.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ struct VHDLOutlineParser::Private
8888
void VHDLOutlineParser::Private::parseVhdlfile(const QCString &fileName,
8989
const QCString &inputBuffer,bool inLine)
9090
{
91-
QCString s =inputBuffer;
92-
CharStream *stream = new CharStream(reinterpret_cast<const JJChar*>(s.data()), (int)s.size(), 1, 1);
91+
CharStream *stream = new CharStream(reinterpret_cast<const JJChar*>(inputBuffer.data()), (int)inputBuffer.size(), 1, 1);
9392
VhdlParserTokenManager *tokenManager = new VhdlParserTokenManager(stream);
9493
VhdlTokenManagerErrorHandler *tokErrHandler=new VhdlTokenManagerErrorHandler(fileName.data());
9594
vhdlParser=new VhdlParser(tokenManager);
@@ -285,8 +284,7 @@ int VHDLOutlineParser::checkInlineCode(QCString &doc)
285284
{
286285
if ((int)str.length()<pos) return -1;
287286
reg::Match match;
288-
const std::string s = str.str();
289-
if (reg::search(s,match,re,pos)) // match found
287+
if (reg::search(str.str(),match,re,pos)) // match found
290288
{
291289
return (int)match.position();
292290
}
@@ -522,15 +520,14 @@ void VHDLOutlineParser::addVhdlType(const QCString &n,int startLine,EntryType se
522520
VhdlSpecifier spec,const QCString &args,const QCString &type,Protection prot)
523521
{
524522
VhdlParser::SharedState *s = &p->shared;
525-
QCString name(n);
526523
if (isFuncProcProced() || VhdlDocGen::getFlowMember()) return;
527524

528525
if (s->parse_sec==VhdlSection::GEN_SEC)
529526
{
530527
spec=VhdlSpecifier::GENERIC;
531528
}
532529

533-
StringVector ql=split(name.str(),",");
530+
StringVector ql=split(n.str(),",");
534531

535532
for (size_t u=0;u<ql.size();u++)
536533
{
@@ -636,8 +633,7 @@ void VHDLOutlineParser::addProto(const QCString &s1,const QCString &s2,const QCS
636633
{
637634
VhdlParser::SharedState *s = &p->shared;
638635
(void)s5; // avoid unused warning
639-
QCString name=s2;
640-
StringVector ql=split(name.str(),",");
636+
StringVector ql=split(s2.str(),",");
641637

642638
for (const auto &n : ql)
643639
{

0 commit comments

Comments
 (0)