Skip to content

Commit d5eaec2

Browse files
fix(definition): fix -Wcomma warning, improve formatting
1 parent 572eadb commit d5eaec2

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

src/definition.cpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,15 @@ static bool matchExcludedSymbols(const QCString &name)
164164
bool forceStart=FALSE;
165165
bool forceEnd=FALSE;
166166
if (pattern.at(0)=='^')
167-
pattern=pattern.mid(1),forceStart=TRUE;
168-
if (pattern.at(pattern.length()-1)=='$')
169-
pattern=pattern.left(pattern.length()-1),forceEnd=TRUE;
167+
{
168+
pattern = pattern.mid(1);
169+
forceStart = true;
170+
}
171+
if (pattern.at(pattern.length() - 1) == '$')
172+
{
173+
pattern = pattern.left(pattern.length() - 1);
174+
forceEnd = true;
175+
}
170176
if (pattern.find('*')!=-1) // wildcard mode
171177
{
172178
const reg::Ex re(substitute(pattern,"*",".*").str());
@@ -781,7 +787,8 @@ bool readCodeFragment(const QCString &fileName,bool isMacro,
781787
//printf("parsing char '%c'\n",c);
782788
if (c=='\n')
783789
{
784-
lineNr++,col=0;
790+
lineNr++;
791+
col = 0;
785792
}
786793
else if (c=='\t')
787794
{
@@ -790,13 +797,21 @@ bool readCodeFragment(const QCString &fileName,bool isMacro,
790797
else if (pc=='/' && c=='/') // skip single line comment
791798
{
792799
while ((c=*p++)!='\n' && c!=0);
793-
if (c=='\n') lineNr++,col=0;
800+
if (c == '\n')
801+
{
802+
lineNr++;
803+
col = 0;
804+
}
794805
}
795806
else if (pc=='/' && c=='*') // skip C style comment
796807
{
797808
while (((c=*p++)!='/' || pc!='*') && c!=0)
798809
{
799-
if (c=='\n') lineNr++,col=0;
810+
if (c == '\n')
811+
{
812+
lineNr++;
813+
col = 0;
814+
}
800815
pc=c;
801816
}
802817
}

0 commit comments

Comments
 (0)