Refactoring SymbolDatabase::findFunction

This commit is contained in:
Daniel Marjamäki 2019-08-01 16:14:00 +02:00
parent 7965ac5858
commit 25a13d061c
1 changed files with 2 additions and 12 deletions

View File

@ -4245,18 +4245,8 @@ const Function* Scope::findFunction(const Token *tok, bool requireConst) const
}
}
// check for a match with a string literal
else if (Token::Match(arguments[j], "%str%")) {
ValueType::MatchResult res = ValueType::matchParameter(arguments[j]->valueType(), funcarg->valueType());
if (res == ValueType::MatchResult::SAME)
++same;
else if (res == ValueType::MatchResult::FALLBACK1)
++fallback1;
else if (res == ValueType::MatchResult::FALLBACK2)
++fallback2;
else if (funcarg->isStlStringType())
fallback1++;
}
else if (funcarg->isStlStringType() && arguments[j]->valueType() && arguments[j]->valueType()->pointer == 1 && arguments[j]->valueType()->type == ValueType::Type::CHAR)
fallback1++;
// check for a match with nullptr
else if (funcarg->isPointer() && Token::Match(arguments[j], "nullptr|NULL ,|)")) {