Disallow implicit fallthrough (#26874)

Most instances were already explicit through comments, so it's clear
that the author cared about being explicit; use the compiler to ensure
this is always the case.
pull/25318/merge
Tamir Duberstein 4 years ago committed by GitHub
parent ce483be968
commit ccad567e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      BUILD
  2. 11
      CMakeLists.txt
  3. 4
      bazel/copts.bzl
  4. 1
      build_autogenerated.yaml
  5. 1
      gRPC-C++.podspec
  6. 1
      gRPC-Core.podspec
  7. 1
      grpc.gyp
  8. 4
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  9. 2
      src/core/ext/transport/chttp2/transport/bin_decoder.cc
  10. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  11. 8
      src/core/ext/transport/chttp2/transport/frame_data.cc
  12. 16
      src/core/ext/transport/chttp2/transport/frame_goaway.cc
  13. 10
      src/core/ext/transport/chttp2/transport/frame_settings.cc
  14. 10
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  15. 20
      src/core/ext/transport/chttp2/transport/parsing.cc
  16. 10
      src/core/ext/transport/chttp2/transport/varint.cc
  17. 6
      src/core/lib/gpr/murmur_hash.cc
  18. 2
      src/core/lib/iomgr/timer_manager.cc
  19. 3
      src/core/lib/json/json_reader.cc
  20. 1
      src/core/lib/slice/slice_internal.h
  21. 2
      test/core/iomgr/tcp_client_posix_test.cc
  22. 2
      test/core/iomgr/tcp_client_uv_test.cc

@ -694,11 +694,12 @@ grpc_cc_library(
],
external_deps = [
"absl/base",
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/strings",
"absl/strings:str_format",
"absl/strings:cord",
"absl/strings:str_format",
"absl/synchronization",
"absl/time:time",
"absl/types:optional",
@ -2536,10 +2537,11 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/varint.h",
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/strings:str_format",
"absl/strings",
"absl/strings:str_format",
],
language = "c++",
visibility = ["@grpc:grpclb"],

@ -1437,6 +1437,7 @@ target_include_directories(gpr
target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
absl::core_headers
absl::memory
absl::status
absl::cord
@ -16051,7 +16052,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"absl_base absl_cord absl_memory absl_optional absl_status absl_str_format absl_strings absl_synchronization absl_time"
"absl_base absl_cord absl_core_headers absl_memory absl_optional absl_status absl_str_format absl_strings absl_synchronization absl_time"
"-lgpr"
""
"gpr.pc")
@ -16061,7 +16062,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"gpr openssl absl_base absl_bind_front absl_cord absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz"
""
"grpc.pc")
@ -16071,7 +16072,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"gpr absl_base absl_bind_front absl_cord absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"gpr absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"-lgrpc_unsecure"
""
"grpc_unsecure.pc")
@ -16081,7 +16082,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"grpc absl_base absl_bind_front absl_cord absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"grpc absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"-lgrpc++"
""
"grpc++.pc")
@ -16091,7 +16092,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"grpc_unsecure absl_base absl_bind_front absl_cord absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"grpc_unsecure absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
"-lgrpc++_unsecure"
""
"grpc++_unsecure.pc")

@ -14,9 +14,11 @@
# This is a list of llvm flags to be used when being built with use_strict_warning=1
GRPC_LLVM_WARNING_FLAGS = [
# Enable all & extra waninrgs
# Enable all & extra warnings
"-Wall",
"-Wextra",
# Avoid some known traps
"-Wimplicit-fallthrough",
# Consider warnings as errors
"-Werror",
# Ignore unknown warning flags

@ -393,6 +393,7 @@ libs:
- src/core/lib/profiling/stap_timers.cc
deps:
- absl/base:base
- absl/base:core_headers
- absl/memory:memory
- absl/status:status
- absl/strings:cord

@ -189,6 +189,7 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-Core', version
abseil_version = '1.20210324.0'
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version

@ -179,6 +179,7 @@ Pod::Spec.new do |s|
ss.dependency "#{s.name}/Interface", version
ss.dependency 'BoringSSL-GRPC', '0.0.19'
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version

@ -395,6 +395,7 @@
'type': 'static_library',
'dependencies': [
'absl/base:base',
'absl/base:core_headers',
'absl/memory:memory',
'absl/status:status',
'absl/strings:cord',

@ -428,7 +428,7 @@ RingHash::PickResult RingHash::Picker::Pick(PickArgs args) {
return PickResult::Complete(ring_[first_index].subchannel);
case GRPC_CHANNEL_IDLE:
ScheduleSubchannelConnectionAttempt(ring_[first_index].subchannel);
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHANNEL_CONNECTING:
return PickResult::Queue();
default: // GRPC_CHANNEL_TRANSIENT_FAILURE
@ -452,7 +452,7 @@ RingHash::PickResult RingHash::Picker::Pick(PickArgs args) {
switch (entry.connectivity_state) {
case GRPC_CHANNEL_IDLE:
ScheduleSubchannelConnectionAttempt(entry.subchannel);
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHANNEL_CONNECTING:
return PickResult::Queue();
default:

@ -146,7 +146,7 @@ bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) {
switch (input_tail) {
case 3:
ctx->output_cur[1] = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur);
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 2:
ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur);
}

@ -2444,7 +2444,7 @@ static void WithUrgency(grpc_chttp2_transport* t,
break;
case grpc_core::chttp2::FlowControlAction::Urgency::UPDATE_IMMEDIATELY:
grpc_chttp2_initiate_write(t, reason);
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case grpc_core::chttp2::FlowControlAction::Urgency::QUEUE_UPDATE:
action();
break;

@ -148,7 +148,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_1:
s->stats.incoming.framing_bytes++;
p->frame_size = (static_cast<uint32_t>(*cur)) << 24;
@ -157,7 +157,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_2:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 16;
@ -166,7 +166,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_3:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@ -175,7 +175,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_4:
s->stats.incoming.framing_bytes++;
GPR_ASSERT(stream_out != nullptr);

@ -70,7 +70,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id = (static_cast<uint32_t>(*cur)) << 24;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI1;
@ -78,7 +78,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI2;
@ -86,7 +86,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI3;
@ -94,7 +94,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur));
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR0:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR0;
@ -102,7 +102,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code = (static_cast<uint32_t>(*cur)) << 24;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR1;
@ -110,7 +110,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR2;
@ -118,7 +118,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR3;
@ -126,7 +126,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur));
++cur;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_DEBUG:
if (end != cur) {
memcpy(p->debug_data + p->debug_pos, cur,

@ -146,7 +146,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->id = static_cast<uint16_t>((static_cast<uint16_t>(*cur)) << 8);
cur++;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_ID1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_ID1;
@ -154,7 +154,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->id = static_cast<uint16_t>(parser->id | (*cur));
cur++;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL0:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL0;
@ -162,7 +162,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value = (static_cast<uint32_t>(*cur)) << 24;
cur++;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL1;
@ -170,7 +170,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 16;
cur++;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL2:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL2;
@ -178,7 +178,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 8;
cur++;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL3:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL3;

@ -603,6 +603,7 @@ grpc_error_handle HPackParser::parse_begin(const uint8_t* cur,
// literal key
return parse_lithdr_incidx_v(cur, end);
}
ABSL_FALLTHROUGH_INTENDED;
case 5:
case 6:
// inline encoded key index
@ -626,6 +627,7 @@ grpc_error_handle HPackParser::parse_begin(const uint8_t* cur,
// illegal value.
return parse_illegal_op(cur, end);
}
ABSL_FALLTHROUGH_INTENDED;
case 9:
case 10:
case 11:
@ -1209,8 +1211,8 @@ grpc_error_handle HPackParser::AppendString(const uint8_t* cur,
return GRPC_ERROR_NONE;
}
GRPC_STATS_INC_HPACK_RECV_BINARY_BASE64();
/* fallthrough */
b64_byte0:
ABSL_FALLTHROUGH_INTENDED;
case BinaryState::kBase64Byte0:
if (cur == end) {
binary_ = BinaryState::kBase64Byte0;
@ -1226,8 +1228,8 @@ grpc_error_handle HPackParser::AppendString(const uint8_t* cur,
goto b64_byte0;
}
base64_buffer_ = bits << 18;
/* fallthrough */
b64_byte1:
ABSL_FALLTHROUGH_INTENDED;
case BinaryState::kBase64Byte1:
if (cur == end) {
binary_ = BinaryState::kBase64Byte1;
@ -1243,8 +1245,8 @@ grpc_error_handle HPackParser::AppendString(const uint8_t* cur,
goto b64_byte1;
}
base64_buffer_ |= bits << 12;
/* fallthrough */
b64_byte2:
ABSL_FALLTHROUGH_INTENDED;
case BinaryState::kBase64Byte2:
if (cur == end) {
binary_ = BinaryState::kBase64Byte2;
@ -1260,8 +1262,8 @@ grpc_error_handle HPackParser::AppendString(const uint8_t* cur,
goto b64_byte2;
}
base64_buffer_ |= bits << 6;
/* fallthrough */
b64_byte3:
ABSL_FALLTHROUGH_INTENDED;
case BinaryState::kBase64Byte3:
if (cur == end) {
binary_ = BinaryState::kBase64Byte3;

@ -109,8 +109,8 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
if (cur == end) {
return GRPC_ERROR_NONE;
}
/* fallthrough */
dts_fh_0:
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_0:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size = (static_cast<uint32_t>(*cur)) << 16;
@ -118,7 +118,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_1;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_1:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@ -126,7 +126,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_2;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_2:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= *cur;
@ -134,7 +134,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_3;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_3:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_type = *cur;
@ -142,7 +142,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_4;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_4:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_flags = *cur;
@ -150,7 +150,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_5;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_5:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id = ((static_cast<uint32_t>(*cur)) & 0x7f) << 24;
@ -158,7 +158,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_6;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_6:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
@ -166,7 +166,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_7;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_7:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
@ -174,7 +174,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_8;
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_8:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur));
@ -208,7 +208,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
if (++cur == end) {
return GRPC_ERROR_NONE;
}
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FRAME:
GPR_DEBUG_ASSERT(cur < end);
if (static_cast<uint32_t>(end - cur) == t->incoming_frame_size) {

@ -20,6 +20,8 @@
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "absl/base/attributes.h"
uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value) {
if (tail_value < (1 << 7)) {
return 2;
@ -39,16 +41,16 @@ void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
switch (tail_length) {
case 5:
target[4] = static_cast<uint8_t>((tail_value >> 28) | 0x80);
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 4:
target[3] = static_cast<uint8_t>((tail_value >> 21) | 0x80);
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 3:
target[2] = static_cast<uint8_t>((tail_value >> 14) | 0x80);
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 2:
target[1] = static_cast<uint8_t>((tail_value >> 7) | 0x80);
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 1:
target[0] = static_cast<uint8_t>((tail_value) | 0x80);
}

@ -22,6 +22,8 @@
#include <string.h>
#include "absl/base/attributes.h"
#define ROTL32(x, r) (((x) << (r)) | ((x) >> (32 - (r))))
#define FMIX32(h) \
@ -61,10 +63,10 @@ uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) {
switch (len & 3) {
case 3:
k1 ^= (static_cast<uint32_t>(keyptr[2])) << 16;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 2:
k1 ^= (static_cast<uint32_t>(keyptr[1])) << 8;
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case 1:
k1 ^= keyptr[0];
k1 *= c1;

@ -250,7 +250,7 @@ static void timer_main_loop() {
gpr_log(GPR_INFO, "timers not checked: expect another thread to");
}
next = GRPC_MILLIS_INF_FUTURE;
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case GRPC_TIMERS_CHECKED_AND_EMPTY:
if (!wait_until(next)) {
return;

@ -347,8 +347,7 @@ JsonReader::Status JsonReader::Run() {
}
if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_END;
/* The missing break here is intentional. */
/* fallthrough */
ABSL_FALLTHROUGH_INTENDED;
case State::GRPC_JSON_STATE_VALUE_END:
case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:

@ -231,6 +231,7 @@ inline int grpc_slice_refcount::Eq(const grpc_slice& a, const grpc_slice& b) {
GPR_DEBUG_ASSERT(
(GRPC_STATIC_METADATA_INDEX(a) == GRPC_STATIC_METADATA_INDEX(b)) ==
(a.refcount == b.refcount));
ABSL_FALLTHROUGH_INTENDED;
case Type::INTERNED:
return a.refcount == b.refcount;
case Type::NOP:

@ -170,7 +170,7 @@ void test_fails(void) {
break;
case GRPC_TIMERS_NOT_CHECKED:
polling_deadline = 0;
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case GRPC_TIMERS_CHECKED_AND_EMPTY:
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work",

@ -166,7 +166,7 @@ void test_fails(void) {
break;
case GRPC_TIMERS_NOT_CHECKED:
polling_deadline = grpc_timespec_to_millis_round_up(now);
// fallthrough
ABSL_FALLTHROUGH_INTENDED;
case GRPC_TIMERS_CHECKED_AND_EMPTY:
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"pollset_work",

Loading…
Cancel
Save