Fix warnings about signed/unsigned comparisons in QtJson.

Change-Id: I92071ea870bf0ebb740fcb360aff19658380a0cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Friedemann Kleint 2012-04-03 09:40:36 +02:00 committed by Qt by Nokia
parent fd4f165eb7
commit 3a9c06b7bd
2 changed files with 5 additions and 5 deletions

View File

@ -275,7 +275,7 @@ void QJsonArray::removeAt(int i)
detach();
a->removeItems(i, 1);
++d->compactionCounter;
if (d->compactionCounter > 32 && d->compactionCounter >= (int)a->length/2)
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(a->length) / 2u)
compact();
}
@ -379,7 +379,7 @@ void QJsonArray::replace(int i, const QJsonValue &value)
QJsonPrivate::Value::copyData(value, (char *)a + valueOffset, compressed);
++d->compactionCounter;
if (d->compactionCounter > 32 && d->compactionCounter >= (int)a->length/2)
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(a->length) / 2u)
compact();
}

View File

@ -335,7 +335,7 @@ void QJsonObject::remove(const QString &key)
detach();
o->removeItems(index, 1);
++d->compactionCounter;
if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2)
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
compact();
}
@ -361,7 +361,7 @@ QJsonValue QJsonObject::take(const QString &key)
QJsonPrivate::Entry *e = o->entryAt(index);
o->removeItems(index, 1);
++d->compactionCounter;
if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2)
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
compact();
return QJsonValue(d, o, e->value);
@ -432,7 +432,7 @@ QJsonObject::iterator QJsonObject::erase(QJsonObject::iterator it)
o->removeItems(index, 1);
++d->compactionCounter;
if (d->compactionCounter > 32 && d->compactionCounter >= (int)o->length/2)
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
compact();
// iterator hasn't changed