diff options
| author | Stefan Boberg <[email protected]> | 2022-12-12 12:16:21 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2022-12-12 12:17:30 +0100 |
| commit | 91e67d337ad8140df1c8b746d3c2e2827df9ff7a (patch) | |
| tree | faba25df62facc9e7176df38ce0b70bbac06a29c /zencore/include | |
| parent | Update README.md (diff) | |
| download | zen-91e67d337ad8140df1c8b746d3c2e2827df9ff7a.tar.xz zen-91e67d337ad8140df1c8b746d3c2e2827df9ff7a.zip | |
added [[fallthrough]] annotations to silence static analysis
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/varint.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zencore/include/zencore/varint.h b/zencore/include/zencore/varint.h index d7f2ebfb7..e57e1d497 100644 --- a/zencore/include/zencore/varint.h +++ b/zencore/include/zencore/varint.h @@ -120,27 +120,35 @@ ReadVarUInt(const void* InData, uint32_t& OutByteCount) case 8: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 7: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 6: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 5: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 4: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 3: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 2: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; case 1: Value <<= 8; Value |= *InBytes++; + [[fallthrough]]; default: return Value; } @@ -177,15 +185,19 @@ WriteVarUInt(uint32_t InValue, void* OutData) case 4: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 3: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 2: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 1: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; default: break; } @@ -210,27 +222,35 @@ WriteVarUInt(uint64_t InValue, void* OutData) case 8: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 7: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 6: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 5: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 4: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 3: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 2: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; case 1: *OutBytes-- = uint8_t(InValue); InValue >>= 8; + [[fallthrough]]; default: break; } |