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 <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
tniessen authored and ruyadorno committed Jan 31, 2023
1 parent 9675863 commit 7cf0da0
Show file tree
Hide file tree
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
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RequestToServer {
switch (action_) {
case TransportAction::kKill:
server->TerminateConnections();
// Fallthrough
[[fallthrough]];
case TransportAction::kStop:
server->Stop();
break;
Expand Down
4 changes: 2 additions & 2 deletions src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ void ZlibContext::DoThreadPoolWork() {
break;
}

// fallthrough
[[fallthrough]];
case 1:
if (next_expected_header_byte == nullptr) {
break;
Expand All @@ -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:
Expand Down

0 comments on commit 7cf0da0

Please sign in to comment.