mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-08 01:24:57 +02:00
Bug #3200841: removed "warning C4127: conditional expression is constant" concerning infinite loop by replacing while (true) with for (;;).
This commit is contained in:
parent
7953a801c1
commit
d0a9f3d98d
@ -519,7 +519,7 @@ Reader::readArray( Token &tokenStart )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
Value &value = currentValue()[ index++ ];
|
Value &value = currentValue()[ index++ ];
|
||||||
nodes_.push( &value );
|
nodes_.push( &value );
|
||||||
@ -762,7 +762,7 @@ Reader::recoverFromError( TokenType skipUntilToken )
|
|||||||
{
|
{
|
||||||
int errorCount = int(errors_.size());
|
int errorCount = int(errors_.size());
|
||||||
Token skip;
|
Token skip;
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
if ( !readToken(skip) )
|
if ( !readToken(skip) )
|
||||||
errors_.resize( errorCount ); // discard errors caused by recovery
|
errors_.resize( errorCount ); // discard errors caused by recovery
|
||||||
|
@ -332,7 +332,7 @@ StyledWriter::writeValue( const Value &value )
|
|||||||
writeWithIndent( "{" );
|
writeWithIndent( "{" );
|
||||||
indent();
|
indent();
|
||||||
Value::Members::iterator it = members.begin();
|
Value::Members::iterator it = members.begin();
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
const std::string &name = *it;
|
const std::string &name = *it;
|
||||||
const Value &childValue = value[name];
|
const Value &childValue = value[name];
|
||||||
@ -372,7 +372,7 @@ StyledWriter::writeArrayValue( const Value &value )
|
|||||||
indent();
|
indent();
|
||||||
bool hasChildValue = !childValues_.empty();
|
bool hasChildValue = !childValues_.empty();
|
||||||
unsigned index =0;
|
unsigned index =0;
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
const Value &childValue = value[index];
|
const Value &childValue = value[index];
|
||||||
writeCommentBeforeValue( childValue );
|
writeCommentBeforeValue( childValue );
|
||||||
@ -608,7 +608,7 @@ StyledStreamWriter::writeValue( const Value &value )
|
|||||||
writeWithIndent( "{" );
|
writeWithIndent( "{" );
|
||||||
indent();
|
indent();
|
||||||
Value::Members::iterator it = members.begin();
|
Value::Members::iterator it = members.begin();
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
const std::string &name = *it;
|
const std::string &name = *it;
|
||||||
const Value &childValue = value[name];
|
const Value &childValue = value[name];
|
||||||
@ -648,7 +648,7 @@ StyledStreamWriter::writeArrayValue( const Value &value )
|
|||||||
indent();
|
indent();
|
||||||
bool hasChildValue = !childValues_.empty();
|
bool hasChildValue = !childValues_.empty();
|
||||||
unsigned index =0;
|
unsigned index =0;
|
||||||
while ( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
const Value &childValue = value[index];
|
const Value &childValue = value[index];
|
||||||
writeCommentBeforeValue( childValue );
|
writeCommentBeforeValue( childValue );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user