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"; } }