summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-11-24 14:56:52 +0100
committerKnoll Lars <lars.knoll@nokia.com>2011-11-25 12:54:14 +0100
commite6f0fe0a01325c57c85c72debd41216d15e22808 (patch)
treed8a44cd6e029567d28d30c4947fbd46d5a5cf246
parentb98703ca4720f82eaa0b6c2b3ab9e3477de04929 (diff)
Fix some compiler warnings
Change-Id: Ief5bd4b4d25de77c4dfea27231da77c33fe1919c Reviewed-by: Knoll Lars <lars.knoll@nokia.com>
-rw-r--r--src/qbinaryjson_p.h8
-rw-r--r--src/qbinaryjsonarray.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/qbinaryjson_p.h b/src/qbinaryjson_p.h
index 494d7d7..8dee092 100644
--- a/src/qbinaryjson_p.h
+++ b/src/qbinaryjson_p.h
@@ -147,14 +147,14 @@ struct Base
void reserveSpace(uint dataSize, int posInTable, uint numItems)
{
- Q_ASSERT(posInTable >= 0 && posInTable <= length);
+ Q_ASSERT(posInTable >= 0 && posInTable <= (int)length);
offset off = tableOffset;
// move table to new position
memmove((char *)(table() + posInTable + numItems) + dataSize, table() + posInTable, (length - posInTable)*sizeof(offset));
memmove((char *)(table()) + dataSize, table(), posInTable*sizeof(offset));
tableOffset += dataSize;
- for (int i = 0; i < numItems; ++i)
+ for (int i = 0; i < (int)numItems; ++i)
table()[posInTable + i] = off;
length += numItems;
size += dataSize + numItems * sizeof(offset);
@@ -162,8 +162,8 @@ struct Base
void removeItems(int pos, int numItems)
{
- Q_ASSERT(pos >= 0 && pos <= length);
- if (pos + numItems < length)
+ Q_ASSERT(pos >= 0 && pos <= (int)length);
+ if (pos + numItems < (int)length)
memmove(table() + pos, table() + pos + numItems, (length - pos - numItems)*sizeof(offset));
length -= numItems;
}
diff --git a/src/qbinaryjsonarray.cpp b/src/qbinaryjsonarray.cpp
index a676652..86c0938 100644
--- a/src/qbinaryjsonarray.cpp
+++ b/src/qbinaryjsonarray.cpp
@@ -167,7 +167,7 @@ bool JsonArray::operator==(const JsonArray &other) const
if (a->length != other.a->length)
return false;
- for (int i = 0; i < a->length; ++i) {
+ for (int i = 0; i < (int)a->length; ++i) {
if (d->toValue(a->at(i)) != other.d->toValue(other.a->at(i)))
return false;
}