Fixed some cppcheck messages

This commit is contained in:
PKEuS 2015-01-28 22:29:07 +01:00
parent 3342ea4c54
commit 8225b12763
3 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
unusedPrivateFunction:test/testcmdlineparser.cpp
redundantNextPrevious:test/testtoken.cpp
simplePatternError:test/testtoken.cpp
uselessAssignmentPtrArg:build/checkstl.cpp
uselessAssignmentPtrArg:build/tokenize.cpp
variableScope:test/testtokenize.cpp

View File

@ -353,7 +353,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
}
// unknown control.. (TODO: handle loops)
else if ((Token::Match(tok, "%type% (") && Token::simpleMatch(tok->linkAt(1), ") {")) || Token::Match(tok, "do {")) {
else if ((Token::Match(tok, "%type% (") && Token::simpleMatch(tok->linkAt(1), ") {")) || Token::simpleMatch(tok, "do {")) {
varInfo->clear();
break;
}

View File

@ -196,7 +196,7 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer, const char Fi
if (funcname) {
FunctionUsage &func = _functions[ funcname->str()];
const std::string called_from_file = tokenizer.list.getSourceFilePath();
const std::string& called_from_file = tokenizer.list.getSourceFilePath();
if (func.filename.empty() || func.filename == "+" || func.filename != called_from_file)
func.usedOtherFile = true;