From 8a4ea3f03807c4d75ef73609dae30cfcf427c3ea Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Jun 2017 13:29:11 -0700 Subject: [PATCH] Move Q_REQUIRED_RESULT to its correct position This commit complements commit 3dcc075f4a5efce348a6fa00cf5a0adef97b1089 for Qt 5.10. Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Simon Hausmann --- src/corelib/tools/qbytearray.h | 8 ++++---- src/corelib/tools/qstring.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 144216a6ef..7c26351278 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -212,10 +212,10 @@ public: inline char operator[](uint i) const; inline QByteRef operator[](int i); inline QByteRef operator[](uint i); - char front() const Q_REQUIRED_RESULT { return at(0); } - inline QByteRef front() Q_REQUIRED_RESULT; - char back() const Q_REQUIRED_RESULT { return at(size() - 1); } - inline QByteRef back() Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT char front() const { return at(0); } + Q_REQUIRED_RESULT inline QByteRef front(); + Q_REQUIRED_RESULT char back() const { return at(size() - 1); } + Q_REQUIRED_RESULT inline QByteRef back(); int indexOf(char c, int from = 0) const; int indexOf(const char *c, int from = 0) const; diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index d5301a396f..539abbe999 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -109,8 +109,8 @@ public: { return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]); } Q_DECL_CONSTEXPR QLatin1Char operator[](int i) const { return at(i); } - Q_DECL_CONSTEXPR QLatin1Char front() const Q_REQUIRED_RESULT { return at(0); } - Q_DECL_CONSTEXPR QLatin1Char back() const Q_REQUIRED_RESULT { return at(size() - 1); } + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char front() const { return at(0); } + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char back() const { return at(size() - 1); } Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW { return qStartsWith(*this, s, cs); } @@ -159,7 +159,7 @@ public: { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data, n); } Q_DECL_CONSTEXPR QLatin1String right(int n) const { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data + m_size - n, n); } - Q_DECL_CONSTEXPR QLatin1String chopped(int n) const Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1String chopped(int n) const { return Q_ASSERT(n >= 0), Q_ASSERT(n <= size()), QLatin1String(m_data, m_size - n); } Q_DECL_RELAXED_CONSTEXPR void chop(int n) @@ -1543,8 +1543,8 @@ public: inline const QChar at(int i) const { Q_ASSERT(uint(i) < uint(size())); return m_string->at(i + m_position); } QChar operator[](int i) const { return at(i); } - QChar front() const Q_REQUIRED_RESULT { return at(0); } - QChar back() const Q_REQUIRED_RESULT { return at(size() - 1); } + Q_REQUIRED_RESULT QChar front() const { return at(0); } + Q_REQUIRED_RESULT QChar back() const { return at(size() - 1); } #if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) // ASCII compatibility