Skip to content

Commit 71bec71

Browse files
committed
Fix clang-tidy issues
1 parent 1ba4b70 commit 71bec71

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

lib/cppcheck.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,13 +1977,15 @@ bool CppCheck::isPremiumCodingStandardId(const std::string& id) const {
19771977
return false;
19781978
}
19791979

1980-
std::string CppCheck::getDumpFileContentsRawTokens(const std::vector<std::string>& files, const simplecpp::TokenList& tokens1) const {
1980+
std::string CppCheck::getDumpFileContentsRawTokens(const std::vector<std::string>& files, const simplecpp::TokenList& tokens1) const
1981+
{
19811982
std::string header = getDumpFileContentsRawTokensHeader(files);
19821983
std::string footer = getDumpFileContentsRawTokensFooter(tokens1);
19831984
return getDumpFileContentsRawTokens(header, footer);
19841985
}
19851986

1986-
std::string CppCheck::getDumpFileContentsRawTokens(const std::string& header, const std::string& footer) const {
1987+
std::string CppCheck::getDumpFileContentsRawTokens(const std::string& header, const std::string& footer)
1988+
{
19871989
std::string dumpProlog;
19881990
dumpProlog += " <rawtokens>\n";
19891991
dumpProlog += header;
@@ -1992,7 +1994,8 @@ std::string CppCheck::getDumpFileContentsRawTokens(const std::string& header, co
19921994
return dumpProlog;
19931995
}
19941996

1995-
std::string CppCheck::getDumpFileContentsRawTokensHeader(const std::vector<std::string>& files) const {
1997+
std::string CppCheck::getDumpFileContentsRawTokensHeader(const std::vector<std::string>& files) const
1998+
{
19961999
std::string dumpProlog;
19972000
for (unsigned int i = 0; i < files.size(); ++i) {
19982001
dumpProlog += " <file index=\"";
@@ -2004,7 +2007,8 @@ std::string CppCheck::getDumpFileContentsRawTokensHeader(const std::vector<std::
20042007
return dumpProlog;
20052008
}
20062009

2007-
std::string CppCheck::getDumpFileContentsRawTokensFooter(const simplecpp::TokenList& tokens1) const {
2010+
std::string CppCheck::getDumpFileContentsRawTokensFooter(const simplecpp::TokenList& tokens1)
2011+
{
20082012
std::string dumpProlog;
20092013
for (const simplecpp::Token* tok = tokens1.cfront(); tok; tok = tok->next) {
20102014
dumpProlog += " <tok ";

lib/cppcheck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ class CPPCHECKLIB CppCheck {
154154
* @brief Get dumpfile <rawtokens> contents, this is only public for testing purposes
155155
*/
156156
std::string getDumpFileContentsRawTokens(const std::vector<std::string>& files, const simplecpp::TokenList& tokens1) const;
157-
std::string getDumpFileContentsRawTokens(const std::string& header, const std::string& footer) const;
157+
static std::string getDumpFileContentsRawTokens(const std::string& header, const std::string& footer);
158158
std::string getDumpFileContentsRawTokensHeader(const std::vector<std::string>& files) const;
159-
std::string getDumpFileContentsRawTokensFooter(const simplecpp::TokenList& tokens1) const;
159+
static std::string getDumpFileContentsRawTokensFooter(const simplecpp::TokenList& tokens1);
160160

161161
std::string getLibraryDumpData() const;
162162

test/testtokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ class TestTokenizer : public TestFixture {
583583
const simplecpp::TokenList tokens1(code, files, filename, &outputList);
584584
Preprocessor preprocessor(settings, *this, Path::identify(tokens1.getFiles()[0], false));
585585
std::list<Directive> directives;
586-
preprocessor.createDirectives(tokens1, directives);
586+
Preprocessor::createDirectives(tokens1, directives);
587587

588588
TokenList tokenlist{settings, Path::identify(filename, false)};
589589
Tokenizer tokenizer(std::move(tokenlist), *this);

0 commit comments

Comments
 (0)