Unused function check: Fix detection of func.usedOtherFile

Check if function is called from another file or not.
This commit is contained in:
Thomas Jarosch 2015-01-07 08:32:49 +01:00
parent fd9134fe5b
commit 4bec2b58fd
1 changed files with 2 additions and 1 deletions

View File

@ -196,8 +196,9 @@ 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();
if (func.filename.empty() || func.filename == "+")
if (func.filename.empty() || func.filename == "+" || func.filename != called_from_file)
func.usedOtherFile = true;
else
func.usedSameFile = true;