summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-08-08 19:13:55 -0700
committerThiago Macieira <thiago.macieira@intel.com>2019-08-10 17:10:47 -0700
commitffc2d5722317fcab86865b11491d7bf7fef3e16d (patch)
treecb501c5900b0fd846d9f9439050a627a484db617 /src/corelib
parentd502b19b283806d2ef5c6b7bfd79baef15f3845c (diff)
QList: fix some integer cast warnings from 64- to 32-bit
Not tested because we're not promising to fix them all. Just those two that were reported. Fixes: QTBUG-77391 Change-Id: Iec9c051acd73484c8d94fffd15b91f5e6348635d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qlist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index e593ba9aa3..74b57f7ad4 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -111,7 +111,7 @@ struct Q_CORE_EXPORT QListData {
void remove(int i);
void remove(int i, int n);
void move(int from, int to);
- inline int size() const Q_DECL_NOTHROW { return d->end - d->begin; }
+ inline int size() const Q_DECL_NOTHROW { return int(d->end - d->begin); } // q6sizetype
inline bool isEmpty() const Q_DECL_NOTHROW { return d->end == d->begin; }
inline void **at(int i) const Q_DECL_NOTHROW { return d->array + d->begin + i; }
inline void **begin() const Q_DECL_NOTHROW { return d->array + d->begin; }
@@ -1031,7 +1031,7 @@ int lastIndexOf(const QList<T> &list, const U &u, int from)
Node *n = reinterpret_cast<Node *>(list.p.at(from + 1));
while (n-- != b) {
if (n->t() == u)
- return n - b;
+ return typename QList<T>::difference_type(n - b);
}
}
return -1;