1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)

This commit is contained in:
frosch
2017-08-13 18:38:42 +00:00
parent 19bae485b0
commit b4b98e5165
60 changed files with 221 additions and 121 deletions

View File

@@ -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));

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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: