Merge "Fix implicit fallthrough warnings."

am: 012692be3f

Change-Id: I37a244c2e850d1247010d92b9e91b9c34df159f1
This commit is contained in:
Chih-Hung Hsieh
2018-10-12 17:48:52 -07:00
committed by android-build-merger

View File

@@ -16,6 +16,10 @@
#include "hash.h" #include "hash.h"
#ifndef FALLTHROUGH_INTENDED
#define FALLTHROUGH_INTENDED [[fallthrough]]
#endif
namespace android { namespace android {
namespace os { namespace os {
namespace statsd { namespace statsd {
@@ -67,8 +71,10 @@ uint32_t Hash32(const char *data, size_t n, uint32_t seed) {
switch (n) { switch (n) {
case 3: case 3:
h ^= ByteAs32(data[2]) << 16; h ^= ByteAs32(data[2]) << 16;
FALLTHROUGH_INTENDED;
case 2: case 2:
h ^= ByteAs32(data[1]) << 8; h ^= ByteAs32(data[1]) << 8;
FALLTHROUGH_INTENDED;
case 1: case 1:
h ^= ByteAs32(data[0]); h ^= ByteAs32(data[0]);
h *= m; h *= m;
@@ -104,16 +110,22 @@ uint64_t Hash64(const char* data, size_t n, uint64_t seed) {
switch (n) { switch (n) {
case 7: case 7:
h ^= ByteAs64(data[6]) << 48; h ^= ByteAs64(data[6]) << 48;
FALLTHROUGH_INTENDED;
case 6: case 6:
h ^= ByteAs64(data[5]) << 40; h ^= ByteAs64(data[5]) << 40;
FALLTHROUGH_INTENDED;
case 5: case 5:
h ^= ByteAs64(data[4]) << 32; h ^= ByteAs64(data[4]) << 32;
FALLTHROUGH_INTENDED;
case 4: case 4:
h ^= ByteAs64(data[3]) << 24; h ^= ByteAs64(data[3]) << 24;
FALLTHROUGH_INTENDED;
case 3: case 3:
h ^= ByteAs64(data[2]) << 16; h ^= ByteAs64(data[2]) << 16;
FALLTHROUGH_INTENDED;
case 2: case 2:
h ^= ByteAs64(data[1]) << 8; h ^= ByteAs64(data[1]) << 8;
FALLTHROUGH_INTENDED;
case 1: case 1:
h ^= ByteAs64(data[0]); h ^= ByteAs64(data[0]);
h *= m; h *= m;