Fix some warnings from clang
One of them was a real error, that could lead to Data::alloc containing wrong values. Change-Id: I48315ef6fd59188630107ebbe7bf8dbaa5da689e Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>bb10
parent
15f253a46a
commit
bd8ef8d073
|
|
@ -127,7 +127,7 @@ void Data::compact()
|
|||
|
||||
free(header);
|
||||
header = h;
|
||||
alloc = alloc;
|
||||
this->alloc = alloc;
|
||||
compactionCounter = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ void QJsonArray::prepend(const QJsonValue &value)
|
|||
*/
|
||||
void QJsonArray::append(const QJsonValue &value)
|
||||
{
|
||||
insert(a ? a->length : 0, value);
|
||||
insert(a ? (int)a->length : 0, value);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -330,7 +330,7 @@ QJsonValue QJsonArray::takeAt(int i)
|
|||
*/
|
||||
void QJsonArray::insert(int i, const QJsonValue &value)
|
||||
{
|
||||
Q_ASSERT (i >= 0 && i <= (int)(a ? a->length : 0));
|
||||
Q_ASSERT (i >= 0 && i <= (a ? (int)a->length : 0));
|
||||
|
||||
bool compressed;
|
||||
int valueSize = QJsonPrivate::Value::requiredStorage(value, &compressed);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ static void objectContentToJson(const QJsonPrivate::Object *o, QByteArray &json,
|
|||
|
||||
void Writer::objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact)
|
||||
{
|
||||
json.reserve(json.size() + (o ? o->size : 16));
|
||||
json.reserve(json.size() + (o ? (int)o->size : 16));
|
||||
json += compact ? "{" : "{\n";
|
||||
objectContentToJson(o, json, indent + (compact ? 0 : 1), compact);
|
||||
json += QByteArray(4*indent, ' ');
|
||||
|
|
@ -270,7 +270,7 @@ void Writer::objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int i
|
|||
|
||||
void Writer::arrayToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact)
|
||||
{
|
||||
json.reserve(json.size() + (a ? a->size : 16));
|
||||
json.reserve(json.size() + (a ? (int)a->size : 16));
|
||||
json += compact ? "[" : "[\n";
|
||||
arrayContentToJson(a, json, indent + (compact ? 0 : 1), compact);
|
||||
json += QByteArray(4*indent, ' ');
|
||||
|
|
|
|||
Loading…
Reference in New Issue