diff options
| author | 2018-10-12 15:05:01 -0700 | |
|---|---|---|
| committer | 2018-10-12 15:05:01 -0700 | |
| commit | 6c5b82f7c51cb8ebb51e057435665a0a8f1922ca (patch) | |
| tree | 20737bb2c498ccb7f8f8dd8103368ceaf1e71c61 | |
| parent | 18f9a2c24d59d85788a30bdcb5530e82c87a3294 (diff) | |
Fix implicit fallthrough warnings.
Test: make checkbuild
Bug: 112564944
Change-Id: Ia33bf816fb6b179ac0a5a6a20bcb50c11b47431d
| -rw-r--r-- | cmds/statsd/src/hash.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmds/statsd/src/hash.cpp b/cmds/statsd/src/hash.cpp index c501c9f818b9..543a748adedb 100644 --- a/cmds/statsd/src/hash.cpp +++ b/cmds/statsd/src/hash.cpp @@ -16,6 +16,10 @@ #include "hash.h" +#ifndef FALLTHROUGH_INTENDED +#define FALLTHROUGH_INTENDED [[fallthrough]] +#endif + namespace android { namespace os { namespace statsd { @@ -67,8 +71,10 @@ uint32_t Hash32(const char *data, size_t n, uint32_t seed) { switch (n) { case 3: h ^= ByteAs32(data[2]) << 16; + FALLTHROUGH_INTENDED; case 2: h ^= ByteAs32(data[1]) << 8; + FALLTHROUGH_INTENDED; case 1: h ^= ByteAs32(data[0]); h *= m; @@ -104,16 +110,22 @@ uint64_t Hash64(const char* data, size_t n, uint64_t seed) { switch (n) { case 7: h ^= ByteAs64(data[6]) << 48; + FALLTHROUGH_INTENDED; case 6: h ^= ByteAs64(data[5]) << 40; + FALLTHROUGH_INTENDED; case 5: h ^= ByteAs64(data[4]) << 32; + FALLTHROUGH_INTENDED; case 4: h ^= ByteAs64(data[3]) << 24; + FALLTHROUGH_INTENDED; case 3: h ^= ByteAs64(data[2]) << 16; + FALLTHROUGH_INTENDED; case 2: h ^= ByteAs64(data[1]) << 8; + FALLTHROUGH_INTENDED; case 1: h ^= ByteAs64(data[0]); h *= m; |