From d0a9f3d98d3e642d6df166c7515078237d2950b1 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Mon, 2 May 2011 09:54:49 +0000 Subject: [PATCH] Bug #3200841: removed "warning C4127: conditional expression is constant" concerning infinite loop by replacing while (true) with for (;;). --- src/lib_json/json_reader.cpp | 4 ++-- src/lib_json/json_writer.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 7c594e2..49d9d29 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -519,7 +519,7 @@ Reader::readArray( Token &tokenStart ) return true; } int index = 0; - while ( true ) + for (;;) { Value &value = currentValue()[ index++ ]; nodes_.push( &value ); @@ -762,7 +762,7 @@ Reader::recoverFromError( TokenType skipUntilToken ) { int errorCount = int(errors_.size()); Token skip; - while ( true ) + for (;;) { if ( !readToken(skip) ) errors_.resize( errorCount ); // discard errors caused by recovery diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 8c4c180..d777c15 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -332,7 +332,7 @@ StyledWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - while ( true ) + for (;;) { const std::string &name = *it; const Value &childValue = value[name]; @@ -372,7 +372,7 @@ StyledWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - while ( true ) + for (;;) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); @@ -608,7 +608,7 @@ StyledStreamWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - while ( true ) + for (;;) { const std::string &name = *it; const Value &childValue = value[name]; @@ -648,7 +648,7 @@ StyledStreamWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - while ( true ) + for (;;) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue );