[alsa-devel] [PATCH 7/7] pcm: add 'default' case for switch statement

Takashi Sakamoto o-takashi at sakamocchi.jp
Mon Jul 11 14:06:03 CEST 2016


This commit fixes below compiler warnings.

pcm_direct.c: In function ‘snd1_pcm_direct_prepare’:
pcm_direct.c:821:2: warning: enumeration value ‘SND_PCM_STATE_PREPARED’ not handled in switch [-Wswitch]
  switch (snd_pcm_state(dmix->spcm)) {
  ^

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 src/pcm/pcm_direct.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 21f98e7..a388d4a 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -830,6 +830,8 @@ int snd_pcm_direct_prepare(snd_pcm_t *pcm)
 	case SND_PCM_STATE_OPEN:
 	case SND_PCM_STATE_DISCONNECTED:
 		return -EBADFD;
+	default:
+		break;
 	}
 	snd_pcm_direct_check_interleave(dmix, pcm);
 	dmix->state = SND_PCM_STATE_PREPARED;
-- 
2.7.4



More information about the Alsa-devel mailing list