--check-library: improved function name output

This commit is contained in:
Daniel Marjamäki 2017-10-05 21:50:24 +02:00
parent d170b496ba
commit 13c0b4131b
2 changed files with 6 additions and 2 deletions

View File

@ -427,7 +427,7 @@ void CheckFunctions::checkLibraryMatchFunctions()
reportError(tok,
Severity::information,
"checkLibraryFunction",
"--check-library: There is no matching configuration for function " + tok->str() + "()");
"--check-library: There is no matching configuration for function " + _settings->library.getFunctionName(tok) + "()");
}
}
}

View File

@ -429,6 +429,11 @@ public:
return (it2 != platform_types.end()) ? &(it2->second) : nullptr;
}
/**
* Get function name for function call
*/
std::string getFunctionName(const Token *ftok) const;
private:
// load a <function> xml node
Error loadFunction(const tinyxml2::XMLElement * const node, const std::string &name, std::set<std::string> &unknown_elements);
@ -510,7 +515,6 @@ private:
const ArgumentChecks * getarg(const Token *ftok, int argnr) const;
std::string getFunctionName(const Token *ftok, bool *error) const;
std::string getFunctionName(const Token *ftok) const;
static const AllocFunc* getAllocDealloc(const std::map<std::string, AllocFunc> &data, const std::string &name) {
const std::map<std::string, AllocFunc>::const_iterator it = data.find(name);