Skip to content

Commit 6900d4f

Browse files
committed
Travis: Fixed cppcheck style warning
1 parent 4e816e2 commit 6900d4f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/cppcheck.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
402402

403403
void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &tokenizer)
404404
{
405+
(void)tokenlist;
406+
(void)tokenizer;
407+
408+
#ifdef HAVE_RULES
405409
// Are there rules to execute?
406410
bool isrule = false;
407411
for (std::list<Settings::Rule>::const_iterator it = _settings.rules.begin(); it != _settings.rules.end(); ++it) {
@@ -424,7 +428,6 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token
424428
if (rule.pattern.empty() || rule.id.empty() || rule.severity.empty() || rule.tokenlist != tokenlist)
425429
continue;
426430

427-
#ifdef HAVE_RULES
428431
const char *error = 0;
429432
int erroffset = 0;
430433
pcre *re = pcre_compile(rule.pattern.c_str(),0,&error,&erroffset,NULL);
@@ -480,8 +483,8 @@ void CppCheck::executeRules(const std::string &tokenlist, const Tokenizer &token
480483
}
481484

482485
pcre_free(re);
483-
#endif
484486
}
487+
#endif
485488
}
486489

487490
Settings &CppCheck::settings()

0 commit comments

Comments
 (0)