Remove warnings when falling through switch cases on purpose (#4181)

This commit is contained in:
Jesse Hills 2022-12-14 11:45:43 +13:00 committed by GitHub
parent c47dc09d34
commit 24bf3674f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,14 +290,17 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
if (length > 2) {
return (float) encode_uint16(value[1], value[2]);
}
// fall through
case 0x7: // uint24.
if (length > 3) {
return (float) encode_uint24(value[1], value[2], value[3]);
}
// fall through
case 0x8: // uint32.
if (length > 4) {
return (float) encode_uint32(value[1], value[2], value[3], value[4]);
}
// fall through
case 0xC: // int8.
return (float) ((int8_t) value[1]);
case 0xD: // int12.
@ -305,10 +308,12 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
if (length > 2) {
return (float) ((int16_t)(value[1] << 8) + (int16_t) value[2]);
}
// fall through
case 0xF: // int24.
if (length > 3) {
return (float) ((int32_t)(value[1] << 16) + (int32_t)(value[2] << 8) + (int32_t)(value[3]));
}
// fall through
case 0x10: // int32.
if (length > 4) {
return (float) ((int32_t)(value[1] << 24) + (int32_t)(value[2] << 16) + (int32_t)(value[3] << 8) +