Skip to content

Commit

Permalink
src: use explicit C++17 fallthrough
Browse files Browse the repository at this point in the history
This passes the strictest -Wimplicit-fallthrough setting.

PR-URL: #46251
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: James M Snell <[email protected]>
tniessen authored and ruyadorno committed Jan 31, 2023

Verified

This commit was signed with the committer’s verified signature.
ararslan Alex Arslan
1 parent 9675863 commit 7cf0da0
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/crypto/crypto_clienthello.cc
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ void ClientHelloParser::Parse(const uint8_t* data, size_t avail) {
case kWaiting:
if (!ParseRecordHeader(data, avail))
break;
// Fall through
[[fallthrough]];
case kTLSHeader:
ParseHeader(data, avail);
break;
2 changes: 1 addition & 1 deletion src/inspector_io.cc
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ class RequestToServer {
switch (action_) {
case TransportAction::kKill:
server->TerminateConnections();
// Fallthrough
[[fallthrough]];
case TransportAction::kStop:
server->Stop();
break;
4 changes: 2 additions & 2 deletions src/node_i18n.cc
Original file line number Diff line number Diff line change
@@ -794,12 +794,12 @@ static int GetColumnWidth(UChar32 codepoint,
return 2;
}
// If ambiguous_as_full_width is false:
// Fall through
[[fallthrough]];
case U_EA_NEUTRAL:
if (u_hasBinaryProperty(codepoint, UCHAR_EMOJI_PRESENTATION)) {
return 2;
}
// Fall through
[[fallthrough]];
case U_EA_HALFWIDTH:
case U_EA_NARROW:
default:
4 changes: 2 additions & 2 deletions src/node_zlib.cc
Original file line number Diff line number Diff line change
@@ -797,7 +797,7 @@ void ZlibContext::DoThreadPoolWork() {
break;
}

// fallthrough
[[fallthrough]];
case 1:
if (next_expected_header_byte == nullptr) {
break;
@@ -817,7 +817,7 @@ void ZlibContext::DoThreadPoolWork() {
CHECK(0 && "invalid number of gzip magic number bytes read");
}

// fallthrough
[[fallthrough]];
case INFLATE:
case GUNZIP:
case INFLATERAW:

0 comments on commit 7cf0da0

Please sign in to comment.