Skip to content

Commit

Permalink
Fix #12383: cppcheck build dir: changed line numbers in source file
Browse files Browse the repository at this point in the history
  • Loading branch information
olabetskyi committed Jun 10, 2024
1 parent 99674e1 commit 8173aa8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,13 +952,17 @@ std::size_t Preprocessor::calculateHash(const simplecpp::TokenList &tokens1, con
{
std::string hashData = toolinfo;
for (const simplecpp::Token *tok = tokens1.cfront(); tok; tok = tok->next) {
if (!tok->comment)
if (!tok->comment) {
hashData += tok->str();
hashData += tok->location.line / tok->location.col;
}
}
for (std::map<std::string, simplecpp::TokenList *>::const_iterator it = mTokenLists.cbegin(); it != mTokenLists.cend(); ++it) {
for (const simplecpp::Token *tok = it->second->cfront(); tok; tok = tok->next) {
if (!tok->comment)
if (!tok->comment) {
hashData += tok->str();
hashData += tok->location.line / tok->location.col;
}
}
}
return (std::hash<std::string>{})(hashData);
Expand Down

0 comments on commit 8173aa8

Please sign in to comment.