diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-05 16:20:16 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-05 16:47:22 (GMT) |
commit | 6134cffd3f2795d789087b037666ba8265f3b7f2 (patch) | |
tree | 5ff18fe0365a4681f51897b916cd196d6c46fbc9 /src | |
parent | 7b63ce043dfaec5ec83d938b1cea8ee0ead614ff (diff) | |
download | Qt-6134cffd3f2795d789087b037666ba8265f3b7f2.zip Qt-6134cffd3f2795d789087b037666ba8265f3b7f2.tar.gz Qt-6134cffd3f2795d789087b037666ba8265f3b7f2.tar.bz2 |
Silence warning in qvector with MSVC
Conversion from size_t to int loose precision
Reviewed-by: Robin Burchell
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qvector.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 4044a66..0f7db88 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -304,7 +304,7 @@ public: #ifndef QT_NO_STL static inline QVector<T> fromStdVector(const std::vector<T> &vector) - { QVector<T> tmp; tmp.reserve(vector.size()); qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } + { QVector<T> tmp; tmp.reserve(int(vector.size())); qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } inline std::vector<T> toStdVector() const { std::vector<T> tmp; tmp.reserve(size()); qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } #endif @@ -440,9 +440,9 @@ QVector<T>::QVector(int asize, const T &t) template <typename T> QVector<T>::QVector(std::initializer_list<T> args) { - d = malloc(args.size()); + d = malloc(int(args.size())); d->ref = 1; - d->alloc = d->size = args.size(); + d->alloc = d->size = int(args.size()); d->sharable = true; d->capacity = false; T* i = p->array + d->size; |