From b7a6d8e9fa366f7d4a6eae15aa2f76468f694d04 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 19 Mar 2012 22:25:45 -0500 Subject: [PATCH] Bugfix: remove default from switch to avoid returning f_unknown While it is good practice to always have a default: in switch, I believe this is a case where it is not. Do not provide a default switch so that the default return statement is always false. This prevents having to return f_unknown at the end of the function as it is now possible to get to the end of the function. --- level_1/fl_errors/c/errors.c | 10 ++-------- level_2/fll_fss/c/fss_errors.c | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/level_1/fl_errors/c/errors.c b/level_1/fl_errors/c/errors.c index d13d7ad..0168c8c 100644 --- a/level_1/fl_errors/c/errors.c +++ b/level_1/fl_errors/c/errors.c @@ -347,12 +347,9 @@ extern "C"{ case f_none_on_stop: return f_true; #endif // _di_f_errors_buffers_ - - default: - return f_false; } - return f_unknown; + return f_false; } #endif // _di_fl_errors_is_warning_ @@ -385,12 +382,9 @@ extern "C"{ case f_greater_than: return f_true; #endif // _di_fl_errors_non_ - - default: - return f_false; } - return f_unknown; + return f_false; } #endif // _di_fl_errors_is_okay_ diff --git a/level_2/fll_fss/c/fss_errors.c b/level_2/fll_fss/c/fss_errors.c index 1c66e7f..ab9bcff 100644 --- a/level_2/fll_fss/c/fss_errors.c +++ b/level_2/fll_fss/c/fss_errors.c @@ -100,12 +100,9 @@ extern "C"{ case f_none_on_stop: return f_true; #endif // _di_f_errors_buffers_ - - default: - return f_false; } - return f_unknown; + return f_false; } #endif // _di_fll_fss_errors_is_warning_ @@ -136,12 +133,9 @@ extern "C"{ case f_greater_than: return f_true; #endif // _di_fll_fss_errors_non_ - - default: - return f_false; } - return f_unknown; + return f_false; } #endif // _di_fll_fss_errors_is_okay_ -- 1.8.3.1