From c47ad5815dfac73a06c35b12f3695b974fa31dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 20 Jan 2023 14:04:52 +0100 Subject: [PATCH] src: use explicit C++17 fallthrough This passes the strictest -Wimplicit-fallthrough setting. PR-URL: https://github.com/nodejs/node/pull/46251 Reviewed-By: Richard Lau Reviewed-By: Yagiz Nizipli Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Jiawen Geng Reviewed-By: James M Snell --- src/crypto/crypto_clienthello.cc | 2 +- src/inspector_io.cc | 2 +- src/node_i18n.cc | 4 ++-- src/node_zlib.cc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crypto/crypto_clienthello.cc b/src/crypto/crypto_clienthello.cc index 7da05e9b474a64..203289ae29113a 100644 --- a/src/crypto/crypto_clienthello.cc +++ b/src/crypto/crypto_clienthello.cc @@ -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; diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 7e0b3ea63cff25..b7b8f21e3ff16a 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -74,7 +74,7 @@ class RequestToServer { switch (action_) { case TransportAction::kKill: server->TerminateConnections(); - // Fallthrough + [[fallthrough]]; case TransportAction::kStop: server->Stop(); break; diff --git a/src/node_i18n.cc b/src/node_i18n.cc index d5d8943f1c6615..bb810632ee6617 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -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: diff --git a/src/node_zlib.cc b/src/node_zlib.cc index cda6437034927e..3d130e8eb64859 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -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: