diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-05-31 16:48:22 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 03:15:46 +0200 |
commit | cd91f1cc1011c23104995021b578e45d307be98e (patch) | |
tree | dab267a713f10d8479a31f1e2e5a010fe6d5021f | |
parent | 7b737b172d0a1cd23d8edd2d5d00615d64ad3c69 (diff) |
Get rid of MSVC compiler warnings from QVector code
Change-Id: I39b849721f3ba790c4a9197d69ac48e98cc2f5bd
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rw-r--r-- | src/corelib/tools/qvector.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 2e98fcedca..581d8711db 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -298,6 +298,10 @@ private: class AlignmentDummy { Data header; T array[1]; }; }; +#ifdef Q_CC_MSVC +# pragma warning ( disable : 4345 ) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized +#endif + template <typename T> void QVector<T>::defaultConstruct(T *from, T *to) { @@ -310,6 +314,10 @@ void QVector<T>::defaultConstruct(T *from, T *to) } } +#ifdef Q_CC_MSVC +# pragma warning ( default: 4345 ) +#endif + template <typename T> void QVector<T>::copyConstruct(T *srcFrom, T *srcTo, T *dstFrom) { @@ -569,10 +577,10 @@ void QVector<T>::realloc(const int asize, const int aalloc, QArrayData::Allocati } Q_ASSERT(d->data()); - Q_ASSERT(d->size <= d->alloc); + Q_ASSERT(uint(d->size) <= d->alloc); Q_ASSERT(d != Data::unsharableEmpty()); Q_ASSERT(aalloc ? d != Data::sharedNull() : d == Data::sharedNull()); - Q_ASSERT(d->alloc >= aalloc); + Q_ASSERT(d->alloc >= uint(aalloc)); Q_ASSERT(d->size == asize); } |