"Kővágó Zoltán" <dirty.ice...@gmail.com> writes: > 2015-06-17 10:01 keltezéssel, Markus Armbruster írta: >> "Kővágó, Zoltán" <dirty.ice...@gmail.com> 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 associated >>> values with the qapi generated AudioFormat enum. >>> >>> This patch is mostly a search-and-replace, except for switches where the >>> 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 = freq << (nchannels == 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 <<= 1; >>> break; >>> >>> - case AUD_FMT_S32: >>> - case AUD_FMT_U32: >>> + case AUDIO_FORMAT_S32: >>> + case AUDIO_FORMAT_U32: >>> bytes_per_sec <<= 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 :) [...]