a2dp-codec-sbc: get rid of compiler warnings
authorTanu Kaskinen <tanuk@iki.fi>
Sun, 16 Jun 2019 09:09:27 +0000 (12:09 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Sun, 16 Jun 2019 09:12:31 +0000 (12:12 +0300)
The warnings:

modules/bluetooth/a2dp-codec-sbc.c: In function ‘default_bitpool’:
modules/bluetooth/a2dp-codec-sbc.c:161:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:169:9: note: here
         case SBC_SAMPLING_FREQ_44100:
         ^~~~
modules/bluetooth/a2dp-codec-sbc.c:170:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:180:9: note: here
         case SBC_SAMPLING_FREQ_48000:
         ^~~~

These were valid warnings in that an invalid channel mode would result
in unintended fallthroughs, but the end result would anyway been a crash
in the pa_assert_not_reached() at the end of the function, so
functionally there's no change.

src/modules/bluetooth/a2dp-codec-sbc.c

index cdc20d7..e4c1dff 100644 (file)
@@ -165,6 +165,7 @@ static uint8_t default_bitpool(uint8_t freq, uint8_t mode) {
                 case SBC_CHANNEL_MODE_JOINT_STEREO:
                     return SBC_BITPOOL_HQ_JOINT_STEREO_44100;
             }
+            break;
 
         case SBC_SAMPLING_FREQ_44100:
             switch (mode) {
@@ -176,6 +177,7 @@ static uint8_t default_bitpool(uint8_t freq, uint8_t mode) {
                 case SBC_CHANNEL_MODE_JOINT_STEREO:
                     return SBC_BITPOOL_HQ_JOINT_STEREO_44100;
             }
+            break;
 
         case SBC_SAMPLING_FREQ_48000:
             switch (mode) {
@@ -187,6 +189,7 @@ static uint8_t default_bitpool(uint8_t freq, uint8_t mode) {
                 case SBC_CHANNEL_MODE_JOINT_STEREO:
                     return SBC_BITPOOL_HQ_JOINT_STEREO_48000;
             }
+            break;
     }
 
     pa_assert_not_reached();