diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 15:43:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-19 18:38:53 +0000 |
commit | 9f888d2fde9c5413e5519e0914e9b13638760985 (patch) | |
tree | 7e211a2ae70c272ea8041d5100f0c9a67b32de1b /src/network/access | |
parent | 25dd9c521fc064a71db63b110b7973225ee20c02 (diff) |
Support C++17 fallthrough attribute
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qftp.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 3 | ||||
-rw-r--r-- | src/network/access/qhttpprotocolhandler.cpp | 7 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 7b6f830333..52b9dd9169 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -1121,7 +1121,7 @@ bool QFtpPI::processReply() case Success: // success handling state = Idle; - // no break! + Q_FALLTHROUGH(); case Idle: if (dtp.hasError()) { emit error(QFtp::UnknownError, dtp.errorMessage()); diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 3a780f636b..87f88aad5f 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1036,7 +1036,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted() if (!protocolHandler) { switch (sslSocket->sslConfiguration().nextProtocolNegotiationStatus()) { - case QSslConfiguration::NextProtocolNegotiationNegotiated: /* fall through */ + case QSslConfiguration::NextProtocolNegotiationNegotiated: case QSslConfiguration::NextProtocolNegotiationUnsupported: { QByteArray nextProtocol = sslSocket->sslConfiguration().nextNegotiatedProtocol(); if (nextProtocol == QSslConfiguration::NextProtocolHttp1_1) { @@ -1056,6 +1056,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted() "detected unknown Next Protocol Negotiation protocol"); break; } + Q_FALLTHROUGH(); } case QSslConfiguration::NextProtocolNegotiationNone: protocolHandler.reset(new QHttpProtocolHandler(this)); diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp index b486b75449..37e8b9bed8 100644 --- a/src/network/access/qhttpprotocolhandler.cpp +++ b/src/network/access/qhttpprotocolhandler.cpp @@ -99,7 +99,7 @@ void QHttpProtocolHandler::_q_receiveReply() switch (state) { case QHttpNetworkReplyPrivate::NothingDoneState: { m_reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState; - // fallthrough + Q_FALLTHROUGH(); } case QHttpNetworkReplyPrivate::ReadingStatusState: { qint64 statusBytes = m_reply->d_func()->readStatus(m_socket); @@ -213,7 +213,8 @@ void QHttpProtocolHandler::_q_receiveReply() if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState) break; - // everything done, fall through + // everything done + Q_FALLTHROUGH(); } case QHttpNetworkReplyPrivate::AllDoneState: m_channel->allDone(); @@ -428,7 +429,7 @@ bool QHttpProtocolHandler::sendRequest() } case QHttpNetworkConnectionChannel::ReadingState: // ignore _q_bytesWritten in these states - // fall through + Q_FALLTHROUGH(); default: break; } diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 7a538cbf08..b7cf989477 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -644,7 +644,7 @@ static QDateTime parseDateString(const QByteArray &dateString) switch (end - 1) { case 4: minutes = atoi(dateString.mid(at + 3, 2).constData()); - // fall through + Q_FALLTHROUGH(); case 2: hours = atoi(dateString.mid(at + 1, 2).constData()); break; |