1.1: Make switch fallthrough explicit

This includes a backport of #6426

Testing:
```
git clean -e /.envrc -e /.direnv -fdx \
&& CFLAGS=-Werror=implicit-fallthrough pip -v install -e .
```
This commit is contained in:
James Buren 2022-03-09 05:00:08 -06:00 committed by Andrey Bienkowski
parent 111a420420
commit 67a2d3a296
3 changed files with 4 additions and 4 deletions

View file

@ -363,8 +363,8 @@ crc32_clmul(const uint8_t *src, long len, uint32_t initial_crc)
*/
uint32_t crc = ~initial_crc;
switch (len) {
case 3: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++];
case 2: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++];
case 3: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++]; // fallthrough
case 2: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++]; // fallthrough
case 1: crc = (crc >> 8) ^ Crc32Lookup[0][(crc & 0xFF) ^ *src++];
}
return ~crc;

View file

@ -245,7 +245,7 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, Py_ssize
_fixed_trail_again:
++p;
++p; // fallthrough
default:
if((size_t)(pe - p) < trail) { goto _out; }

View file

@ -196,7 +196,7 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
_fixed_trail_again:
++p;
++p; // fallthrough
default:
if((size_t)(pe - p) < trail) { goto _out; }