diff --git a/src/action/action_unload.cpp b/src/action/action_unload.cpp index af134777e6..d714f437d1 100644 --- a/src/action/action_unload.cpp +++ b/src/action/action_unload.cpp @@ -409,7 +409,7 @@ void COrder_Unload::Execute(CUnit &unit) /* override */ } this->Retries = 0; this->State = MOVE_TO_DROPZONE_STATE; - // fall through and move immediately + [[fallthrough]]; // fallthrough and move immediately case MOVE_TO_DROPZONE_STATE: switch (DoActionMove(unit)) { case PF_UNREACHABLE: @@ -424,7 +424,7 @@ void COrder_Unload::Execute(CUnit &unit) /* override */ // still moving or waiting to move return; } - // fall through + [[fallthrough]]; case UNLOAD_STATE: // Leave the transporter // FIXME: show still animations ? diff --git a/src/map/fow.cpp b/src/map/fow.cpp index 459eb23b33..f1a9d769f2 100644 --- a/src/map/fow.cpp +++ b/src/map/fow.cpp @@ -360,7 +360,7 @@ void CFogOfWar::Update(bool doAtOnce /*= false*/) case States::cGenerateFog: GenerateFog(); - /// pass through + [[fallthrough]]; default: this->State++; break; diff --git a/src/network/netconnect.cpp b/src/network/netconnect.cpp index 1eff5923ac..286f29e021 100644 --- a/src/network/netconnect.cpp +++ b/src/network/netconnect.cpp @@ -1277,13 +1277,13 @@ int CServer::Parse_Hello(int h, const CInitMessage_Hello &msg, const CHost &host void CServer::Parse_Resync(const int h) { switch (networkStates[h].State) { - case ccs_mapinfo: - // a delayed ack - fall through.. + case ccs_mapinfo: // a delayed ack.. + [[fallthrough]]; case ccs_async: // client has recvd welcome and is waiting for info networkStates[h].State = ccs_synced; networkStates[h].MsgCnt = 0; - /* Fall through */ + [[fallthrough]]; case ccs_synced: { // this code path happens until client falls back to ICMWaiting // (indicating Resync has completed) @@ -1314,11 +1314,11 @@ void CServer::Parse_Waiting(const int h) case ccs_connecting: networkStates[h].State = ccs_connected; networkStates[h].MsgCnt = 0; - /* Fall through */ + [[fallthrough]]; case ccs_needmap: // client has finished receiving the map and wants the info again networkStates[h].State = ccs_connected; networkStates[h].MsgCnt = 0; - /* Fall through */ + [[fallthrough]]; case ccs_connected: { // this code path happens until client acknowledges the map Send_Map(Hosts[h]); @@ -1338,7 +1338,7 @@ void CServer::Parse_Waiting(const int h) networkStates[i].State = ccs_async; } } - /* Fall through */ + [[fallthrough]]; case ccs_synced: // the wanted state - do nothing.. until start... networkStates[h].MsgCnt = 0; @@ -1377,7 +1377,7 @@ void CServer::Parse_Map(const int h) case ccs_connected: networkStates[h].State = ccs_mapinfo; networkStates[h].MsgCnt = 0; - /* Fall through */ + [[fallthrough]]; case ccs_mapinfo: { // this code path happens until client acknowledges the state info // by falling back to ICMWaiting with prev. State synced @@ -1403,7 +1403,7 @@ void CServer::Parse_MapFragment(const int h, uint32_t fragmentIdx) networkStates[h].State = ccs_needmap; networkStates[h].MsgCnt = 0; Assert(fragmentIdx == 0); // client keep asking for this fragment initially - /* Fall through */ + [[fallthrough]]; case ccs_needmap: { Send_MapFragment(Hosts[h], fragmentIdx); networkStates[h].MsgCnt++; @@ -1429,7 +1429,7 @@ void CServer::Parse_State(const int h, const CInitMessage_State &msg) switch (networkStates[h].State) { case ccs_mapinfo: // User State Change right after connect - should not happen, but.. - /* Fall through */ + [[fallthrough]]; case ccs_synced: // Default case: Client is in sync with us, but notes a local change // networkStates[h].State = ccs_async; @@ -1445,7 +1445,7 @@ void CServer::Parse_State(const int h, const CInitMessage_State &msg) networkStates[i].State = ccs_async; } } - /* Fall through */ + [[fallthrough]]; case ccs_async: { // this code path happens until client acknowledges the state change reply // by sending ICMResync @@ -1475,7 +1475,7 @@ void CServer::Parse_GoodBye(const int h) // We can enter here from _ANY_ state! networkStates[h].MsgCnt = 0; networkStates[h].State = ccs_detaching; - /* Fall through */ + [[fallthrough]]; case ccs_detaching: { // this code path happens until client acknoledges the GoodBye // by sending ICMSeeYou;