Fixed compile warning with VS2012
authorChris Pickett <github@parnic.com>
Tue, 5 Jan 2016 16:58:21 +0000 (10:58 -0600)
committerChris Pickett <github@parnic.com>
Tue, 5 Jan 2016 16:58:21 +0000 (10:58 -0600)
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

index b533d21..005040a 100644 (file)
@@ -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());