summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-08-25 11:57:13 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-08-25 17:59:10 +0200
commit561e38f7998410cd91fad32d6064ff98b7bab242 (patch)
treec36a5916bca44140e5af750ae86396863bce8ff1
parent869ab57c9929c07e7465de72a609b26335da14ea (diff)
Port QSet to qsizetype
Change-Id: I70ad8fb6908ce3837a723e9a095bee5c166739e4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/corelib/tools/qset.h12
-rw-r--r--src/gui/rhi/qrhi.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index bb817ccb3c..5f1500e747 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -78,12 +78,12 @@ public:
QTypeTraits::compare_eq_result<U> operator!=(const QSet<T> &other) const
{ return q_hash != other.q_hash; }
- inline int size() const { return q_hash.size(); }
+ inline qsizetype size() const { return q_hash.size(); }
inline bool isEmpty() const { return q_hash.isEmpty(); }
- inline int capacity() const { return q_hash.capacity(); }
- inline void reserve(int size);
+ inline qsizetype capacity() const { return q_hash.capacity(); }
+ inline void reserve(qsizetype size);
inline void squeeze() { q_hash.squeeze(); }
inline void detach() { q_hash.detach(); }
@@ -176,7 +176,7 @@ public:
// more Qt
typedef iterator Iterator;
typedef const_iterator ConstIterator;
- inline int count() const { return q_hash.count(); }
+ inline qsizetype count() const { return q_hash.count(); }
inline iterator insert(const T &value)
{ return static_cast<typename Hash::iterator>(q_hash.insert(value, QHashDummyValue())); }
iterator find(const T &value) { return q_hash.find(value); }
@@ -195,7 +195,7 @@ public:
typedef value_type &reference;
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- typedef int size_type;
+ typedef qsizetype size_type;
inline bool empty() const { return isEmpty(); }
// comfort
@@ -241,7 +241,7 @@ noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed)))
// inline function implementations
template <class T>
-Q_INLINE_TEMPLATE void QSet<T>::reserve(int asize) { q_hash.reserve(asize); }
+Q_INLINE_TEMPLATE void QSet<T>::reserve(qsizetype asize) { q_hash.reserve(asize); }
template <class T>
Q_INLINE_TEMPLATE QSet<T> &QSet<T>::unite(const QSet<T> &other)
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index f2c2ad2284..c82faf2566 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -4074,7 +4074,7 @@ QRhiImplementation::~QRhiImplementation()
#ifndef QT_NO_DEBUG
if (!resources.isEmpty()) {
qWarning("QRhi %p going down with %d unreleased resources that own native graphics objects. This is not nice.",
- q, resources.count());
+ q, int(resources.count()));
for (QRhiResource *res : qAsConst(resources)) {
qWarning(" %s resource %p (%s)", resourceTypeStr(res), res, res->m_objectName.constData());
res->m_rhi = nullptr;