Skip to content

Commit

Permalink
Fix compile warning with -Wshadow
Browse files Browse the repository at this point in the history
  • Loading branch information
RonsonNamek authored and jbeder committed Aug 5, 2024
1 parent b11eaf1 commit 1f5e971
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/yaml-cpp/emitterstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#endif

namespace YAML {
struct EmitterStyle {
enum value { Default, Block, Flow };
namespace EmitterStyle {
enum value { Default, Block, Flow };
};
}

Expand Down
4 changes: 2 additions & 2 deletions include/yaml-cpp/node/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#endif

namespace YAML {
struct NodeType {
enum value { Undefined, Null, Scalar, Sequence, Map };
namespace NodeType {
enum value { Undefined, Null, Scalar, Sequence, Map };
};
}

Expand Down
5 changes: 2 additions & 3 deletions src/singledocparser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <algorithm>
#include <cstdio>
#include <sstream>

Expand Down Expand Up @@ -93,8 +92,8 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
// add non-specific tags
if (tag.empty())
tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
if (token.type == Token::PLAIN_SCALAR

if (token.type == Token::PLAIN_SCALAR
&& tag.compare("?") == 0 && IsNullString(token.value)) {
eventHandler.OnNull(mark, anchor);
m_scanner.pop();
Expand Down

1 comment on commit 1f5e971

@jbeder
Copy link
Owner

@jbeder jbeder commented on 1f5e971 Aug 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted because of #1306.

Please sign in to comment.