diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-02 15:16:34 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-03 15:15:16 +0100 |
commit | 65b8514cb5eae5a7055f55fd375da7b2eea487d6 (patch) | |
tree | a1860cda3959538dd066d658b233f920054548b2 /src/corelib/text/qbytearray.h | |
parent | 4d8ee1b3493b79a6f1cd5200e6102711c0102c9e (diff) |
MSVC: Fix integer conversion warnings in containers
Add some casts, fixing warnings like:
src/corelib/text/qbytearray.h(490): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
src/corelib/text/qstring.h(1045): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
src/corelib/tools/qarraydatapointer.h(80): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
src/corelib/tools/qarraydatapointer.h(75): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
src/corelib/text/qbytearray.h(490): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
Change-Id: I221db4d5b660224f0fc1869248802c496db1b91c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/text/qbytearray.h')
-rw-r--r-- | src/corelib/text/qbytearray.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index 863898f7e2..e3fec1e62c 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -487,7 +487,7 @@ inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d) {} inline int QByteArray::capacity() const -{ int realCapacity = d->constAllocatedCapacity(); return realCapacity ? realCapacity - 1 : 0; } +{ const auto realCapacity = d->constAllocatedCapacity(); return realCapacity ? int(realCapacity) - 1 : 0; } inline void QByteArray::reserve(int asize) { |