Merge pull request #11796 from afirago/fix-fallthrough-werror

Fix implicit fallthrough warning on GCC 7.x
reviewable/pr12024/r1
Nicolas Noble 7 years ago committed by GitHub
commit 9279ca1267
  1. 1
      src/core/ext/transport/chttp2/transport/bin_decoder.c
  2. 4
      src/core/ext/transport/chttp2/transport/varint.c
  3. 1
      src/core/lib/json/json_reader.c
  4. 2
      src/core/lib/support/murmur_hash.c

@ -118,6 +118,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 */
case 2:
ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur);
}

@ -37,12 +37,16 @@ void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
switch (tail_length) {
case 5:
target[4] = (uint8_t)((tail_value >> 28) | 0x80);
/* fallthrough */
case 4:
target[3] = (uint8_t)((tail_value >> 21) | 0x80);
/* fallthrough */
case 3:
target[2] = (uint8_t)((tail_value >> 14) | 0x80);
/* fallthrough */
case 2:
target[1] = (uint8_t)((tail_value >> 7) | 0x80);
/* fallthrough */
case 1:
target[0] = (uint8_t)((tail_value) | 0x80);
}

@ -178,6 +178,7 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
json_reader_string_clear(reader);
reader->state = GRPC_JSON_STATE_VALUE_END;
/* The missing break here is intentional. */
/* fallthrough */
case GRPC_JSON_STATE_VALUE_END:
case GRPC_JSON_STATE_OBJECT_KEY_BEGIN:

@ -62,8 +62,10 @@ uint32_t gpr_murmur_hash3(const void *key, size_t len, uint32_t seed) {
switch (len & 3) {
case 3:
k1 ^= ((uint32_t)tail[2]) << 16;
/* fallthrough */
case 2:
k1 ^= ((uint32_t)tail[1]) << 8;
/* fallthrough */
case 1:
k1 ^= tail[0];
k1 *= c1;

Loading…
Cancel
Save