diff options
author | Stefan Becker <chemobejk@gmail.com> | 2018-04-07 13:42:35 (GMT) |
---|---|---|
committer | Stefan Becker <chemobejk@gmail.com> | 2018-04-11 05:45:54 (GMT) |
commit | 08ef815c7b55f28417b1a965eeab3640558d5f5a (patch) | |
tree | 6b71d8c69c973b6bbca9621c133623da79c7519b /src/hash_map.h | |
parent | ca041d88f4d610332aa48c801342edfafb622ccb (diff) | |
download | Ninja-08ef815c7b55f28417b1a965eeab3640558d5f5a.zip Ninja-08ef815c7b55f28417b1a965eeab3640558d5f5a.tar.gz Ninja-08ef815c7b55f28417b1a965eeab3640558d5f5a.tar.bz2 |
Add NINJA_FALLTHROUGH macro
Borrow macro implementation from OpenSSL code.
Add the macro after each fallthrough switch case to indicate our
intention to the compiler. This silences GCC -Wimplicit-fallthrough
warnings, which is implied by GCC 7.x -Wextra.
Diffstat (limited to 'src/hash_map.h')
-rw-r--r-- | src/hash_map.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hash_map.h b/src/hash_map.h index a91aeb9..55d2c9d 100644 --- a/src/hash_map.h +++ b/src/hash_map.h @@ -18,6 +18,7 @@ #include <algorithm> #include <string.h> #include "string_piece.h" +#include "util.h" // MurmurHash2, by Austin Appleby static inline @@ -40,7 +41,9 @@ unsigned int MurmurHash2(const void* key, size_t len) { } switch (len) { case 3: h ^= data[2] << 16; + NINJA_FALLTHROUGH; case 2: h ^= data[1] << 8; + NINJA_FALLTHROUGH; case 1: h ^= data[0]; h *= m; }; |