[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] audio: Add missing fall through
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] audio: Add missing fall through comments |
Date: |
Fri, 19 Jul 2019 12:21:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 7/19/19 9:43 AM, Aleksandar Markovic wrote:
>
> On Jul 19, 2019 9:30 AM, "Philippe Mathieu-Daudé" <address@hidden
> <mailto:address@hidden>> wrote:
>>
>> On 7/18/19 9:34 PM, Stefan Weil wrote:
>> > Signed-off-by: Stefan Weil <address@hidden <mailto:address@hidden>>
>>
>> Reviewed-by: Philippe Mathieu-Daudé <address@hidden
> <mailto:address@hidden>>
>> Tested-by: Philippe Mathieu-Daudé <address@hidden
> <mailto:address@hidden>>
>>
>
> Philippe, how do you test these comments?
The testing is quite easy since it doesn't build with
'-Wimplicit-fallthrough=2':
CC audio/audio.o
/home/phil/source/qemu/audio/audio.c: In function ‘audio_pcm_init_info’:
/home/phil/source/qemu/audio/audio.c:308:14: error: this statement may
fall through [-Werror=implicit-fallthrough=]
308 | sign = 1;
| ~~~~~^~~
/home/phil/source/qemu/audio/audio.c:309:5: note: here
309 | case AUDIO_FORMAT_U16:
| ^~~~
/home/phil/source/qemu/audio/audio.c:315:14: error: this statement may
fall through [-Werror=implicit-fallthrough=]
315 | sign = 1;
| ~~~~~^~~
/home/phil/source/qemu/audio/audio.c:316:5: note: here
316 | case AUDIO_FORMAT_U32:
| ^~~~
cc1: all warnings being treated as errors
With Stefan patch applied:
CC audio/audio.o
CC audio/audio_legacy.o
CC audio/noaudio.o
CC audio/wavaudio.o
CC audio/mixeng.o
CC audio/spiceaudio.o
CC audio/wavcapture.o
[...]
>
> Yours, Aleksandar
>
>> > ---
>> > audio/audio.c | 2 ++
>> > 1 file changed, 2 insertions(+)
>> >
>> > diff --git a/audio/audio.c b/audio/audio.c
>> > index 5fd9a58a80..a7a13e900a 100644
>> > --- a/audio/audio.c
>> > +++ b/audio/audio.c
>> > @@ -304,6 +304,7 @@ void audio_pcm_init_info (struct audio_pcm_info
> *info, struct audsettings *as)
>> >
>> > case AUDIO_FORMAT_S16:
>> > sign = 1;
>> > + /* fall through */
>> > case AUDIO_FORMAT_U16:
>> > bits = 16;
>> > shift = 1;
>> > @@ -311,6 +312,7 @@ void audio_pcm_init_info (struct audio_pcm_info
> *info, struct audsettings *as)
>> >
>> > case AUDIO_FORMAT_S32:
>> > sign = 1;
>> > + /* fall through */
>> > case AUDIO_FORMAT_U32:
>> > bits = 32;
>> > shift = 2;
>> >
>>
>