From a3df1304fb26204a85b45d6974c4474be5245bce Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 5 May 2010 08:41:37 +0000 Subject: [PATCH] fix build failure with gcc-4.5 due to stricter warnings with enum values in case statements git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1782 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/cmd/cmd_debug.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 2b8b06de..3c7e8870 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2010-05-05 Mike Frysinger + + * src/cmd/cmd_debug.c (string_to_log_level): Tweak the -1 sanity check to + avoid warnings from gcc about -1 not being an enum value. + 2010-02-16 Mike Frysinger * data/MANUFACTURERS: Use the official ADI name. diff --git a/urjtag/src/cmd/cmd_debug.c b/urjtag/src/cmd/cmd_debug.c index 96641940..8a37e6e2 100644 --- a/urjtag/src/cmd/cmd_debug.c +++ b/urjtag/src/cmd/cmd_debug.c @@ -62,6 +62,9 @@ string_to_log_level (const char *strlevel) static const char * log_level_to_string (urj_log_level_t level) { + /* sanity for string_to_log_level() return */ + if (level == -1) + goto case_default; switch (level) { case URJ_LOG_LEVEL_ALL: return "all"; case URJ_LOG_LEVEL_COMM: return "comm"; @@ -71,7 +74,7 @@ log_level_to_string (urj_log_level_t level) case URJ_LOG_LEVEL_WARNING: return "warning"; case URJ_LOG_LEVEL_ERROR: return "error"; case URJ_LOG_LEVEL_SILENT: return "silent"; - case -1: /* sanity for string_to_log_level() return */ + case_default: default: return "unknown"; } }