Travis: Fixed Cppcheck warnings (related to #4547)
This commit is contained in:
parent
5144307642
commit
d9de7f7052
|
@ -670,14 +670,15 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec()
|
||||||
// count { and } using tok2
|
// count { and } using tok2
|
||||||
const Token* const end2 = tok1->scope()->classEnd;
|
const Token* const end2 = tok1->scope()->classEnd;
|
||||||
for (const Token *tok2 = tok1->tokAt(3); tok2 != end2; tok2 = tok2->next()) {
|
for (const Token *tok2 = tok1->tokAt(3); tok2 != end2; tok2 = tok2->next()) {
|
||||||
bool unknown = false;
|
|
||||||
|
|
||||||
// label / ?:
|
// label / ?:
|
||||||
if (tok2->str() == ":")
|
if (tok2->str() == ":")
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// function call..
|
// function call..
|
||||||
else if (Token::Match(tok2, "[;{}] %var% (") && CanFunctionAssignPointer(tok2->next(), varid1, unknown)) {
|
else {
|
||||||
|
bool unknown = false;
|
||||||
|
if (Token::Match(tok2, "[;{}] %var% (") && CanFunctionAssignPointer(tok2->next(), varid1, unknown)) {
|
||||||
if (!_settings->inconclusive || !unknown)
|
if (!_settings->inconclusive || !unknown)
|
||||||
break;
|
break;
|
||||||
inconclusive = true;
|
inconclusive = true;
|
||||||
|
@ -723,6 +724,7 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckNullPointer::nullPointerByDeRefAndChec()
|
void CheckNullPointer::nullPointerByDeRefAndChec()
|
||||||
|
|
|
@ -71,8 +71,6 @@ std::string Settings::addEnabled(const std::string &str)
|
||||||
return addEnabled(str.substr(prevPos));
|
return addEnabled(str.substr(prevPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handled = false;
|
|
||||||
|
|
||||||
static std::set<std::string> id;
|
static std::set<std::string> id;
|
||||||
if (id.empty()) {
|
if (id.empty()) {
|
||||||
id.insert("warning");
|
id.insert("warning");
|
||||||
|
@ -100,7 +98,7 @@ std::string Settings::addEnabled(const std::string &str)
|
||||||
if (str == "information") {
|
if (str == "information") {
|
||||||
_enabled.insert("missingInclude");
|
_enabled.insert("missingInclude");
|
||||||
}
|
}
|
||||||
} else if (!handled) {
|
} else {
|
||||||
if (str.empty())
|
if (str.empty())
|
||||||
return std::string("cppcheck: --enable parameter is empty");
|
return std::string("cppcheck: --enable parameter is empty");
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue