diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-07-12 11:38:30 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-07-12 19:58:26 +0000 |
commit | f1ffc11e613ebe3132d94937eb60d59c2095e7ce (patch) | |
tree | 8d66bae5881fbc606240d0203ad6d3d0d103e0d3 /src/corelib/plugin/quuid.h | |
parent | 4bc0a08bea3c262ebda26163f9271c946c430ff0 (diff) |
Revert "QUuid: use NSDMI to initialize the members"
This reverts commit c3c5d2cab07ffed1ddfb7978870c05917d89fa39.
Reason for the revert - it breaks the purpose of the Qt::Uninitialized
ctor
The commit also updates the QUuid(quint128, QSysInfo::Endian) ctor
to avoid the compiler errors:
error: member ‘QUuid::data*’ must be initialized by mem-initializer
in ‘constexpr’ constructor
Pick-to: 6.6
Change-Id: I0057fab3d7203adaddad3e890129668923a9eef6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin/quuid.h')
-rw-r--r-- | src/corelib/plugin/quuid.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index 3142062665..0cead3a8b7 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -70,7 +70,7 @@ public: } }; - constexpr QUuid() noexcept {} + constexpr QUuid() noexcept : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {} constexpr QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept @@ -183,10 +183,10 @@ public: NSUUID *toNSUUID() const Q_DECL_NS_RETURNS_AUTORELEASED; #endif - uint data1 = 0; - ushort data2 = 0; - ushort data3 = 0; - uchar data4[8] = {}; + uint data1; + ushort data2; + ushort data3; + uchar data4[8]; private: static constexpr Id128Bytes bswap(Id128Bytes b) @@ -244,6 +244,7 @@ inline QUuid QUuid::fromBytes(const void *bytes, QSysInfo::Endian order) noexcep #ifdef __SIZEOF_INT128__ constexpr inline QUuid::QUuid(quint128 uuid, QSysInfo::Endian order) noexcept + : QUuid() { if (order == QSysInfo::LittleEndian) uuid = qbswap(uuid); |