MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / updateFunctionData

Method updateFunctionData

lib/checkunusedfunctions.cpp:508–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void CheckUnusedFunctions::updateFunctionData(const CheckUnusedFunctions& checkUnusedFunctions)
509{
510 for (const auto& entry : checkUnusedFunctions.mFunctions)
511 {
512 FunctionUsage &usage = mFunctions[entry.first];
513 if (!usage.lineNumber) {
514 usage.lineNumber = entry.second.lineNumber;
515 usage.column = entry.second.column;
516 }
517 // TODO: why always overwrite this but not the filename and line?
518 usage.fileIndex = entry.second.fileIndex;
519 if (usage.filename.empty())
520 usage.filename = entry.second.filename;
521 usage.usedOtherFile |= entry.second.usedOtherFile;
522 usage.usedSameFile |= entry.second.usedSameFile;
523 }
524 mFunctionDecl.insert(mFunctionDecl.cend(), checkUnusedFunctions.mFunctionDecl.cbegin(), checkUnusedFunctions.mFunctionDecl.cend());
525 mFunctionCalls.insert(checkUnusedFunctions.mFunctionCalls.cbegin(), checkUnusedFunctions.mFunctionCalls.cend());
526}

Callers 1

checkMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected