Skip to content

Commit

Permalink
removed unused stream-related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jul 15, 2024
1 parent 8e6ddf8 commit 4664ac4
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 @@ -618,18 +618,6 @@ unsigned int CppCheck::checkBuffer(const FileWithDetails &file, const std::strin
});
}

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

unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string &cfgname)
{
return checkInternal(file, cfgname,
Expand Down
10 changes: 0 additions & 10 deletions lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,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 file the file
* @param cfgname cfg name
* @param fileStream stream the file content can be read from
* @return number of errors found
*/
unsigned int checkStream(const FileWithDetails& file, const std::string &cfgname, std::istream& fileStream);


/**
* @brief Check a file
* @param file the file
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 4664ac4

Please sign in to comment.