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

Method hasIfdef

lib/tokenize.cpp:11270–11280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11268}
11269
11270bool Tokenizer::hasIfdef(const Token *start, const Token *end) const
11271{
11272 const auto& directives = mDirectives;
11273 return std::any_of(directives.cbegin(), directives.cend(), [&](const Directive& d) {
11274 return startsWith(d.str, "#if") &&
11275 d.linenr >= start->linenr() &&
11276 d.linenr <= end->linenr() &&
11277 start->fileIndex() < list.getFiles().size() &&
11278 d.file == list.getFiles()[start->fileIndex()];
11279 });
11280}
11281
11282bool Tokenizer::isPacked(const Token * bodyStart) const
11283{

Callers 5

checkBadBitmaskCheckMethod · 0.80
multiCondition2Method · 0.80
checkVariableScopeMethod · 0.80
checkUnusedLabelMethod · 0.80
checkConstFuncMethod · 0.80

Calls 3

fileIndexMethod · 0.80
startsWithFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected