summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-08-13 18:38:42 +0000
committerfrosch <frosch@openttd.org>2017-08-13 18:38:42 +0000
commitb4b98e51655012ea42dbc8ab9e455fbec0d04b39 (patch)
tree948fc802d5dfdca71454f6ce479e4f429e98488d /src/network
parent19bae485b028380fbdc94d02ebaecdf3ca23f932 (diff)
downloadopenttd-b4b98e51655012ea42dbc8ab9e455fbec0d04b39.tar.xz
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/udp.cpp9
-rw-r--r--src/network/network_chat_gui.cpp11
-rw-r--r--src/network/network_client.cpp3
-rw-r--r--src/network/network_content_gui.cpp3
-rw-r--r--src/network/network_gui.cpp5
-rw-r--r--src/network/network_server.cpp5
6 files changed, 23 insertions, 13 deletions
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index ce5f06b1f..20b1ce119 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -252,17 +252,20 @@ void NetworkUDPSocketHandler::ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo
*dst = c;
dst = &c->next;
}
- /* FALL THROUGH */
}
+ FALLTHROUGH;
+
case 3:
info->game_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
info->start_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
- /* FALL THROUGH */
+ FALLTHROUGH;
+
case 2:
info->companies_max = p->Recv_uint8 ();
info->companies_on = p->Recv_uint8 ();
info->spectators_max = p->Recv_uint8 ();
- /* FALL THROUGH */
+ FALLTHROUGH;
+
case 1:
p->Recv_string(info->server_name, sizeof(info->server_name));
p->Recv_string(info->server_revision, sizeof(info->server_revision));
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index f1e54f38d..68e148987 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -492,10 +492,13 @@ struct NetworkChatWindow : public Window {
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {
- /* Send */
- case WID_NC_SENDBUTTON: SendChat(this->message_editbox.text.buf, this->dtype, this->dest);
- /* FALL THROUGH */
- case WID_NC_CLOSE: /* Cancel */ delete this; break;
+ case WID_NC_SENDBUTTON: /* Send */
+ SendChat(this->message_editbox.text.buf, this->dtype, this->dest);
+ FALLTHROUGH;
+
+ case WID_NC_CLOSE: /* Cancel */
+ delete this;
+ break;
}
}
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index edfe4587f..e3bcbb2d8 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -965,7 +965,8 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CHAT(Packet *p)
/* For speaking to company or giving money, we need the company-name */
case NETWORK_ACTION_GIVE_MONEY:
if (!Company::IsValidID(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY;
- /* FALL THROUGH */
+ FALLTHROUGH;
+
case NETWORK_ACTION_CHAT_COMPANY: {
StringID str = Company::IsValidID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
SetDParam(0, ci_to->client_playas);
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 1227d43db..4b1332c58 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -908,7 +908,8 @@ public:
}
return ES_HANDLED;
}
- /* FALL THROUGH, space is pressed and filter is focused. */
+ /* space is pressed and filter is focused. */
+ FALLTHROUGH;
default:
return ES_NOT_HANDLED;
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 520c4f60a..3e4a4b050 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -2053,7 +2053,8 @@ struct NetworkJoinStatusWindow : Window {
progress = 15; // We don't have the final size yet; the server is still compressing!
break;
}
- /* FALL THROUGH */
+ FALLTHROUGH;
+
default: // Waiting is 15%, so the resting receivement of map is maximum 70%
progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
}
@@ -2182,7 +2183,7 @@ struct NetworkCompanyPasswordWindow : public Window {
switch (widget) {
case WID_NCP_OK:
this->OnOk();
- /* FALL THROUGH */
+ FALLTHROUGH;
case WID_NCP_CANCEL:
delete this;
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 6a33c73d8..bcee40852 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -1361,7 +1361,8 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
}
default:
DEBUG(net, 0, "[server] received unknown chat destination type %d. Doing broadcast instead", desttype);
- /* FALL THROUGH */
+ FALLTHROUGH;
+
case DESTTYPE_BROADCAST:
FOR_ALL_CLIENT_SOCKETS(cs) {
cs->SendChat(action, from_id, false, msg, data);
@@ -1396,7 +1397,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet *p)
switch (action) {
case NETWORK_ACTION_GIVE_MONEY:
if (!Company::IsValidID(ci->client_playas)) break;
- /* FALL THROUGH */
+ FALLTHROUGH;
case NETWORK_ACTION_CHAT:
case NETWORK_ACTION_CHAT_CLIENT:
case NETWORK_ACTION_CHAT_COMPANY: