diff options
author | Brad King <brad.king@kitware.com> | 2019-07-01 13:42:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-01 13:42:12 (GMT) |
commit | 0998f6396a51248aa307c3254f876d2699597a5b (patch) | |
tree | adbd3fa0395cdb423833bdb576df1e2009aa99e5 /Utilities/cmexpat/lib/siphash.h | |
parent | 7449c63f3ea8026cd14e7b88d44253375dd9c298 (diff) | |
parent | ba13dc2aa88097649b4c9084a5188fbf7f56a901 (diff) | |
download | CMake-0998f6396a51248aa307c3254f876d2699597a5b.zip CMake-0998f6396a51248aa307c3254f876d2699597a5b.tar.gz CMake-0998f6396a51248aa307c3254f876d2699597a5b.tar.bz2 |
Merge branch 'upstream-expat' into update-expat
* upstream-expat:
expat 2019-06-19 (d3b78b42)
Diffstat (limited to 'Utilities/cmexpat/lib/siphash.h')
-rw-r--r-- | Utilities/cmexpat/lib/siphash.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Utilities/cmexpat/lib/siphash.h b/Utilities/cmexpat/lib/siphash.h index 1684b25..3caabeb 100644 --- a/Utilities/cmexpat/lib/siphash.h +++ b/Utilities/cmexpat/lib/siphash.h @@ -11,6 +11,12 @@ * -------------------------------------------------------------------------- * HISTORY: * + * 2018-07-08 (Anton Maklakov) + * - Add "fall through" markers for GCC's -Wimplicit-fallthrough + * + * 2017-11-03 (Sebastian Pipping) + * - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined + * * 2017-07-25 (Vadim Zeitlin) * - Fix use of SIPHASH_MAIN macro * @@ -154,6 +160,8 @@ static struct sipkey *sip_tokey(struct sipkey *key, const void *src) { } /* sip_tokey() */ +#ifdef SIPHASH_TOBIN + #define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v)) static void *sip_tobin(void *dst, uint64_t u64) { @@ -161,6 +169,8 @@ static void *sip_tobin(void *dst, uint64_t u64) { return dst; } /* sip_tobin() */ +#endif /* SIPHASH_TOBIN */ + static void sip_round(struct siphash *H, const int rounds) { int i; @@ -234,12 +244,19 @@ static uint64_t sip24_final(struct siphash *H) { switch (left) { case 7: b |= (uint64_t)H->buf[6] << 48; + /* fall through */ case 6: b |= (uint64_t)H->buf[5] << 40; + /* fall through */ case 5: b |= (uint64_t)H->buf[4] << 32; + /* fall through */ case 4: b |= (uint64_t)H->buf[3] << 24; + /* fall through */ case 3: b |= (uint64_t)H->buf[2] << 16; + /* fall through */ case 2: b |= (uint64_t)H->buf[1] << 8; + /* fall through */ case 1: b |= (uint64_t)H->buf[0] << 0; + /* fall through */ case 0: break; } |