From: Kevin Day Date: Thu, 14 Jan 2021 04:51:09 +0000 (-0600) Subject: Bugfix: recent changes in macro structures broke iki_read. X-Git-Tag: 0.5.3~123 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=63af75aac8c7821c7843d8097aed21a6f57add61;p=fll Bugfix: recent changes in macro structures broke iki_read. --- diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index 290b125..44543d6 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -173,50 +173,11 @@ extern "C" { #define iki_read_macro_substitutions_t_clear(replacements) f_macro_memory_structure_clear(replacements) - #define iki_read_macro_substitutions_t_delete_simple(replacements) \ - replacements.used = replacements.size; \ - while (replacements.used) { \ - replacements.used--; \ - f_macro_memory_structure_delete_simple(replacements.array[replacements.used], iki_read_substitution_t) \ - } \ - if (!replacements.used) f_macro_memory_structure_delete_simple(replacements, iki_read_substitution_t) - - #define iki_read_macro_substitutions_t_destroy_simple(replacements) \ - replacements.used = replacements.size; \ - while (replacements.used) { \ - replacements.used--; \ - f_macro_memory_structure_delete_simple(replacements.array[replacements.used], iki_read_substitution_t) \ - } \ - if (!replacements.used) f_macro_memory_structure_destroy_simple(replacements, iki_read_substitution_t) - - #define iki_read_macro_substitutions_t_resize(status, replacements, new_length) \ - status = F_none; \ - if (new_length < replacements.size) { \ - f_array_length_t i = replacements.size - new_length; \ - for (; i < replacements.size; i++) { \ - f_macro_memory_structure_delete_simple(replacements.array[i], iki_read_substitution_t) \ - } \ - } \ - if (status == F_none) status = f_memory_resize((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ - if (status == F_none) { \ - replacements.size = new_length; \ - if (replacements.used > replacements.size) replacements.used = new_length; \ - } + #define iki_read_macro_substitutions_t_delete_simple(replacements) f_macro_memory_structure_delete_simple(replacements, iki_read_substitution_t) + #define iki_read_macro_substitutions_t_destroy_simple(replacements) f_macro_memory_structure_destroy_simple(replacements, iki_read_substitution_t) - // @fixme - #define iki_read_macro_substitutions_t_adjust(status, replacements, new_length) \ - status = F_none; \ - if (new_length < replacements.size) { \ - f_array_length_t i = replacements.size - new_length; \ - for (; i < replacements.size; i++) { \ - f_macro_memory_structure_delete_simple(replacements.array[i], iki_read_substitution_t) \ - } \ - } \ - if (status == F_none) status = f_memory_adjust((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ - if (status == F_none) { \ - replacements.size = new_length; \ - if (replacements.used > replacements.size) replacements.used = new_length; \ - } + #define iki_read_macro_substitutions_t_resize(status, replacements, length) f_macro_memory_structure_resize(status, replacements, iki_read_substitution_t, length) + #define iki_read_macro_substitutions_t_adjust(status, replacements, length) f_macro_memory_structure_adjust(status, replacements, iki_read_substitution_t, length) #endif // _di_iki_read_substitutions_t_ #ifndef _di_iki_read_data_t_