Fix warnings about signed/unsigned comparisons in QtJson.
Change-Id: I92071ea870bf0ebb740fcb360aff19658380a0cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fd4f165eb7
commit
3a9c06b7bd
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user