Skip to content

Commit f638489

Browse files
committed
Use fallthrough attribute
1 parent 14b10cb commit f638489

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

gframe/client_field.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ void ClientField::GetCardDrawCoordinates(ClientCard* pcard, irr::core::vector3df
819819
return matManager.vFieldMzone[controler][pcard->overlayTarget->sequence];
820820
if(pcard->overlayTarget->location == LOCATION_SZONE)
821821
return matManager.getSzone()[controler][pcard->overlayTarget->sequence];
822-
/*fallthrough*/
822+
[[fallthrough]];
823823
default: return nullptr;
824824
}
825825
};

gframe/duelclient.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,10 @@ void DuelClient::HandleSTOCPacketLanAsync(const std::vector<uint8_t>& data) {
454454
int stringid = 1406;
455455
switch(pkt.error) {
456456
case JoinError::JERR_UNABLE: stringid--;
457-
/*fallthrough*/
457+
[[fallthrough]];
458458
case JoinError::JERR_PASSWORD: stringid--;
459-
/*fallthrough*/
459+
[[fallthrough]];
460460
case JoinError::JERR_REFUSED: stringid--;
461-
/*fallthrough*/
462461
}
463462
if(stringid < 1406)
464463
mainGame->PopupMessage(gDataManager->GetSysString(stringid));
@@ -4284,7 +4283,7 @@ void DuelClient::SendResponse() {
42844283
if(msg != MSG_SELECT_CARD && msg != MSG_SELECT_UNSELECT_CARD)
42854284
break;
42864285
}
4287-
/*fallthrough*/
4286+
[[fallthrough]];
42884287
case MSG_SELECT_TRIBUTE:
42894288
case MSG_SELECT_COUNTER: {
42904289
mainGame->dField.ClearSelect();

gframe/game.cpp

+8-11
Original file line numberDiff line numberDiff line change
@@ -3110,33 +3110,33 @@ void Game::UpdateDuelParam() {
31103110
cbDuelRule->removeItem(8);
31113111
break;
31123112
}
3113-
}/*fallthrough*/
3113+
}
3114+
[[fallthrough]];
31143115
case DUEL_MODE_RUSH: {
31153116
cbDuelRule->setSelected(6);
31163117
if(flag2 == DUEL_MODE_MR5_FORB) {
31173118
cbDuelRule->removeItem(8);
31183119
break;
31193120
}
3120-
}/*fallthrough*/
3121+
}
3122+
[[fallthrough]];
31213123
case DUEL_MODE_GOAT: {
31223124
cbDuelRule->setSelected(7);
31233125
if(flag2 == DUEL_MODE_MR1_FORB) {
31243126
cbDuelRule->removeItem(8);
31253127
break;
31263128
}
3127-
}/*fallthrough*/
3129+
}
3130+
[[fallthrough]];
31283131
default:
31293132
switch(flag & ~DUEL_TCG_SEGOC_NONPUBLIC) {
3130-
#ifdef __GNUC__
3131-
#pragma GCC diagnostic push
3132-
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
3133-
#endif
31343133
#define CHECK(MR) \
31353134
case DUEL_MODE_MR##MR:{ \
31363135
cbDuelRule->setSelected(MR - 1); \
31373136
if (flag2 == DUEL_MODE_MR##MR##_FORB) { \
31383137
cbDuelRule->removeItem(8); break; } \
3139-
}
3138+
} \
3139+
[[fallthrough]];
31403140
CHECK(1)
31413141
CHECK(2)
31423142
CHECK(3)
@@ -3148,9 +3148,6 @@ void Game::UpdateDuelParam() {
31483148
cbDuelRule->setSelected(8);
31493149
break;
31503150
}
3151-
#ifdef __GNUC__
3152-
#pragma GCC diagnostic pop
3153-
#endif
31543151
}
31553152
break;
31563153
}

0 commit comments

Comments
 (0)