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>
This commit is contained in:
Thiago Macieira 2019-08-08 19:13:55 -07:00
parent d502b19b28
commit ffc2d57223

View File

@ -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;