From: Kevin Day Date: Tue, 20 Mar 2012 03:25:45 +0000 (-0500) Subject: Bugfix: remove default from switch to avoid returning f_unknown X-Git-Tag: 0.3.0~59 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b7a6d8e9fa366f7d4a6eae15aa2f76468f694d04;p=fll 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. --- 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_