Skip to content

Commit

Permalink
Revert "Fix compile warning with -Wshadow"
Browse files Browse the repository at this point in the history
This reverts commit 1f5e971.

See #1306; the previous commit caused an error with -Wpedantic:

yaml-cpp/include/yaml-cpp/emitterstyle.h:13:2: error: extra ‘;’ [-Wpedantic]

Since the original commit was to resolve warnings, reverting and the OP can produce a new one that fixes this issue.
  • Loading branch information
jbeder committed Aug 5, 2024
1 parent 1f5e971 commit 04dddd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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 {
namespace EmitterStyle {
enum value { Default, Block, Flow };
struct 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 {
namespace NodeType {
enum value { Undefined, Null, Scalar, Sequence, Map };
struct NodeType {
enum value { Undefined, Null, Scalar, Sequence, Map };
};
}

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

Expand Down Expand Up @@ -92,8 +93,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

0 comments on commit 04dddd6

Please sign in to comment.