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

Method getHash

test/testpreprocessor.cpp:407–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406 template<size_t size>
407 std::size_t getHash(const char (&code)[size]) {
408 std::vector<std::string> files;
409 simplecpp::TokenList tokens(code,files,"test.c");
410 Preprocessor preprocessor(tokens, settingsDefault, *this, Standards::Language::C); // TODO: do we need to consider #file?
411 ASSERT(preprocessor.loadFiles(files));
412 preprocessor.removeComments();
413 return preprocessor.calculateHash("");
414 }
415
416 void Bug2190219() {
417 const char filedata[] = "#ifdef __cplusplus\n"

Callers

nothing calls this directly

Calls 3

loadFilesMethod · 0.80
removeCommentsMethod · 0.45
calculateHashMethod · 0.45

Tested by

no test coverage detected