diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2020-05-22 11:26:21 +0200 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-06 21:30:47 +0200 |
| commit | 0341bf2e979264b9f7606bd57e594a41c27a38cc (patch) | |
| tree | 226be567b0eee672a38dd9b83494815d4bc0d110 /src/corelib/tools | |
| parent | c129362b4d9512bd33004d430bc3b817546cb1b7 (diff) | |
Make QArrayDataPointer::size a qsizetype
This is a next step towards making QList, QString
and QByteArray able to deal with large sizes.
Change-Id: Icad49b33f503401ac4912678b2f88584c6f91a63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
| -rw-r--r-- | src/corelib/tools/qarraydataops.h | 4 | ||||
| -rw-r--r-- | src/corelib/tools/qarraydatapointer.h | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index bea585e69ab..a97f2da175c 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -690,7 +690,7 @@ struct QMovableArrayOps struct Mover { - Mover(T *&start, const T *finish, int &sz) + Mover(T *&start, const T *finish, qsizetype &sz) : destination(start) , source(start) , n(finish - start) @@ -707,7 +707,7 @@ struct QMovableArrayOps T *&destination; const T *const source; size_t n; - int &size; + qsizetype &size; } mover(e, this->end(), this->size); // destroy the elements we're erasing diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h index aff603c32be..a7e8429469a 100644 --- a/src/corelib/tools/qarraydatapointer.h +++ b/src/corelib/tools/qarraydatapointer.h @@ -70,17 +70,17 @@ public: ref(); } - constexpr QArrayDataPointer(Data *header, T *adata, size_t n = 0) noexcept - : d(header), ptr(adata), size(int(n)) + constexpr QArrayDataPointer(Data *header, T *adata, qsizetype n = 0) noexcept + : d(header), ptr(adata), size(n) { } - explicit QArrayDataPointer(QPair<QTypedArrayData<T> *, T *> adata, size_t n = 0) noexcept - : d(adata.first), ptr(adata.second), size(int(n)) + explicit QArrayDataPointer(QPair<QTypedArrayData<T> *, T *> adata, qsizetype n = 0) noexcept + : d(adata.first), ptr(adata.second), size(n) { } - static QArrayDataPointer fromRawData(const T *rawData, size_t length) noexcept + static QArrayDataPointer fromRawData(const T *rawData, qsizetype length) noexcept { Q_ASSERT(rawData || !length); return { nullptr, const_cast<T *>(rawData), length }; @@ -212,7 +212,7 @@ protected: T *ptr; public: - int size; + qsizetype size; }; template <class T> |
