From b7239bf7e0da3247704aaad3fc7460859a71a980 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 14 Dec 2016 19:15:32 -0800 Subject: [PATCH] Gcc 7 fallthrough Summary: hopefully the last of the gcc-7 compile errors Closes https://github.com/facebook/rocksdb/pull/1675 Differential Revision: D4332106 Pulled By: IslamAbdelRahman fbshipit-source-id: 139448c --- util/murmurhash.cc | 16 ++++++++-------- utilities/document/json_document.cc | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/util/murmurhash.cc b/util/murmurhash.cc index 9a01bf11b..3b4bd66c9 100644 --- a/util/murmurhash.cc +++ b/util/murmurhash.cc @@ -46,12 +46,12 @@ uint64_t MurmurHash64A ( const void * key, int len, unsigned int seed ) switch(len & 7) { - case 7: h ^= ((uint64_t)data2[6]) << 48; - case 6: h ^= ((uint64_t)data2[5]) << 40; - case 5: h ^= ((uint64_t)data2[4]) << 32; - case 4: h ^= ((uint64_t)data2[3]) << 24; - case 3: h ^= ((uint64_t)data2[2]) << 16; - case 2: h ^= ((uint64_t)data2[1]) << 8; + case 7: h ^= ((uint64_t)data2[6]) << 48; // fallthrough + case 6: h ^= ((uint64_t)data2[5]) << 40; // fallthrough + case 5: h ^= ((uint64_t)data2[4]) << 32; // fallthrough + case 4: h ^= ((uint64_t)data2[3]) << 24; // fallthrough + case 3: h ^= ((uint64_t)data2[2]) << 16; // fallthrough + case 2: h ^= ((uint64_t)data2[1]) << 8; // fallthrough case 1: h ^= ((uint64_t)data2[0]); h *= m; }; @@ -167,8 +167,8 @@ unsigned int MurmurHashNeutral2 ( const void * key, int len, unsigned int seed ) switch(len) { - case 3: h ^= data[2] << 16; - case 2: h ^= data[1] << 8; + case 3: h ^= data[2] << 16; // fallthrough + case 2: h ^= data[1] << 8; // fallthrough case 1: h ^= data[0]; h *= m; }; diff --git a/utilities/document/json_document.cc b/utilities/document/json_document.cc index 9cf110830..75f0378f6 100644 --- a/utilities/document/json_document.cc +++ b/utilities/document/json_document.cc @@ -287,7 +287,6 @@ JSONDocument::Type JSONDocument::type() const { return JSONDocument::kArray; case fbson::FbsonType::T_Binary: - assert(false); default: assert(false); }