summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-08-15 17:42:02 +0200
committerIvan Solovev <ivan.solovev@qt.io>2023-08-17 13:44:53 +0200
commit6616d4e1f3cc991ac723981d90b411a9cae7f795 (patch)
tree10dfefb0f4c346d9f8176b0257597e56af52c906
parentc3470b20874d2460d5f4e1dc820bfaf5daee132b (diff)
QUuid: use 'inline' keyword on method declarations
Some older compilers used to generate warnings if the 'inline' keyword was used only on method definition, but not on its declaration. It does not seem to be a problem at the moment, but still move the 'inline' keyword from the definition to the declaration of the new QUuid constructor, toBytes(), and fromBytes() methods. Split the fromBytes() declaration, moving the keywords to a separate line, to fit into the 100 characters limit. Found during Qt 6.6 API Review. Pick-to: 6.6 Change-Id: Ic5bd3ad094669cda76592968789cf83e9a72bccd Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r--src/corelib/plugin/quuid.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 140f20a80e..68f6e943d0 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -75,7 +75,7 @@ public:
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
: data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {}
- explicit QUuid(Id128Bytes id128, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept;
+ explicit inline QUuid(Id128Bytes id128, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept;
explicit QUuid(QAnyStringView string) noexcept
: QUuid{fromString(string)} {}
@@ -89,10 +89,11 @@ public:
#endif
QString toString(StringFormat mode = WithBraces) const;
QByteArray toByteArray(StringFormat mode = WithBraces) const;
- Id128Bytes toBytes(QSysInfo::Endian order = QSysInfo::BigEndian) const noexcept;
+ inline Id128Bytes toBytes(QSysInfo::Endian order = QSysInfo::BigEndian) const noexcept;
QByteArray toRfc4122() const;
- static QUuid fromBytes(const void *bytes, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept;
+ static inline
+ QUuid fromBytes(const void *bytes, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept;
#if QT_CORE_REMOVED_SINCE(6, 3)
static QUuid fromRfc4122(const QByteArray &);
#endif
@@ -213,7 +214,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QUuid &);
Q_CORE_EXPORT size_t qHash(const QUuid &uuid, size_t seed = 0) noexcept;
-inline QUuid::QUuid(Id128Bytes uuid, QSysInfo::Endian order) noexcept
+QUuid::QUuid(Id128Bytes uuid, QSysInfo::Endian order) noexcept
{
if (order == QSysInfo::LittleEndian)
uuid = bswap(uuid);
@@ -223,7 +224,7 @@ inline QUuid::QUuid(Id128Bytes uuid, QSysInfo::Endian order) noexcept
memcpy(data4, &uuid.data[8], sizeof(data4));
}
-inline QUuid::Id128Bytes QUuid::toBytes(QSysInfo::Endian order) const noexcept
+QUuid::Id128Bytes QUuid::toBytes(QSysInfo::Endian order) const noexcept
{
Id128Bytes result = {};
qToBigEndian(data1, &result.data[0]);
@@ -235,7 +236,7 @@ inline QUuid::Id128Bytes QUuid::toBytes(QSysInfo::Endian order) const noexcept
return result;
}
-inline QUuid QUuid::fromBytes(const void *bytes, QSysInfo::Endian order) noexcept
+QUuid QUuid::fromBytes(const void *bytes, QSysInfo::Endian order) noexcept
{
Id128Bytes result = {};
memcpy(result.data, bytes, sizeof(result));