Fix -Wswitch warning

This commit is contained in:
Tillmann Karras 2015-03-01 16:17:32 +01:00
parent b0bde31ac0
commit 88264f5712
3 changed files with 6 additions and 10 deletions

View File

@ -215,10 +215,8 @@ void TraversalClient::OnFailure(FailureReason reason)
switch (reason) switch (reason)
{ {
case TraversalClient::BadHost: case TraversalClient::BadHost:
{
PanicAlertT("Couldn't look up central server %s", m_Server.c_str()); PanicAlertT("Couldn't look up central server %s", m_Server.c_str());
break; break;
}
case TraversalClient::VersionTooOld: case TraversalClient::VersionTooOld:
PanicAlertT("Dolphin too old for traversal server"); PanicAlertT("Dolphin too old for traversal server");
break; break;

View File

@ -34,7 +34,6 @@ public:
ServerForgotAboutUs, ServerForgotAboutUs,
SocketSendError, SocketSendError,
ResendTimeout, ResendTimeout,
ConnectFailedError = 0x400,
}; };
TraversalClient(ENetHost* netHost, const std::string& server, const u16 port); TraversalClient(ENetHost* netHost, const std::string& server, const u16 port);
~TraversalClient(); ~TraversalClient();

View File

@ -744,20 +744,19 @@ void NetPlayClient::OnConnectFailed(u8 reason)
{ {
m_connecting = false; m_connecting = false;
m_state = Failure; m_state = Failure;
int swtch = TraversalClient::ConnectFailedError + reason; switch (reason)
switch (swtch)
{ {
case TraversalClient::ConnectFailedError + TraversalConnectFailedClientDidntRespond: case TraversalConnectFailedClientDidntRespond:
PanicAlertT("Traversal server timed out connecting to the host"); PanicAlertT("Traversal server timed out connecting to the host");
break; break;
case TraversalClient::ConnectFailedError + TraversalConnectFailedClientFailure: case TraversalConnectFailedClientFailure:
PanicAlertT("Server rejected traversal attempt"); PanicAlertT("Server rejected traversal attempt");
break; break;
case TraversalClient::ConnectFailedError + TraversalConnectFailedNoSuchClient: case TraversalConnectFailedNoSuchClient:
PanicAlertT("Invalid host"); PanicAlertT("Invalid host");
break; break;
default: default:
PanicAlertT("Unknown error %x", swtch); PanicAlertT("Unknown error %x", reason);
break; break;
} }
} }