From 91e67d337ad8140df1c8b746d3c2e2827df9ff7a Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 12 Dec 2022 12:16:21 +0100 Subject: added [[fallthrough]] annotations to silence static analysis --- zencore/include/zencore/varint.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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; } -- cgit v1.2.3