From 0e1601b80de3c69cf49894d58840856f2077731b Mon Sep 17 00:00:00 2001 From: Chris Pickett Date: Tue, 5 Jan 2016 10:58:21 -0600 Subject: [PATCH 1/2] Fixed compile warning with VS2012 flatbuffers\src\idl_parser.cpp(1525): warning C4127: conditional expression is constant flatbuffers\src\idl_parser.cpp(1546): warning C4127: conditional expression is constant --- src/idl_parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index b533d213e..005040a68 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -1522,7 +1522,7 @@ CheckedError Parser::SkipJsonObject() { EXPECT('{'); size_t fieldn = 0; - while (true) { + for (;;) { if ((!opts.strict_json || !fieldn) && Is('}')) break; if (!Is(kTokenStringConstant)) @@ -1543,7 +1543,7 @@ CheckedError Parser::SkipJsonObject() { CheckedError Parser::SkipJsonArray() { EXPECT('['); - while (true) { + for (;;) { if (Is(']')) break; ECHECK(SkipAnyJsonValue()); From e0b2f81885b09ffba4ec89bfd2c9796d3be01865 Mon Sep 17 00:00:00 2001 From: Chris Pickett Date: Tue, 5 Jan 2016 10:58:40 -0600 Subject: [PATCH 2/2] Fixed compile warning with VS2012 flatbuffers\src\idl_parser.cpp(1516): warning C4244: 'argument' : conversion from 'int' to 'char', possible loss of data --- src/idl_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 005040a68..31af4738c 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -1513,7 +1513,7 @@ CheckedError Parser::SkipAnyJsonValue() { EXPECT(kTokenFloatConstant); break; default: - return Error(std::string("Unexpected token:") + std::string(1, token_)); + return Error(std::string("Unexpected token:") + std::string(1, static_cast(token_))); } return NoError(); }