From: Kevin Day Date: Fri, 1 Jan 2021 20:20:13 +0000 (-0600) Subject: Cleanup: use correct parameter checking levels. X-Git-Tag: 0.5.3~142 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=3b2752dff25d5776c49ca5e10454084e9f2841df;p=fll Cleanup: use correct parameter checking levels. There are some cases where the code is using the wrong level define when wrapping parameter checking. --- diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index e8447cf..9d141b8 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -316,9 +316,9 @@ extern "C" { #ifndef _di_fl_directory_path_pop_ f_return_status fl_directory_path_pop(f_string_static_t *path) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_1_parameter_checking_ if (path->used > path->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_1_parameter_checking_ if (!path->used) { return F_data_not; @@ -388,10 +388,10 @@ extern "C" { #ifndef _di_fl_directory_path_push_ f_return_status fl_directory_path_push(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_1_parameter_checking_ if (!source) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_1_parameter_checking_ if (!length) { return F_data_not; @@ -403,10 +403,10 @@ extern "C" { #ifndef _di_fl_directory_path_push_dynamic_ f_return_status fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_1_parameter_checking_ if (source.used > source.size) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_1_parameter_checking_ if (!source.used) { return F_data_not; diff --git a/level_2/fll_fss/c/fss_embedded_list.c b/level_2/fll_fss/c/fss_embedded_list.c index 2e2a146..77735f2 100644 --- a/level_2/fll_fss/c/fss_embedded_list.c +++ b/level_2/fll_fss/c/fss_embedded_list.c @@ -6,12 +6,12 @@ extern "C" { #ifndef _di_fll_fss_embedded_list_read_ f_return_status fll_fss_embedded_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_nest_t *nest, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) { - #ifndef _di_level_3_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!nest) return F_status_set_error(F_parameter); if (!objects_delimits) return F_status_set_error(F_parameter); if (!comments) return F_status_set_error(F_parameter); - #endif // _di_level_3_parameter_checking_ + #endif // _di_level_2_parameter_checking_ f_status_t status = F_none; f_status_t status2 = F_none; diff --git a/level_2/fll_fss/c/fss_status.c b/level_2/fll_fss/c/fss_status.c index 85c503c..5f96ab5 100644 --- a/level_2/fll_fss/c/fss_status.c +++ b/level_2/fll_fss/c/fss_status.c @@ -6,9 +6,9 @@ extern "C" { #ifndef _di_fll_fss_status_from_string_ f_return_status fll_fss_status_from_string(const f_string_t string, f_status_t *code) { - #ifndef _di_level_1_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (!code) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ + #endif // _di_level_2_parameter_checking_ f_status_t status = F_none; const f_string_length_t length = strlen(string); diff --git a/level_2/fll_iki/c/iki.c b/level_2/fll_iki/c/iki.c index 6f4e88f..0092496 100644 --- a/level_2/fll_iki/c/iki.c +++ b/level_2/fll_iki/c/iki.c @@ -7,11 +7,11 @@ extern "C" { #ifndef _di_fll_iki_content_escape_ f_return_status fll_iki_content_escape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (content.used > content.size) return F_status_set_error(F_parameter); if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter); if (escaped->used > escaped->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_2_parameter_checking_ const f_string_range_t range = f_macro_string_range_t_initialize(content.used); @@ -21,13 +21,13 @@ extern "C" { #ifndef _di_fll_iki_content_partial_escape_ f_return_status fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (content.used > content.size) return F_status_set_error(F_parameter); if (range.start > range.stop) return F_status_set_error(F_parameter); if (range.start >= content.used) return F_status_set_error(F_parameter); if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter); if (escaped->used > escaped->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_2_parameter_checking_ return private_fll_iki_content_partial_escape(content, range, quote, escaped); } @@ -35,11 +35,11 @@ extern "C" { #ifndef _di_fll_iki_content_escape_un_ f_return_status fll_iki_content_escape_un(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (content.used > content.size) return F_status_set_error(F_parameter); if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter); if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_2_parameter_checking_ const f_string_range_t range = f_macro_string_range_t_initialize(content.used); @@ -49,13 +49,13 @@ extern "C" { #ifndef _di_fll_iki_content_partial_escape_un_ f_return_status fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) { - #ifndef _di_level_0_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (content.used > content.size) return F_status_set_error(F_parameter); if (range.start > range.stop) return F_status_set_error(F_parameter); if (range.start >= content.used) return F_status_set_error(F_parameter); if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter); if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter); - #endif // _di_level_0_parameter_checking_ + #endif // _di_level_2_parameter_checking_ return private_fll_iki_content_partial_escape_un(content, range, quote, unescaped); } diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index 419dd1f..c02570c 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -6,9 +6,9 @@ extern "C" { #ifndef _di_fll_status_from_string_ f_return_status fll_status_from_string(const f_string_t string, f_status_t *code) { - #ifndef _di_level_1_parameter_checking_ + #ifndef _di_level_2_parameter_checking_ if (!code) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ + #endif // _di_level_2_parameter_checking_ f_status_t status = F_none; const f_string_length_t length = strlen(string);