From 748ba1bc82fdd35e972912a436f82023ec4a333a Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 25 Mar 2021 03:49:32 +0000 Subject: [PATCH] Fix '-Wimplicit-fallthrough' warnings by adding a fallthrough comment --- include/SFML/System/Utf.inl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl index 24a38af21..091b7a13b 100644 --- a/include/SFML/System/Utf.inl +++ b/include/SFML/System/Utf.inl @@ -62,11 +62,11 @@ In Utf<8>::decode(In begin, In end, Uint32& output, Uint32 replacement) output = 0; switch (trailingBytes) { - case 5: output += static_cast(*begin++); output <<= 6; - case 4: output += static_cast(*begin++); output <<= 6; - case 3: output += static_cast(*begin++); output <<= 6; - case 2: output += static_cast(*begin++); output <<= 6; - case 1: output += static_cast(*begin++); output <<= 6; + case 5: output += static_cast(*begin++); output <<= 6; // fallthrough + case 4: output += static_cast(*begin++); output <<= 6; // fallthrough + case 3: output += static_cast(*begin++); output <<= 6; // fallthrough + case 2: output += static_cast(*begin++); output <<= 6; // fallthrough + case 1: output += static_cast(*begin++); output <<= 6; // fallthrough case 0: output += static_cast(*begin++); } output -= offsets[trailingBytes]; @@ -114,9 +114,9 @@ Out Utf<8>::encode(Uint32 input, Out output, Uint8 replacement) Uint8 bytes[4]; switch (bytestoWrite) { - case 4: bytes[3] = static_cast((input | 0x80) & 0xBF); input >>= 6; - case 3: bytes[2] = static_cast((input | 0x80) & 0xBF); input >>= 6; - case 2: bytes[1] = static_cast((input | 0x80) & 0xBF); input >>= 6; + case 4: bytes[3] = static_cast((input | 0x80) & 0xBF); input >>= 6; // fallthrough + case 3: bytes[2] = static_cast((input | 0x80) & 0xBF); input >>= 6; // fallthrough + case 2: bytes[1] = static_cast((input | 0x80) & 0xBF); input >>= 6; // fallthrough case 1: bytes[0] = static_cast (input | firstBytes[bytestoWrite]); }