From 30fa961d1aca319b52071ad9d6e4527ea2638fb7 Mon Sep 17 00:00:00 2001 From: Janne Koschinski Date: Wed, 20 Dec 2017 03:12:35 +0100 Subject: [PATCH 1/1] Replace Protocol::Handler enum with enum class --- src/common/peer.h | 4 ++-- src/common/protocol.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/peer.h b/src/common/peer.h index 64a333ce..6f17ed66 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -119,7 +119,7 @@ template inline void Peer::handle(const T &protoMessage) { switch(protoMessage.handler()) { - case Protocol::SignalProxy: + case Protocol::Handler::SignalProxy: if (!signalProxy()) { qWarning() << Q_FUNC_INFO << "Cannot handle message without a SignalProxy!"; return; @@ -127,7 +127,7 @@ void Peer::handle(const T &protoMessage) signalProxy()->handle(this, protoMessage); break; - case Protocol::AuthHandler: + case Protocol::Handler::AuthHandler: if (!authHandler()) { qWarning() << Q_FUNC_INFO << "Cannot handle auth messages without an active AuthHandler!"; return; diff --git a/src/common/protocol.h b/src/common/protocol.h index f3c18e4c..bf6c401e 100644 --- a/src/common/protocol.h +++ b/src/common/protocol.h @@ -42,7 +42,7 @@ enum Feature { }; -enum Handler { +enum class Handler { SignalProxy, AuthHandler }; @@ -51,7 +51,7 @@ enum Handler { /*** Handshake, handled by AuthHandler ***/ struct HandshakeMessage { - inline Handler handler() const { return AuthHandler; } + inline Handler handler() const { return Handler::AuthHandler; } }; @@ -179,7 +179,7 @@ struct SessionState : public HandshakeMessage struct SignalProxyMessage { - inline Handler handler() const { return SignalProxy; } + inline Handler handler() const { return Handler::SignalProxy; } }; -- 2.20.1