summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2020-11-24 11:03:46 +0100
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2020-12-01 10:04:41 +0100
commit9b3e6014a99c935dabe957299457be0e2de47e39 (patch)
tree3269db91ade164a2c8626d802a5f4507d7414e2b
parent2d6fa03f74a7aa5224447f6bae67592dfcc1f52e (diff)
xxhash: update fallthrough comments
clang doesn't support /* fallthrough */ so switch to fallthrough attribute. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7747>
-rw-r--r--src/util/xxhash.h74
1 files changed, 38 insertions, 36 deletions
diff --git a/src/util/xxhash.h b/src/util/xxhash.h
index f7a4b40578e..eb9e86597db 100644
--- a/src/util/xxhash.h
+++ b/src/util/xxhash.h
@@ -78,6 +78,8 @@ XXH32 6.8 GB/s 6.0 GB/s
#define XXH_FORCE_ALIGN_CHECK 0
#define XXH_FORCE_MEMORY_ACCESS 0
+#include "util/compiler.h" /* for FALLTHROUGH */
+
#if defined (__cplusplus)
extern "C" {
#endif
@@ -729,41 +731,41 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
} else {
switch(len&15) /* or switch(bEnd - p) */ {
case 12: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 8: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 4: PROCESS4;
return XXH32_avalanche(h32);
case 13: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 9: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 5: PROCESS4;
PROCESS1;
return XXH32_avalanche(h32);
case 14: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 10: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 6: PROCESS4;
PROCESS1;
PROCESS1;
return XXH32_avalanche(h32);
case 15: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 11: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 7: PROCESS4;
- /* fallthrough */
+ FALLTHROUGH;
case 3: PROCESS1;
- /* fallthrough */
+ FALLTHROUGH;
case 2: PROCESS1;
- /* fallthrough */
+ FALLTHROUGH;
case 1: PROCESS1;
- /* fallthrough */
+ FALLTHROUGH;
case 0: return XXH32_avalanche(h32);
}
XXH_ASSERT(0);
@@ -1144,63 +1146,63 @@ XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align)
} else {
switch(len & 31) {
case 24: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 16: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 8: PROCESS8_64;
return XXH64_avalanche(h64);
case 28: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 20: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 12: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 4: PROCESS4_64;
return XXH64_avalanche(h64);
case 25: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 17: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 9: PROCESS8_64;
PROCESS1_64;
return XXH64_avalanche(h64);
case 29: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 21: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 13: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 5: PROCESS4_64;
PROCESS1_64;
return XXH64_avalanche(h64);
case 26: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 18: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 10: PROCESS8_64;
PROCESS1_64;
PROCESS1_64;
return XXH64_avalanche(h64);
case 30: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 22: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 14: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 6: PROCESS4_64;
PROCESS1_64;
PROCESS1_64;
return XXH64_avalanche(h64);
case 27: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 19: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 11: PROCESS8_64;
PROCESS1_64;
PROCESS1_64;
@@ -1208,19 +1210,19 @@ XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align)
return XXH64_avalanche(h64);
case 31: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 23: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 15: PROCESS8_64;
- /* fallthrough */
+ FALLTHROUGH;
case 7: PROCESS4_64;
- /* fallthrough */
+ FALLTHROUGH;
case 3: PROCESS1_64;
- /* fallthrough */
+ FALLTHROUGH;
case 2: PROCESS1_64;
- /* fallthrough */
+ FALLTHROUGH;
case 1: PROCESS1_64;
- /* fallthrough */
+ FALLTHROUGH;
case 0: return XXH64_avalanche(h64);
}
}