From: Kevin Day Date: Sat, 19 Sep 2020 22:22:49 +0000 (-0500) Subject: Bugfix: incorrect macro implementations. X-Git-Tag: 0.5.1~75 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=868d2ac3c5352fcdcf700af952176866d9e66872;p=fll Bugfix: incorrect macro implementations. There are some cases where the wrong macro is being used. The init program needs to be updated to use the "_macro__i" instead of "i" for safety reasons. --- diff --git a/level_0/f_fss/c/fss-set.h b/level_0/f_fss/c/fss-set.h index 72bd804..d358132 100644 --- a/level_0/f_fss/c/fss-set.h +++ b/level_0/f_fss/c/fss-set.h @@ -334,15 +334,15 @@ extern "C" { } #define f_macro_fss_set_quoted_t_adjust(status, set, new_length) \ - f_macro_fss_objects_t_resize(status, set.objects, new_length) \ + f_macro_fss_objects_t_adjust(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_t_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_adjust(status, set.contents, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_t_resize(status, set.objects_quoted, new_length) \ + f_macro_fss_quoteds_t_adjust(status, set.objects_quoted, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_t_resize(status, set.contents_quoted, new_length) \ + f_macro_fss_quotedss_t_adjust(status, set.contents_quoted, new_length) \ } #endif // _di_f_fss_set_quoted_t_ diff --git a/level_0/f_iki/c/iki-common.h b/level_0/f_iki/c/iki-common.h index 14e14b3..a59801a 100644 --- a/level_0/f_iki/c/iki-common.h +++ b/level_0/f_iki/c/iki-common.h @@ -84,7 +84,7 @@ extern "C" { #define f_macro_iki_variable_t_destroy_simple(variable) f_macro_string_ranges_t_destroy_simple(variable) #define f_macro_iki_variable_t_resize(status, variable, new_length) f_macro_string_ranges_t_resize(status, variable, new_length) - #define f_macro_iki_variable_t_adjust(status, variable, new_length) f_macro_string_ranges_t_destroy(status, variable, new_length) + #define f_macro_iki_variable_t_adjust(status, variable, new_length) f_macro_string_ranges_t_adjust(status, variable, new_length) #endif // _di_iki_variable_t_ /** @@ -110,7 +110,7 @@ extern "C" { #define f_macro_iki_vocabulary_t_destroy_simple(vocabulary) f_macro_string_ranges_t_destroy_simple(vocabulary) #define f_macro_iki_vocabulary_t_resize(status, vocabulary, new_length) f_macro_string_ranges_t_resize(status, vocabulary, new_length) - #define f_macro_iki_vocabulary_t_adjust(status, vocabulary, new_length) f_macro_string_ranges_t_destroy(status, vocabulary, new_length) + #define f_macro_iki_vocabulary_t_adjust(status, vocabulary, new_length) f_macro_string_ranges_t_adjust(status, vocabulary, new_length) #endif // _di_iki_vocabulary_t_ /** diff --git a/level_3/init/c/private-init.h b/level_3/init/c/private-init.h index 26a9af2..09ba4a2 100644 --- a/level_3/init/c/private-init.h +++ b/level_3/init/c/private-init.h @@ -109,18 +109,18 @@ extern "C" { #define f_init_rules_resize(status, rules, new_length) \ status = F_none; \ if (new_length < rules.size) { \ - f_string_length_t i = rules.size - new_length; \ - for (; i < rules.size; i++) { \ - delete_init_rule(status, rules.array[i]); \ + f_string_length_t _macro__i = rules.size - new_length; \ + for (; _macro__i < rules.size; _macro__i++) { \ + delete_init_rule(status, rules.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ if (status == F_none) { \ if (new_length > rules.size) { \ - f_string_length_t i = rules.size; \ - for (; i < new_length; i++) { \ - memset(&rules.array[i], 0, sizeof(f_string_t)); \ + f_string_length_t _macro__i = rules.size; \ + for (; _macro__i < new_length; _macro__i++) { \ + memset(&rules.array[_macro__i], 0, sizeof(f_string_t)); \ } \ } \ rules.size = new_length; \ @@ -130,18 +130,18 @@ extern "C" { #define f_init_rules_adjust(status, rules, new_length) \ status = F_none; \ if (new_length < rules.size) { \ - f_string_length_t i = rules.size - new_length; \ - for (; i < rules.size; i++) { \ - destroy_init_rule(status, rules.array[i]); \ + f_string_length_t _macro__i = rules.size - new_length; \ + for (; _macro__i < rules.size; _macro__i++) { \ + destroy_init_rule(status, rules.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ if (status == F_none) { \ if (new_length > rules.size) { \ - f_string_length_t i = rules.size; \ - for (; i < new_length; i++) { \ - memset(&rules.array[i], 0, sizeof(init_rule)); \ + f_string_length_t _macro__i = rules.size; \ + for (; _macro__i < new_length; _macro__i++) { \ + memset(&rules.array[_macro__i], 0, sizeof(init_rule)); \ } \ } \ rules.size = new_length; \ @@ -209,18 +209,18 @@ extern "C" { #define f_init_categorys_resize(status, categorys, new_length) \ status = F_none; \ if (new_length < categorys.size) { \ - f_string_length_t i = categorys.size - new_length; \ - for (; i < categorys.size; i++) { \ - delete_init_category(status, categorys.array[i]); \ + f_string_length_t _macro__i = categorys.size - new_length; \ + for (; _macro__i < categorys.size; _macro__i++) { \ + delete_init_category(status, categorys.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ if (status == F_none) status = f_memory_resize((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ if (status == F_none) { \ if (new_length > categorys.size) { \ - f_string_length_t i = categorys.size; \ - for (; i < new_length; i++) { \ - memset(&categorys.array[i], 0, sizeof(f_string_t)); \ + f_string_length_t _macro__i = categorys.size; \ + for (; _macro__i < new_length; _macro__i++) { \ + memset(&categorys.array[_macro__i], 0, sizeof(f_string_t)); \ } \ } \ categorys.size = new_length; \ @@ -230,18 +230,18 @@ extern "C" { #define f_init_categorys_adjust(status, categorys, new_length) \ status = F_none; \ if (new_length < categorys.size) { \ - f_string_length_t i = categorys.size - new_length; \ - for (; i < categorys.size; i++) { \ - destroy_init_category(status, categorys.array[i]); \ + f_string_length_t _macro__i = categorys.size - new_length; \ + for (; _macro__i < categorys.size; _macro__i++) { \ + destroy_init_category(status, categorys.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ if (status == F_none) status = f_memory_adjust((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ if (status == F_none) { \ if (new_length > categorys.size) { \ - f_string_length_t i = categorys.size; \ - for (; i < new_length; i++) { \ - memset(&categorys.array[i], 0, sizeof(init_category)); \ + f_string_length_t _macro__i = categorys.size; \ + for (; _macro__i < new_length; _macro__i++) { \ + memset(&categorys.array[_macro__i], 0, sizeof(init_category)); \ } \ } \ categorys.size = new_length; \