Skip to content

Commit

Permalink
removed unused stream-related functions [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed May 24, 2024
1 parent 4d3f9e0 commit 471002c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
12 changes: 0 additions & 12 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,6 @@ unsigned int CppCheck::checkBuffer(const std::string& filename, const std::strin
});
}

// cppcheck-suppress unusedFunction
unsigned int CppCheck::checkStream(const std::string& filename, const std::string &cfgname, std::istream& fileStream)
{
return checkInternal(filename, cfgname,
[&filename, &fileStream](TokenList& list) {
list.createTokens(fileStream, filename);
},
[&filename, &fileStream](std::vector<std::string>& files, simplecpp::OutputList* outputList) {
return simplecpp::TokenList{fileStream, files, filename, outputList};
});
}

unsigned int CppCheck::checkFile(const std::string& filename, const std::string &cfgname)
{
return checkInternal(filename, cfgname,
Expand Down
10 changes: 0 additions & 10 deletions lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,6 @@ class CPPCHECKLIB CppCheck : ErrorLogger {
/** @brief There has been an internal error => Report information message */
void internalError(const std::string &filename, const std::string &msg);

/**
* @brief Check a file using stream
* @param filename file name
* @param cfgname cfg name
* @param fileStream stream the file content can be read from
* @return number of errors found
*/
unsigned int checkStream(const std::string& filename, const std::string &cfgname, std::istream& fileStream);


/**
* @brief Check a file
* @param filename the file name to be read from
Expand Down
14 changes: 0 additions & 14 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,6 @@ bool TokenList::createTokens(const uint8_t* data, size_t size, const std::string

//---------------------------------------------------------------------------

bool TokenList::createTokens(std::istream &code, Standards::Language lang)
{
ASSERT_LANG(lang != Standards::Language::None);
if (mLang == Standards::Language::None) {
mLang = lang;
} else {
ASSERT_LANG(lang == mLang);
}

return createTokensInternal(code, "");
}

//---------------------------------------------------------------------------

bool TokenList::createTokens(const uint8_t* data, size_t size, Standards::Language lang)
{
ASSERT_LANG(lang != Standards::Language::None);
Expand Down
1 change: 0 additions & 1 deletion lib/tokenlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class CPPCHECKLIB TokenList {
bool createTokens(const char (&data)[size], const std::string& file0) {
return createTokens(reinterpret_cast<const uint8_t*>(data), size-1, file0);
}
bool createTokens(std::istream &code, Standards::Language lang);
bool createTokens(const uint8_t* data, size_t size, Standards::Language lang);
bool createTokens(const char* data, size_t size, Standards::Language lang) {
return createTokens(reinterpret_cast<const uint8_t*>(data), size, lang);
Expand Down

0 comments on commit 471002c

Please sign in to comment.