diff options
author | Benjamin Peterson <benjamin@python.org> | 2018-09-11 04:04:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 04:04:00 (GMT) |
commit | 5033aa77aacaa5505636f150e8d54baac5bdca9c (patch) | |
tree | 8cd8721d8b12f69169806666a8b5cfd64b2ee219 /Modules/expat/siphash.h | |
parent | 2064bb6d576ff7016d59318038779f428b0f0f3f (diff) | |
download | cpython-5033aa77aacaa5505636f150e8d54baac5bdca9c.zip cpython-5033aa77aacaa5505636f150e8d54baac5bdca9c.tar.gz cpython-5033aa77aacaa5505636f150e8d54baac5bdca9c.tar.bz2 |
bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150)
Diffstat (limited to 'Modules/expat/siphash.h')
-rw-r--r-- | Modules/expat/siphash.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/expat/siphash.h b/Modules/expat/siphash.h index 581872d..4d6786d 100644 --- a/Modules/expat/siphash.h +++ b/Modules/expat/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 * @@ -151,6 +157,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) { @@ -158,6 +166,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; @@ -231,12 +241,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; } |