QtPrivate: add "defined in" comment to findByteArray/lastIndexOf(~~~, char)

It's customary to add such a comment when an inline function is not
defined in the same header it is declared.

As a drive-by, remove the pure attribute from lastIndexOf().
Q_DECL_PURE/CONST_FUNCTIONS are only useful for out-of-line functions.
For inline functions, the compiler sees the body and can determine
that they're pure or const (in the __attribute__((const)) sense)
itself.

Found in API-review.

Change-Id: I27aa5cfaf21b1015a6c8b9e4773a1c2c5134a226
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 3b812f0409c50c6a3fd1d66a9c18bc323e0a0ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-09-04 16:00:10 +02:00 committed by Qt Cherry-pick Bot
parent 1e86694501
commit b972361ec4

View File

@ -25,13 +25,13 @@ bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept;
[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION
bool endsWith(QByteArrayView haystack, QByteArrayView needle) noexcept;
[[nodiscard]] inline
[[nodiscard]] inline // defined in qbytearrayview.h
qsizetype findByteArray(QByteArrayView haystack, qsizetype from, char needle) noexcept;
[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION
qsizetype findByteArray(QByteArrayView haystack, qsizetype from, QByteArrayView needle) noexcept;
[[nodiscard]] inline Q_DECL_PURE_FUNCTION
[[nodiscard]] inline // defined in qbytearrayview.h
qsizetype lastIndexOf(QByteArrayView haystack, qsizetype from, uchar needle) noexcept;
[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION