summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-06-07 13:51:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-08 10:29:34 +0200
commit274e571be1f5786b4db5de6e22661490f1232dc7 (patch)
treed2bb5376cf348a52376a317e1c07cd90c6d20a0b /src/corelib
parent876202ddf29ddeb9fe74063d0590b2865c226cd0 (diff)
QtCore: Fix MSVC-64 warnings about integer truncation.
warning C4267: 'argument' : conversion from 'size_t' to ' int', possible loss of data. Change-Id: I79af7497420d468b5bc7c48c9ae21b86117519a9 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qmetatype.h4
-rw-r--r--src/corelib/tools/qarraydataops.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index aed998f2e2..7413ef4d89 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -830,8 +830,8 @@ struct QMetaTypeId_ ## SMART_POINTER ## _QObjectStar<T, true> \
return id; \
const char * const cName = T::staticMetaObject.className(); \
QByteArray typeName; \
- typeName.reserve(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1); \
- typeName.append(#SMART_POINTER, sizeof(#SMART_POINTER) - 1) \
+ typeName.reserve(int(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1)); \
+ typeName.append(#SMART_POINTER, int(sizeof(#SMART_POINTER)) - 1) \
.append('<').append(cName).append('>'); \
const int newId = qRegisterNormalizedMetaType< SMART_POINTER<T> >( \
typeName, \
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 3cd8c51c07..c8a0825480 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -62,7 +62,7 @@ struct QPodArrayOps
Q_ASSERT(newSize <= this->alloc);
::memset(this->end(), 0, (newSize - this->size) * sizeof(T));
- this->size = newSize;
+ this->size = int(newSize);
}
void copyAppend(const T *b, const T *e)
@@ -84,7 +84,7 @@ struct QPodArrayOps
const T *const end = iter + n;
for (; iter != end; ++iter)
::memcpy(iter, &t, sizeof(T));
- this->size += n;
+ this->size += int(n);
}
void truncate(size_t newSize)
@@ -92,7 +92,7 @@ struct QPodArrayOps
Q_ASSERT(!this->ref.isShared());
Q_ASSERT(newSize < size_t(this->size));
- this->size = newSize;
+ this->size = int(newSize);
}
void destroyAll() // Call from destructors, ONLY!