| 630 | } |
| 631 | |
| 632 | void SuppressionList::markUnmatchedInlineSuppressionsAsChecked(const TokenList &tokenlist) { |
| 633 | std::lock_guard<std::mutex> lg(mSuppressionsSync); |
| 634 | |
| 635 | int currLineNr = -1; |
| 636 | int currFileIdx = -1; |
| 637 | for (const Token *tok = tokenlist.front(); tok; tok = tok->next()) { |
| 638 | if (currFileIdx != tok->fileIndex() || currLineNr != tok->linenr()) { |
| 639 | currLineNr = tok->linenr(); |
| 640 | currFileIdx = tok->fileIndex(); |
| 641 | for (auto &suppression : mSuppressions) { |
| 642 | if (suppression.type == SuppressionList::Type::unique) { |
| 643 | if (!suppression.checked && (suppression.lineNumber == currLineNr) && (suppression.fileName == tokenlist.file(tok))) { |
| 644 | suppression.checked = true; |
| 645 | } |
| 646 | } else if (suppression.type == SuppressionList::Type::block) { |
| 647 | if ((!suppression.checked && (suppression.lineBegin <= currLineNr) && (suppression.lineEnd >= currLineNr) && (suppression.fileName == tokenlist.file(tok)))) { |
| 648 | suppression.checked = true; |
| 649 | } |
| 650 | } else if (!suppression.checked && suppression.fileName == tokenlist.file(tok)) { |
| 651 | suppression.checked = true; |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | std::string SuppressionList::Suppression::toString() const |
| 659 | { |
no test coverage detected