diff options
| author | Vinnie Falco <[email protected]> | 2013-07-01 08:36:32 -0700 |
|---|---|---|
| committer | Vinnie Falco <[email protected]> | 2013-07-01 08:36:32 -0700 |
| commit | fb1da62318f5a7f6e3ec31cdc02178a5445870e4 (patch) | |
| tree | 4ef6f0b1017c747e84132427666eea4a36d10b0d /src/leveldb/util/hash.cc | |
| parent | Merge pull request #2803 from sipa/tarversion (diff) | |
| parent | Squashed 'src/leveldb/' changes from aca1ffc..ae6c262 (diff) | |
| download | discoin-fb1da62318f5a7f6e3ec31cdc02178a5445870e4.tar.xz discoin-fb1da62318f5a7f6e3ec31cdc02178a5445870e4.zip | |
Merge commit 'adae78ea9940f4d44382967d1296e7db0b54a4de' into leveldb-squashed
Diffstat (limited to 'src/leveldb/util/hash.cc')
| -rw-r--r-- | src/leveldb/util/hash.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/leveldb/util/hash.cc b/src/leveldb/util/hash.cc index ba1818082..07cf02206 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; |