[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 16/78] audio: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH 16/78] audio: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 10:47:20 +0300 |
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
audio/audio.c | 16 ++++++++--------
audio/jackaudio.c | 4 ++--
audio/pwaudio.c | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index e9815d6812..ed7c795af7 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -245,39 +245,39 @@ static int audio_validate_settings (struct audsettings
*as)
static int audio_pcm_info_eq (struct audio_pcm_info *info, struct audsettings
*as)
{
int bits = 8;
bool is_signed = false, is_float = false;
switch (as->fmt) {
case AUDIO_FORMAT_S8:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U8:
break;
case AUDIO_FORMAT_S16:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U16:
bits = 16;
break;
case AUDIO_FORMAT_F32:
is_float = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_S32:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U32:
bits = 32;
break;
default:
abort();
}
return info->freq == as->freq
&& info->nchannels == as->nchannels
&& info->is_signed == is_signed
&& info->is_float == is_float
&& info->bits == bits
&& info->swap_endianness == (as->endianness != AUDIO_HOST_ENDIANNESS);
}
@@ -285,45 +285,45 @@ static int audio_pcm_info_eq (struct audio_pcm_info
*info, struct audsettings *a
void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
{
int bits = 8, mul;
bool is_signed = false, is_float = false;
switch (as->fmt) {
case AUDIO_FORMAT_S8:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U8:
mul = 1;
break;
case AUDIO_FORMAT_S16:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U16:
bits = 16;
mul = 2;
break;
case AUDIO_FORMAT_F32:
is_float = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_S32:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U32:
bits = 32;
mul = 4;
break;
default:
abort();
}
info->freq = as->freq;
info->bits = bits;
info->is_signed = is_signed;
info->is_float = is_float;
info->nchannels = as->nchannels;
info->bytes_per_frame = as->nchannels * mul;
info->bytes_per_second = info->freq * info->bytes_per_frame;
info->swap_endianness = (as->endianness != AUDIO_HOST_ENDIANNESS);
}
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 974a3caad3..fc602411cd 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -574,22 +574,22 @@ static int qjack_init_in(HWVoiceIn *hw, struct
audsettings *as,
static void qjack_client_fini_locked(QJackClient *c)
{
switch (c->state) {
case QJACK_STATE_RUNNING:
jack_deactivate(c->client);
- /* fallthrough */
+ fallthrough;
case QJACK_STATE_SHUTDOWN:
jack_client_close(c->client);
c->client = NULL;
qjack_buffer_free(&c->fifo);
g_free(c->port);
g_free(c->process_buffers);
c->state = QJACK_STATE_DISCONNECTED;
- /* fallthrough */
+ fallthrough;
case QJACK_STATE_DISCONNECTED:
break;
}
}
diff --git a/audio/pwaudio.c b/audio/pwaudio.c
index bf26fadb06..89b31617a6 100644
--- a/audio/pwaudio.c
+++ b/audio/pwaudio.c
@@ -487,31 +487,31 @@ static void
qpw_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
{
memcpy(position, (uint32_t[SPA_AUDIO_MAX_CHANNELS]) {
SPA_AUDIO_CHANNEL_UNKNOWN, },
sizeof(uint32_t) * SPA_AUDIO_MAX_CHANNELS);
/*
* TODO: This currently expects the only frontend supporting more than 2
* channels is the usb-audio. We will need some means to set channel
* order when a new frontend gains multi-channel support.
*/
switch (channels) {
case 8:
position[6] = SPA_AUDIO_CHANNEL_SL;
position[7] = SPA_AUDIO_CHANNEL_SR;
- /* fallthrough */
+ fallthrough;
case 6:
position[2] = SPA_AUDIO_CHANNEL_FC;
position[3] = SPA_AUDIO_CHANNEL_LFE;
position[4] = SPA_AUDIO_CHANNEL_RL;
position[5] = SPA_AUDIO_CHANNEL_RR;
- /* fallthrough */
+ fallthrough;
case 2:
position[0] = SPA_AUDIO_CHANNEL_FL;
position[1] = SPA_AUDIO_CHANNEL_FR;
break;
case 1:
position[0] = SPA_AUDIO_CHANNEL_MONO;
break;
default:
dolog("Internal error: unsupported channel count %d\n", channels);
}
}
--
2.39.2
- [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, (continued)
- [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 11/78] hw/timer: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 12/78] hw/usb: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 13/78] hw/adc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 14/78] util/error-report.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 15/78] accel/tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 16/78] audio: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=
- [RFC PATCH 19/78] target/hppa: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 20/78] target/mips: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 22/78] target/ppc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 21/78] target/sparc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 27/78] target/riscv: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 28/78] target/avr: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 24/78] target/alpha: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 25/78] target/i386: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13