From 5147400ea72d349e23a5280fb8d3ca9425237ddf Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 18 Apr 2017 16:52:20 -0700
Subject: [PATCH] Move Q_REQUIRED_RESULT to the beginning of the declaration

That's the correct place and works with C++11 attributes.

Change-Id: I7814054a102a407d876ffffd14b6a2fed3744b03
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
---
 src/websockets/qwebsocket_p.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h
index 4863de74..4d33788f 100644
--- a/src/websockets/qwebsocket_p.h
+++ b/src/websockets/qwebsocket_p.h
@@ -179,7 +179,7 @@ private:
     void processHandshake(QTcpSocket *pSocket);
     void processStateChanged(QAbstractSocket::SocketState socketState);
 
-    qint64 doWriteFrames(const QByteArray &data, bool isBinary) Q_REQUIRED_RESULT;
+    Q_REQUIRED_RESULT qint64 doWriteFrames(const QByteArray &data, bool isBinary);
 
     void makeConnections(const QTcpSocket *pTcpSocket);
     void releaseConnections(const QTcpSocket *pTcpSocket);
@@ -195,15 +195,16 @@ private:
                                    QByteArray key,
                                    const QList<QPair<QString, QString> > &headers);
 
-    static QWebSocket *upgradeFrom(QTcpSocket *tcpSocket,
-                                   const QWebSocketHandshakeRequest &request,
-                                   const QWebSocketHandshakeResponse &response,
-                                   QObject *parent = Q_NULLPTR) Q_REQUIRED_RESULT;
+    Q_REQUIRED_RESULT static QWebSocket *
+    upgradeFrom(QTcpSocket *tcpSocket,
+                const QWebSocketHandshakeRequest &request,
+                const QWebSocketHandshakeResponse &response,
+                QObject *parent = Q_NULLPTR);
 
     quint32 generateMaskingKey() const;
     QByteArray generateKey() const;
-    qint64 writeFrames(const QList<QByteArray> &frames) Q_REQUIRED_RESULT;
-    qint64 writeFrame(const QByteArray &frame) Q_REQUIRED_RESULT;
+    Q_REQUIRED_RESULT qint64 writeFrames(const QList<QByteArray> &frames);
+    Q_REQUIRED_RESULT qint64 writeFrame(const QByteArray &frame);
 
     QTcpSocket *m_pSocket;
     QString m_errorString;
-- 
GitLab