From 24bf3674f30afacb710f8ec1ce28bcd60c023ea7 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:45:43 +1300 Subject: [PATCH] Remove warnings when falling through switch cases on purpose (#4181) --- esphome/components/esp32_ble_client/ble_client_base.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/components/esp32_ble_client/ble_client_base.cpp b/esphome/components/esp32_ble_client/ble_client_base.cpp index dd6fc94127..017d65573d 100644 --- a/esphome/components/esp32_ble_client/ble_client_base.cpp +++ b/esphome/components/esp32_ble_client/ble_client_base.cpp @@ -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) +