From ffc2d5722317fcab86865b11491d7bf7fef3e16d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 8 Aug 2019 19:13:55 -0700 Subject: 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 --- src/corelib/tools/qlist.h | 4 ++-- 1 file 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 &list, const U &u, int from) Node *n = reinterpret_cast(list.p.at(from + 1)); while (n-- != b) { if (n->t() == u) - return n - b; + return typename QList::difference_type(n - b); } } return -1; -- cgit v1.2.3