aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/util/hash.cc
diff options
context:
space:
mode:
authorVinnie Falco <vinnie.falco@gmail.com>2013-07-01 08:36:32 -0700
committerVinnie Falco <vinnie.falco@gmail.com>2013-07-01 08:36:32 -0700
commitfb1da62318f5a7f6e3ec31cdc02178a5445870e4 (patch)
tree4ef6f0b1017c747e84132427666eea4a36d10b0d /src/leveldb/util/hash.cc
parent28bcf3b7ef804f7084938b21708b29c1f5d7c8f8 (diff)
parentadae78ea9940f4d44382967d1296e7db0b54a4de (diff)
Merge commit 'adae78ea9940f4d44382967d1296e7db0b54a4de' into leveldb-squashed
Diffstat (limited to 'src/leveldb/util/hash.cc')
-rw-r--r--src/leveldb/util/hash.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/leveldb/util/hash.cc b/src/leveldb/util/hash.cc
index ba1818082d..07cf022060 100644
--- a/src/leveldb/util/hash.cc
+++ b/src/leveldb/util/hash.cc
@@ -6,6 +6,13 @@
#include "util/coding.h"
#include "util/hash.h"
+// The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through
+// between switch labels. The real definition should be provided externally.
+// This one is a fallback version for unsupported compilers.
+#ifndef FALLTHROUGH_INTENDED
+#define FALLTHROUGH_INTENDED do { } while (0)
+#endif
+
namespace leveldb {
uint32_t Hash(const char* data, size_t n, uint32_t seed) {
@@ -28,10 +35,10 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) {
switch (limit - data) {
case 3:
h += data[2] << 16;
- // fall through
+ FALLTHROUGH_INTENDED;
case 2:
h += data[1] << 8;
- // fall through
+ FALLTHROUGH_INTENDED;
case 1:
h += data[0];
h *= m;