From 38c80b2b03dc357fbc28f8ba04764f1e1741078a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 16 Mar 2011 17:56:43 +0100 Subject: [PATCH] fade: Quiesce two gcc warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ubuntu Lucid's gcc 4.4.3 does not like it if not each possible value of an enumeration is handled in the body of a switch statement. Since gengetopt for some reason always creates an additional xxx_NULL value in options of type enum, this more or less means we have to introduce default: cases to avoid warnings of the form fade.c:113: warning: enumeration value ‘mixer_channel__NULL’ not handled in switch fade.c:346: warning: enumeration value ‘mode__NULL’ not handled in switch Fortunately, these are the only two warnings, so add default: cases to make gcc happy. --- fade.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fade.c b/fade.c index 8eeb79e7..5fbd0dd4 100644 --- a/fade.c +++ b/fade.c @@ -125,6 +125,7 @@ static void fixup_mixer_channel_arg(void) case mixer_channel_arg_reclev: val = SOUND_MIXER_RECLEV; break; case mixer_channel_arg_igain: val = SOUND_MIXER_IGAIN; break; case mixer_channel_arg_ogain: val = SOUND_MIXER_OGAIN; break; + default: break; } conf.mixer_channel_arg = val; } @@ -344,15 +345,15 @@ int main(int argc, char *argv[]) } fixup_mixer_channel_arg(); switch (conf.mode_arg) { - case mode_arg_sleep: - ret = sweet_dreams(); - break; case mode_arg_fade: ret = fade(conf.fade_vol_arg, conf.fade_time_arg); break; case mode_arg_snooze: ret = snooze(); break; + default: /* sleep mode */ + ret = sweet_dreams(); + break; } if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret)); -- 2.39.5