From 0d66173e1ff70c2bc0c96fae12f5c438dba9af44 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 16 Nov 2013 20:14:32 +0100 Subject: [PATCH] WPrefs: Add case check to fix -Wmaybe-uninitialized warning The default case should not arise because the tested variable is an enum, but it the case someone would get a value wrong, we're safer with a little warning and proper fallback than with unknown behaviour. Signed-off-by: Christophe CURIS --- WPrefs.app/Expert.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 582013ef..e939df03 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -138,6 +138,13 @@ static void createPanel(Panel * p) state = WMGetUDBoolForKey(udb, expert_options[i].op_name); break; + default: +#ifdef DEBUG + wwarning("export_options[%d].class = %d, this should not happen\n", + i, expert_options[i].class); +#endif + state = expert_options[i].def_state; + break; } WMSetButtonSelected(panel->swi[i], state); } -- 2.11.4.GIT