QtCore: Fix MSVC 64bit warnings about conversion from size_t to int.
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data Change-Id: I9be380cbb7bed4cd95515074c7cad7e41a511dc9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
parent
356838cd7d
commit
ca4b9f624a
@ -889,11 +889,11 @@ struct ContainerAPI<QVector<T> > : CapabilitiesImpl<QVector<T> >
|
||||
|
||||
template<typename T>
|
||||
struct ContainerAPI<std::vector<T> > : CapabilitiesImpl<std::vector<T> >
|
||||
{ static int size(const std::vector<T> *t) { return t->size(); } };
|
||||
{ static int size(const std::vector<T> *t) { return int(t->size()); } };
|
||||
|
||||
template<typename T>
|
||||
struct ContainerAPI<std::list<T> > : CapabilitiesImpl<std::list<T> >
|
||||
{ static int size(const std::list<T> *t) { return t->size(); } };
|
||||
{ static int size(const std::list<T> *t) { return int(t->size()); } };
|
||||
|
||||
class QSequentialIterableImpl
|
||||
{
|
||||
|
@ -297,7 +297,7 @@ public:
|
||||
inline QHash(std::initializer_list<std::pair<Key,T> > list)
|
||||
: d(const_cast<QHashData *>(&QHashData::shared_null))
|
||||
{
|
||||
reserve(list.size());
|
||||
reserve(int(list.size()));
|
||||
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
insert(it->first, it->second);
|
||||
}
|
||||
@ -973,7 +973,7 @@ public:
|
||||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||
inline QMultiHash(std::initializer_list<std::pair<Key,T> > list)
|
||||
{
|
||||
this->reserve(list.size());
|
||||
this->reserve(int(list.size()));
|
||||
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
insert(it->first, it->second);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||
inline QSet(std::initializer_list<T> list)
|
||||
{
|
||||
reserve(list.size());
|
||||
reserve(int(list.size()));
|
||||
for (typename std::initializer_list<T>::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
insert(*it);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user