refactor: add explicit fallthrough for fall through cases in unicode

This commit is contained in:
sithlord48 2026-03-26 18:58:01 -04:00 committed by Nick Bolton
parent 456c312931
commit 06d7f91551

View file

@ -357,34 +357,35 @@ uint32_t Unicode::fromUTF8(const uint8_t *&data, uint32_t &n)
truncated = true; truncated = true;
size = 5; size = 5;
} }
// fall through [[fallthrough]];
case 5: case 5:
if ((data[4] & 0xc0) != 0x80) { if ((data[4] & 0xc0) != 0x80) {
truncated = true; truncated = true;
size = 4; size = 4;
} }
// fall through [[fallthrough]];
case 4: case 4:
if ((data[3] & 0xc0) != 0x80) { if ((data[3] & 0xc0) != 0x80) {
truncated = true; truncated = true;
size = 3; size = 3;
} }
// fall through [[fallthrough]];
case 3: case 3:
if ((data[2] & 0xc0) != 0x80) { if ((data[2] & 0xc0) != 0x80) {
truncated = true; truncated = true;
size = 2; size = 2;
} }
// fall through [[fallthrough]];
case 2: case 2:
if ((data[1] & 0xc0) != 0x80) { if ((data[1] & 0xc0) != 0x80) {
truncated = true; truncated = true;
size = 1; size = 1;
} }
[[fallthrough]];
default: default:
break; break;