Skip to content

Commit 89dd9a8

Browse files
committed
[clang-tidy] convert member functions to static
Found with readability-convert-member-functions-to-static Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 parent dccee23 commit 89dd9a8

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

include/yaml-cpp/emitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class YAML_CPP_API Emitter {
123123
void SpaceOrIndentTo(bool requireSpace, std::size_t indent);
124124

125125
const char* ComputeFullBoolName(bool b) const;
126-
bool CanEmitNewline() const;
126+
static bool CanEmitNewline();
127127

128128
private:
129129
std::unique_ptr<EmitterState> m_pState;

src/emitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void Emitter::EmitNewline() {
251251
m_pState->SetNonContent();
252252
}
253253

254-
bool Emitter::CanEmitNewline() const { return true; }
254+
bool Emitter::CanEmitNewline() { return true; }
255255

256256
// Put the stream in a state so we can simply write the next node
257257
// E.g., if we're in a sequence, write the "- "

src/scanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Token* Scanner::PushToken(Token::TYPE type) {
269269
return &m_tokens.back();
270270
}
271271

272-
Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) const {
272+
Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
273273
switch (type) {
274274
case IndentMarker::SEQ:
275275
return Token::BLOCK_SEQ_START;

src/scanner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Scanner {
9090
bool InBlockContext() const { return m_flows.empty(); }
9191
std::size_t GetFlowLevel() const { return m_flows.size(); }
9292

93-
Token::TYPE GetStartTokenFor(IndentMarker::INDENT_TYPE type) const;
93+
static Token::TYPE GetStartTokenFor(IndentMarker::INDENT_TYPE type);
9494

9595
/**
9696
* Pushes an indentation onto the stack, and enqueues the proper token
@@ -131,7 +131,7 @@ class Scanner {
131131
*/
132132
void ThrowParserException(const std::string &msg) const;
133133

134-
bool IsWhitespaceToBeEaten(char ch);
134+
static bool IsWhitespaceToBeEaten(char ch);
135135

136136
/**
137137
* Returns the appropriate regex to check if the next token is a value token.

0 commit comments

Comments
 (0)