From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Bs5-00041A-GN for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5Bs1-0001Bl-8d for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:51:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Bs0-0001BP-UI for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:51:05 -0400 From: Markus Armbruster References: <9d0c3109b26c78d7be59f54527255f2af81bc68b.1434458391.git.DirtY.iCE.hu@gmail.com> <87a8vyg3wi.fsf@blackfin.pond.sub.org> <55815474.6060909@gmail.com> Date: Wed, 17 Jun 2015 13:51:02 +0200 In-Reply-To: <55815474.6060909@gmail.com> (=?utf-8?B?IkvFkXbDoWfDsyBab2x0?= =?utf-8?B?w6FuIidz?= message of "Wed, 17 Jun 2015 13:05:24 +0200") Message-ID: <87r3pa7duh.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 5/6] audio: use qapi AudioFormat instead of audfmt_e List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzIFpvbHTDoW4=?= Cc: Peter Maydell , Michael Walle , qemu-devel@nongnu.org, Gerd Hoffmann "K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1n" writes: > 2015-06-17 10:01 keltez=C3=A9ssel, Markus Armbruster =C3=ADrta: >> "K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n" writes: >> >>> I had to include an enum for audio sampling formats into qapi, but that= meant >>> duplicating the audfmt_e enum. This patch replaces audfmt_e and associa= ted >>> values with the qapi generated AudioFormat enum. >>> >>> This patch is mostly a search-and-replace, except for switches where th= e qapi >>> generated AUDIO_FORMAT_MAX caused problems. >> [...] >>> diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c >>> index 6315b2d..4d38f5d 100644 >>> --- a/audio/alsaaudio.c >>> +++ b/audio/alsaaudio.c >> [...] >>> @@ -639,19 +639,22 @@ static int alsa_open (int in, struct alsa_params_= req *req, >>> bytes_per_sec =3D freq << (nchannels =3D=3D 2); >>> >>> switch (obt->fmt) { >>> - case AUD_FMT_S8: >>> - case AUD_FMT_U8: >>> + case AUDIO_FORMAT_S8: >>> + case AUDIO_FORMAT_U8: >>> break; >>> >>> - case AUD_FMT_S16: >>> - case AUD_FMT_U16: >>> + case AUDIO_FORMAT_S16: >>> + case AUDIO_FORMAT_U16: >>> bytes_per_sec <<=3D 1; >>> break; >>> >>> - case AUD_FMT_S32: >>> - case AUD_FMT_U32: >>> + case AUDIO_FORMAT_S32: >>> + case AUDIO_FORMAT_U32: >>> bytes_per_sec <<=3D 2; >>> break; >>> + >>> + case AUDIO_FORMAT_MAX: >>> + break; >> >> Can this happen? > > Not under normal circumstances, but gcc warns otherwise. Okay, sounds like another case of "default: abort();" to me :) [...]