From: Kevin Day Date: Fri, 15 Jan 2021 02:22:52 +0000 (-0600) Subject: Cleanup: update f_memory function structure to follow more recent practices. X-Git-Tag: 0.5.3~122 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=6e5c23eacb668a61561f54bba9b03fdd6f4a6055;p=fll Cleanup: update f_memory function structure to follow more recent practices. The more recent practices being followed are having constants on the left and pointers on the right. The f_memory functions appear to be well followed and the update to this turned out pretty easy. Despite how many things depend on memory operations in this project, there is actually very little to change. I consider this a small victory in how my project is designed and intended to be used. --- diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index 8234df6..60e6718 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -146,7 +146,7 @@ extern "C" { // There is no reason to include "." and ".." in the directory listing. if (!strncmp(listing[i]->d_name, "..", 3) || !strncmp(listing[i]->d_name, ".", 2)) { - f_memory_delete((void **) & listing[i], sizeof(char *), size); + f_memory_delete(size, sizeof(char *), (void **) & listing[i]); continue; } @@ -162,14 +162,14 @@ extern "C" { memcpy(names->array[names->used].string, listing[i]->d_name, size); names->array[names->used++].used = size; - f_memory_delete((void **) & listing[i], sizeof(char *), size); + f_memory_delete(size, sizeof(char *), (void **) & listing[i]); } // for for (; i < length; i++) { - f_memory_delete((void **) & listing[i], sizeof(char *), size); + f_memory_delete(size, sizeof(char *), (void **) & listing[i]); } // for - f_memory_delete((void **) & listing, sizeof(struct dirent *), 1); + f_memory_delete(1, sizeof(struct dirent *), (void **) & listing); if (F_status_is_error(status)) return status; if (!length) return F_data_not; diff --git a/level_0/f_directory/c/directory_type.h b/level_0/f_directory/c/directory_type.h index 12e6e88..6958fa9 100644 --- a/level_0/f_directory/c/directory_type.h +++ b/level_0/f_directory/c/directory_type.h @@ -127,7 +127,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ + if (status == F_none) status = f_memory_resize(structures.size, new_length, sizeof(f_directory_status_t), (void **) & structures.array); \ if (status == F_none) { \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ @@ -141,7 +141,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ + if (status == F_none) status = f_memory_adjust(structures.size, new_length, sizeof(f_directory_status_t), (void **) & structures.array); \ if (status == F_none) { \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ @@ -154,7 +154,7 @@ extern "C" { f_macro_directory_status_t_delete_simple(structures.array[structures.used]); \ } \ if (!structures.size) { \ - if (f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, 0)) { \ + if (f_memory_resize(structures.size, 0, sizeof(f_directory_status_t), (void **) & structures.array)) { \ structures.size = 0; \ } \ } @@ -166,7 +166,7 @@ extern "C" { f_macro_directory_status_t_destroy_simple(structures.array[structures.used]); \ } \ if (!structures.size) { \ - if (f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, 0)) { \ + if (f_memory_adjust(structures.size, 0, sizeof(f_directory_status_t), (void **) & structures.array)) { \ structures.size = 0; \ } \ } diff --git a/level_0/f_fss/c/fss_comment.h b/level_0/f_fss/c/fss_comment.h index 71124b7..882aa45 100644 --- a/level_0/f_fss/c/fss_comment.h +++ b/level_0/f_fss/c/fss_comment.h @@ -27,8 +27,8 @@ extern "C" { * An array of f_fss_comment_t. * * array: the array of fss quote. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_fss_comments_t_ typedef f_string_ranges_t f_fss_comments_t; @@ -53,8 +53,8 @@ extern "C" { * An array of f_fss_comments_t. * * array: the array of fss quotes. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_fss_commentss_t_ typedef f_string_rangess_t f_fss_commentss_t; diff --git a/level_0/f_fss/c/fss_delimit.h b/level_0/f_fss/c/fss_delimit.h index fc1eb8b..078f0c9 100644 --- a/level_0/f_fss/c/fss_delimit.h +++ b/level_0/f_fss/c/fss_delimit.h @@ -27,8 +27,8 @@ extern "C" { * An array of f_fss_delimit_t. * * array: the array of fss quote. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_fss_delimits_t_ typedef f_string_lengths_t f_fss_delimits_t; @@ -53,8 +53,8 @@ extern "C" { * An array of f_fss_delimits_t. * * array: the array of fss quotes. - * size: total amount of allocated space. - * used: total number of allocated spaces used. + * size: total amount of allocated space. + * used: total number of allocated spaces used. */ #ifndef _di_f_fss_delimitss_t_ typedef f_string_lengthss_t f_fss_delimitss_t; diff --git a/level_0/f_fss/c/private-fss.c b/level_0/f_fss/c/private-fss.c index 391095d..0c64e2d 100644 --- a/level_0/f_fss/c/private-fss.c +++ b/level_0/f_fss/c/private-fss.c @@ -13,7 +13,7 @@ extern "C" { f_macro_fss_item_t_adjust(status, items->array[i], 0) } // for - status = f_memory_adjust((void **) & items->array, sizeof(f_fss_item_t), items->size, length); + status = f_memory_adjust(items->size, length, sizeof(f_fss_item_t), (void **) & items->array); if (F_status_is_error_not(status)) { items->size = length; @@ -35,7 +35,7 @@ extern "C" { f_macro_fss_item_t_resize(status, items->array[i], 0) } // for - status = f_memory_resize((void **) & items->array, sizeof(f_fss_item_t), items->size, length); + status = f_memory_resize(items->size, length, sizeof(f_fss_item_t), (void **) & items->array); if (F_status_is_error_not(status)) { items->size = length; @@ -90,7 +90,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & nameds->array, sizeof(f_fss_named_t), nameds->size, length); + status = f_memory_adjust(nameds->size, length, sizeof(f_fss_named_t), (void **) & nameds->array); if (F_status_is_error_not(status)) { nameds->size = length; @@ -113,7 +113,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & nameds->array, sizeof(f_fss_named_t), nameds->size, length); + status = f_memory_resize(nameds->size, length, sizeof(f_fss_named_t), (void **) & nameds->array); if (F_status_is_error_not(status)) { nameds->size = length; @@ -136,7 +136,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & nest->depth, sizeof(f_fss_items_t), nest->size, length); + status = f_memory_adjust(nest->size, length, sizeof(f_fss_items_t), (void **) & nest->depth); if (F_status_is_error_not(status)) { nest->size = length; @@ -159,7 +159,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & nest->depth, sizeof(f_fss_items_t), nest->size, length); + status = f_memory_resize(nest->size, length, sizeof(f_fss_items_t), (void **) & nest->depth); if (F_status_is_error_not(status)) { nest->size = length; @@ -182,7 +182,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & nests->array, sizeof(f_fss_nest_t), nests->size, length); + status = f_memory_adjust(nests->size, length, sizeof(f_fss_nest_t), (void **) & nests->array); if (F_status_is_error_not(status)) { nests->size = length; @@ -205,7 +205,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & nests->array, sizeof(f_fss_nest_t), nests->size, length); + status = f_memory_resize(nests->size, length, sizeof(f_fss_nest_t), (void **) & nests->array); if (F_status_is_error_not(status)) { nests->size = length; @@ -302,7 +302,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & set_quotes->array, sizeof(f_fss_set_quote_t), set_quotes->size, length); + status = f_memory_adjust(set_quotes->size, length, sizeof(f_fss_set_quote_t), (void **) & set_quotes->array); if (F_status_is_error_not(status)) { set_quotes->size = length; @@ -335,7 +335,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & set_quotes->array, sizeof(f_fss_set_quote_t), set_quotes->size, length); + status = f_memory_resize(set_quotes->size, length, sizeof(f_fss_set_quote_t), (void **) & set_quotes->array); if (F_status_is_error_not(status)) { set_quotes->size = length; @@ -362,7 +362,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - f_memory_adjust((void **) & sets->array, sizeof(f_fss_set_t), sets->size, length); + f_memory_adjust(sets->size, length, sizeof(f_fss_set_t), (void **) & sets->array); if (F_status_is_error_not(status)) { sets->size = length; @@ -389,7 +389,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & sets->array, sizeof(f_fss_set_t), sets->size, length); + status = f_memory_resize(sets->size, length, sizeof(f_fss_set_t), (void **) & sets->array); if (F_status_is_error_not(status)) { sets->size = length; diff --git a/level_0/f_memory/c/memory.c b/level_0/f_memory/c/memory.c index 80529e4..38ae773 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_f_memory_adjust_ - f_status_t f_memory_adjust(void **pointer, const size_t size, const size_t old_length, const size_t new_length) { + f_status_t f_memory_adjust(const size_t old_length, const size_t new_length, const size_t size, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); @@ -21,7 +21,7 @@ extern "C" { #endif // _di_f_memory_adjust_-#ifndef _di_f_memory_delete_ #ifndef _di_f_memory_delete_ - f_status_t f_memory_delete(void **pointer, const size_t size, const size_t length) { + f_status_t f_memory_delete(const size_t length, const size_t size, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!pointer) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -45,7 +45,7 @@ extern "C" { #endif // _di_f_memory_delete_ #ifndef _di_f_memory_destroy_ - f_status_t f_memory_destroy(void **pointer, const size_t size, const size_t length) { + f_status_t f_memory_destroy(const size_t length, const size_t size, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); @@ -70,7 +70,7 @@ extern "C" { #endif // _di_f_memory_destroy_ #ifndef _di_f_memory_new_ - f_status_t f_memory_new(void **pointer, const size_t size, const size_t length) { + f_status_t f_memory_new(const size_t length, const size_t size, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); @@ -98,7 +98,7 @@ extern "C" { #ifndef _di_f_memory_new_aligned_ - f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length) { + f_status_t f_memory_new_aligned(const size_t length, const size_t alignment, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!alignment) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); @@ -124,7 +124,7 @@ extern "C" { #endif // _di_f_memory_new_aligned_ #ifndef _di_f_memory_resize_ - f_status_t f_memory_resize(void **pointer, const size_t size, const size_t old_length, const size_t new_length) { + f_status_t f_memory_resize(const size_t old_length, const size_t new_length, const size_t size, void **pointer) { #ifndef _di_level_0_parameter_checking_ if (!size) return F_status_set_error(F_parameter); if (!pointer) return F_status_set_error(F_parameter); diff --git a/level_0/f_memory/c/memory.h b/level_0/f_memory/c/memory.h index 4b088c0..685ae1d 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -36,14 +36,14 @@ extern "C" { * * Will change all data to 0 prior to deallocation. * - * @param pointer - * A pointer to the address that will be resized. - * @param size - * The block size, in bytes (size * length = allocated size). * @param old_length * The total number of blocks representing the length to be resized from. * @param new_length * The total number of blocks representing the length to be resized to. + * @param size + * The block size, in bytes (size * length = allocated size). + * @param pointer + * A pointer to the address that will be resized. * * @return * F_none on success. @@ -57,7 +57,7 @@ extern "C" { * @see realloc() */ #ifndef _di_f_memory_adjust_ - extern f_status_t f_memory_adjust(void **pointer, const size_t size, const size_t old_length, const size_t new_length); + extern f_status_t f_memory_adjust(const size_t old_length, const size_t new_length, const size_t size, void **pointer); #endif // _di_f_memory_adjust_ /** @@ -67,14 +67,14 @@ extern "C" { * * Type and length are not normally used by this function but must be provided for the cases when f_memory_delete is swapped with f_memory_destroy (or vice-versa). * - * @param pointer - * A pointer to the address that will be freed. - * @param size - * The block size, in bytes (size * length = allocated size). - * If size is 0 then no delete is performed. * @param length * The total number of blocks to be allocated. * If length is 0 then no delete is performed. + * @param size + * The block size, in bytes (size * length = allocated size). + * If size is 0 then no delete is performed. + * @param pointer + * A pointer to the address that will be freed. * * @return * F_none on success. @@ -85,7 +85,7 @@ extern "C" { * @see free() */ #ifndef _di_f_memory_delete_ - extern f_status_t f_memory_delete(void **pointer, const size_t size, const size_t length); + extern f_status_t f_memory_delete(const size_t length, const size_t size, void **pointer); #endif // _di_f_memory_delete_ /** @@ -93,14 +93,14 @@ extern "C" { * * Will change all data to 0 prior to deallocation. * - * @param pointer - * A pointer to the address that will be freed. - * @param size - * The block size, in bytes (size * length = allocated size). - * If size is 0 then no delete is performed. * @param length * The total number of blocks to be allocated. * If length is 0 then no delete is performed. + * @param size + * The block size, in bytes (size * length = allocated size). + * If size is 0 then no delete is performed. + * @param pointer + * A pointer to the address that will be freed. * * @return * F_none on success. @@ -112,7 +112,7 @@ extern "C" { * @see memset() */ #ifndef _di_f_memory_destroy_ - extern f_status_t f_memory_destroy(void **pointer, const size_t size, const size_t length); + extern f_status_t f_memory_destroy(const size_t length, const size_t size, void **pointer); #endif // _di_f_memory_destroy_ /** @@ -138,21 +138,21 @@ extern "C" { * @see memset() */ #ifndef _di_f_memory_new_ - extern f_status_t f_memory_new(void **pointer, const size_t size, const size_t length); + extern f_status_t f_memory_new(const size_t length, const size_t size, void **pointer); #endif // _di_f_memory_new_ /** * Create some dynamically allocated array of some length, guaranteeing aligned memory. * - * @param pointer - * A pointer that will be updated to the address of the newly allocated memory. - * @param alignment - * The size of the alignment, such as sizeof(void *). - * Must be greater than 0. * @param length * The total number of blocks to be allocated. * Must be greater than 0. * Must be a multiple of alignment. + * @param alignment + * The size of the alignment, such as sizeof(void *). + * Must be greater than 0. + * @param pointer + * A pointer that will be updated to the address of the newly allocated memory. * * @return * F_none on success. @@ -165,7 +165,7 @@ extern "C" { * @see memset() */ #ifndef _di_f_memory_new_aligned_ - extern f_status_t f_memory_new_aligned(void **pointer, const size_t alignment, const size_t length); + extern f_status_t f_memory_new_aligned(const size_t length, const size_t alignment, void **pointer); #endif // _di_f_memory_new_aligned_ /** @@ -173,14 +173,14 @@ extern "C" { * * Will not change any of the data prior to deallocation. * - * @param pointer - * A pointer to the address that will be resized. - * @param size - * The block size, in bytes (size * length = allocated size). * @param old_length * The total number of blocks representing the length to be resized from. * @param new_length * The total number of blocks representing the length to be resized to. + * @param size + * The block size, in bytes (size * length = allocated size). + * @param pointer + * A pointer to the address that will be resized. * * @return * F_none on success. @@ -194,7 +194,7 @@ extern "C" { * @see realloc() */ #ifndef _di_f_memory_resize_ - extern f_status_t f_memory_resize(void **pointer, const size_t size, const size_t old_length, const size_t new_length); + extern f_status_t f_memory_resize(const size_t old_length, const size_t new_length, const size_t size, void **pointer); #endif // _di_f_memory_resize_ #ifdef __cplusplus diff --git a/level_0/f_string/c/private-string.c b/level_0/f_string/c/private-string.c index d9b06d3..0c65b70 100644 --- a/level_0/f_string/c/private-string.c +++ b/level_0/f_string/c/private-string.c @@ -8,7 +8,7 @@ extern "C" { #if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) f_status_t private_f_string_dynamic_adjust(const f_string_length_t length, f_string_dynamic_t *dynamic) { - f_status_t status = f_memory_adjust((void **) & dynamic->string, sizeof(f_string_t), dynamic->size, length); + f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string); if (F_status_is_error_not(status)) { dynamic->size = length; @@ -107,7 +107,7 @@ extern "C" { #if !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) f_status_t private_f_string_dynamic_resize(const f_string_length_t length, f_string_dynamic_t *dynamic) { - const f_status_t status = f_memory_resize((void **) & dynamic->string, sizeof(f_string_t), dynamic->size, length); + const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string); if (F_status_is_error_not(status)) { dynamic->size = length; @@ -130,7 +130,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & dynamics->array, sizeof(f_string_dynamic_t), dynamics->size, length); + status = f_memory_adjust(dynamics->size, length, sizeof(f_string_dynamic_t), (void **) & dynamics->array); if (F_status_is_error_not(status)) { dynamics->size = length; @@ -153,7 +153,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & dynamics->array, sizeof(f_string_dynamic_t), dynamics->size, length); + status = f_memory_resize(dynamics->size, length, sizeof(f_string_dynamic_t), (void **) & dynamics->array); if (F_status_is_error_not(status)) { dynamics->size = length; @@ -180,7 +180,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & map_multis->array, sizeof(f_string_map_multi_t), map_multis->size, length); + status = f_memory_adjust(map_multis->size, length, sizeof(f_string_map_multi_t), (void **) & map_multis->array); if (F_status_is_error_not(status)) { map_multis->size = length; @@ -207,7 +207,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & map_multis->array, sizeof(f_string_map_multi_t), map_multis->size, length); + status = f_memory_resize(map_multis->size, length, sizeof(f_string_map_multi_t), (void **) & map_multis->array); if (F_status_is_error_not(status)) { map_multis->size = length; @@ -234,7 +234,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & maps->array, sizeof(f_string_map_t), maps->size, length); + status = f_memory_adjust(maps->size, length, sizeof(f_string_map_t), (void **) & maps->array); if (F_status_is_error_not(status)) { maps->size = length; @@ -261,7 +261,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & maps->array, sizeof(f_string_map_t), maps->size, length); + status = f_memory_resize(maps->size, length, sizeof(f_string_map_t), (void **) & maps->array); if (F_status_is_error_not(status)) { maps->size = length; @@ -369,7 +369,7 @@ extern "C" { #if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_) f_status_t private_f_string_quantitys_adjust(const f_string_length_t length, f_string_quantitys_t *quantitys) { - const f_status_t status = f_memory_adjust((void **) & quantitys->array, sizeof(f_string_quantity_t), quantitys->size, length); + const f_status_t status = f_memory_adjust(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array); if (F_status_is_error_not(status)) { quantitys->size = length; @@ -386,7 +386,7 @@ extern "C" { #if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_) f_status_t private_f_string_quantitys_resize(const f_string_length_t length, f_string_quantitys_t *quantitys) { - const f_status_t status = f_memory_resize((void **) & quantitys->array, sizeof(f_string_quantity_t), quantitys->size, length); + const f_status_t status = f_memory_resize(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array); if (F_status_is_error_not(status)) { quantitys->size = length; @@ -409,7 +409,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & quantityss->array, sizeof(f_string_quantitys_t), quantityss->size, length); + status = f_memory_adjust(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array); if (F_status_is_error_not(status)) { quantityss->size = length; @@ -432,7 +432,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & quantityss->array, sizeof(f_string_quantitys_t), quantityss->size, length); + status = f_memory_resize(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array); if (F_status_is_error_not(status)) { quantityss->size = length; @@ -449,7 +449,7 @@ extern "C" { #if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_) f_status_t private_f_string_ranges_adjust(const f_string_length_t length, f_string_ranges_t *ranges) { - const f_status_t status = f_memory_adjust((void **) & ranges->array, sizeof(f_string_range_t), ranges->size, length); + const f_status_t status = f_memory_adjust(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array); if (F_status_is_error_not(status)) { ranges->size = length; @@ -466,7 +466,7 @@ extern "C" { #if !defined(_di_f_string_ranges_decrease_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_) f_status_t private_f_string_ranges_resize(const f_string_length_t length, f_string_ranges_t *ranges) { - const f_status_t status = f_memory_resize((void **) & ranges->array, sizeof(f_string_range_t), ranges->size, length); + const f_status_t status = f_memory_resize(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array); if (F_status_is_error_not(status)) { ranges->size = length; @@ -489,7 +489,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & rangess->array, sizeof(f_string_ranges_t), rangess->size, length); + status = f_memory_adjust(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array); if (F_status_is_error_not(status)) { rangess->size = length; @@ -512,7 +512,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & rangess->array, sizeof(f_string_ranges_t), rangess->size, length); + status = f_memory_resize(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array); if (F_status_is_error_not(status)) { rangess->size = length; @@ -542,7 +542,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_adjust((void **) & triples->array, sizeof(f_string_triple_t), triples->size, length); + status = f_memory_adjust(triples->size, length, sizeof(f_string_triple_t), (void **) & triples->array); if (F_status_is_error_not(status)) { triples->size = length; @@ -572,7 +572,7 @@ extern "C" { if (F_status_is_error(status)) return status; } // for - status = f_memory_resize((void **) & triples->array, sizeof(f_string_triple_t), triples->size, length); + status = f_memory_resize(triples->size, length, sizeof(f_string_triple_t), (void **) & triples->array); if (F_status_is_error_not(status)) { triples->size = length; diff --git a/level_0/f_string/c/string-common.h b/level_0/f_string/c/string-common.h index f7f2f11..743893f 100644 --- a/level_0/f_string/c/string-common.h +++ b/level_0/f_string/c/string-common.h @@ -36,11 +36,11 @@ extern "C" { #define f_macro_string_t_clear(string) string = 0; - #define f_macro_string_t_resize(status, string, length_old, length_new) status = f_memory_resize((void **) & string, sizeof(f_string_t), length_old, length_new); - #define f_macro_string_t_adjust(status, string, length_old, length_new) status = f_memory_adjust((void **) & string, sizeof(f_string_t), length_old, length_new); + #define f_macro_string_t_resize(status, string, length_old, length_new) status = f_memory_resize(length_old, length_new, sizeof(f_string_t), (void **) & string); + #define f_macro_string_t_adjust(status, string, length_old, length_new) status = f_memory_adjust(length_old, length_new, sizeof(f_string_t), (void **) & string); - #define f_macro_string_t_delete_simple(string, length) f_memory_resize((void **) & string, sizeof(f_string_t), length, 0); - #define f_macro_string_t_destroy_simple(string, length) f_memory_adjust((void **) & string, sizeof(f_string_t), length, 0); + #define f_macro_string_t_delete_simple(string, length) f_memory_resize(length, 0, sizeof(f_string_t), (void **) & string); + #define f_macro_string_t_destroy_simple(string, length) f_memory_adjust(length, 0, sizeof(f_string_t), (void **) & string); #endif // _di_f_string_t_ #ifndef _di_f_string_length_t_ diff --git a/level_0/f_utf/c/utf-common.h b/level_0/f_utf/c/utf-common.h index b013df2..2801e84 100644 --- a/level_0/f_utf/c/utf-common.h +++ b/level_0/f_utf/c/utf-common.h @@ -121,13 +121,13 @@ extern "C" { #define f_utf_string_t_initialize f_utf_character_t_eos - #define f_macro_utf_string_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_t), length); + #define f_macro_utf_string_t_new(status, string, length) status = f_memory_new(length, sizeof(f_utf_string_t), (void **) & string); - #define f_macro_utf_string_t_resize(status, string, old_length, new_length) status = f_memory_resize((void **) & string, sizeof(f_utf_string_t), old_length, new_length); - #define f_macro_utf_string_t_adjust(status, string, old_length, new_length) status = f_memory_adjust((void **) & string, sizeof(f_utf_string_t), old_length, new_length); + #define f_macro_utf_string_t_resize(status, string, old_length, new_length) status = f_memory_resize(old_length, new_length, sizeof(f_utf_string_t), (void **) & string); + #define f_macro_utf_string_t_adjust(status, string, old_length, new_length) status = f_memory_adjust(old_length, new_length, sizeof(f_utf_string_t), (void **) & string); - #define f_macro_utf_string_t_delete(status, string, size) status = f_memory_delete((void **) & string, sizeof(f_utf_string_t), size); - #define f_macro_utf_string_t_destroy(status, string, size) status = f_memory_destroy((void **) & string, sizeof(f_utf_string_t), size); + #define f_macro_utf_string_t_delete(status, string, size) status = f_memory_delete(size, sizeof(f_utf_string_t), (void **) & string); + #define f_macro_utf_string_t_destroy(status, string, size) status = f_memory_destroy(size, sizeof(f_utf_string_t), (void **) & string); #endif // _di_f_utf_string_t_ /** @@ -139,13 +139,13 @@ extern "C" { #define f_utf_string_length_t_size 0xfffffffffffffffe #define f_utf_string_length_t_size_max f_number_t_size_max_unsigned - #define f_macro_utf_string_length_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_length_t), length); + #define f_macro_utf_string_length_t_new(status, string, length) status = f_memory_new(length, sizeof(f_utf_string_length_t), (void **) & string); - #define f_macro_utf_string_length_t_resize(status, length, old_length, new_length) status = f_memory_resize((void **) & length, sizeof(f_utf_string_length_t), old_length, new_length); - #define f_macro_utf_string_length_t_adjust(status, length, old_length, new_length) status = f_memory_adjust((void **) & length, sizeof(f_utf_string_length_t), old_length, new_length); + #define f_macro_utf_string_length_t_resize(status, length, old_length, new_length) status = f_memory_resize(old_length, new_length, sizeof(f_utf_string_length_t), (void **) & length); + #define f_macro_utf_string_length_t_adjust(status, length, old_length, new_length) status = f_memory_adjust(old_length, new_length, sizeof(f_utf_string_length_t), (void **) & length); - #define f_macro_utf_string_length_t_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_utf_string_length_t), length); - #define f_macro_utf_string_length_t_destroy(status, string, size) status = f_memory_destroy((f_void_P *) & string, sizeof(f_utf_string_length_t), size); + #define f_macro_utf_string_length_t_delete(status, string, length) status = f_memory_delete(length, sizeof(f_utf_string_length_t), (void **) & string); + #define f_macro_utf_string_length_t_destroy(status, string, size) status = f_memory_destroy(size, sizeof(f_utf_string_length_t), (void **) & string); #endif // _di_f_utf_string_length_t_ /** @@ -197,13 +197,13 @@ extern "C" { #define f_macro_utf_string_range_t_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 } - #define f_macro_utf_string_range_t_new(status, utf_string_range, length) status = f_memory_new((void **) & utf_string_range, sizeof(f_utf_string_range_t), length); + #define f_macro_utf_string_range_t_new(status, utf_string_range, length) status = f_memory_new(length, sizeof(f_utf_string_range_t), (void **) & utf_string_range); - #define f_macro_utf_string_range_t_resize(status, utf_string_range, old_length, new_length) status = f_memory_resize((void **) & utf_string_range, sizeof(f_utf_string_range_t), old_length, new_length); - #define f_macro_utf_string_range_t_adjust(status, utf_string_range, old_length, new_length) status = f_memory_adjust((void **) & utf_string_range, sizeof(f_utf_string_range_t), old_length, new_length); + #define f_macro_utf_string_range_t_resize(status, utf_string_range, old_length, new_length) status = f_memory_resize(old_length, new_length, sizeof(f_utf_string_range_t), (void **) & utf_string_range); + #define f_macro_utf_string_range_t_adjust(status, utf_string_range, old_length, new_length) status = f_memory_adjust(old_length, new_length, sizeof(f_utf_string_range_t), (void **) & utf_string_range); - #define f_macro_utf_string_range_t_delete(status, utf_string_range, size) status = f_memory_delete((void **) & utf_string_range, sizeof(f_utf_string_range_t), size); - #define f_macro_utf_string_range_t_destroy(status, utf_string_range, size) status = f_memory_destroy((void **) & utf_string_range, sizeof(f_utf_string_range_t), size); + #define f_macro_utf_string_range_t_delete(status, utf_string_range, size) status = f_memory_delete(size, sizeof(f_utf_string_range_t), (void **) & utf_string_range); + #define f_macro_utf_string_range_t_destroy(status, utf_string_range, size) status = f_memory_destroy(size, sizeof(f_utf_string_range_t), (void **) & utf_string_range); #endif // _di_f_utf_string_range_t_ /** @@ -343,47 +343,47 @@ extern "C" { #define f_macro_utf_string_dynamic_t_new(status, dynamic, new_length) \ f_clear_utf_string_dynamic_t(dynamic) \ - status = f_memory_new((void **) & dynamic.string, sizeof(f_utf_string_t), new_length); \ + status = f_memory_new(new_length, sizeof(f_utf_string_t), (void **) & dynamic.string); \ if (status == F_none) { \ dynamic.size = new_length; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_t_resize(status, dynamic, new_length) \ - status = f_memory_resize((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size, new_length); \ + status = f_memory_resize(dynamic.size, new_length, sizeof(f_utf_string_t), (void **) & dynamic.string); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } #define f_macro_utf_string_dynamic_t_adjust(status, dynamic, new_length) \ - status = f_memory_adjust((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size, new_length); \ + status = f_memory_adjust(dynamic.size, new_length, sizeof(f_utf_string_t), (void **) & dynamic.string); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } #define f_macro_utf_string_dynamic_t_delete(status, dynamic) \ - status = f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ + status = f_memory_delete(dynamic.size, sizeof(f_utf_string_t), (void **) & dynamic.string); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_t_destroy(status, dynamic) \ - status = f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ + status = f_memory_destroy(dynamic.size, sizeof(f_utf_string_t), (void **) & dynamic.string); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_t_delete_simple(dynamic) \ - f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ + f_memory_delete(dynamic.size, sizeof(f_utf_string_t), (void **) & dynamic.string); \ dynamic.size = 0; \ dynamic.used = 0; #define f_macro_utf_string_dynamic_t_destroy_simple(dynamic) \ - f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ + f_memory_destroy(dynamic.size, sizeof(f_utf_string_t), (void **) & dynamic.string); \ dynamic.size = 0; \ dynamic.used = 0; #endif // _di_f_utf_string_dynamic_t_ @@ -413,7 +413,7 @@ extern "C" { dynamics.array = 0; \ dynamics.size = 0; \ dynamics.used = 0; \ - status = f_memory_new((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), length); \ + status = f_memory_new(length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array); \ if (status == F_none) { \ dynamics.size = length; \ dynamics.used = 0; \ @@ -427,7 +427,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_resize(dynamics.size, new_length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array); \ if (status == F_none) { \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ @@ -441,7 +441,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_adjust(dynamics.size, new_length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array); \ if (status == F_none) { \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ @@ -454,7 +454,7 @@ extern "C" { f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ if (F_status_is_error(status)) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ + if (status == F_none) status = f_memory_delete(dynamics.size, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array); \ if (status == F_none) dynamics.used = 0; #define f_macro_utf_string_dynamics_t_destroy(status, dynamics) \ @@ -464,7 +464,7 @@ extern "C" { f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ if (F_status_is_error(status)) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ + if (status == F_none) status = f_memory_destroy(dynamics.size, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array); \ if (status == F_none) dynamics.used = 0; #define f_macro_utf_string_dynamics_t_delete_simple(dynamics) \ @@ -473,7 +473,7 @@ extern "C" { dynamics.used--; \ f_macro_string_dynamic_t_delete_simple(dynamics.array[dynamics.used]); \ if (!dynamics.used) { \ - if (f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size)) { \ + if (f_memory_delete(dynamics.size, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array)) { \ dynamics.size = 0; \ } \ } \ @@ -485,7 +485,7 @@ extern "C" { dynamics.used--; \ f_macro_string_dynamic_t_destroy_simple(dynamics.array[dynamics.used]); \ if (!dynamics.used) { \ - if (f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size)) { \ + if (f_memory_destroy(dynamics.size, sizeof(f_utf_string_dynamic_t), (void **) & dynamics.array)) { \ dynamics.size = 0; \ } \ } \ diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index d78427c..ae4c833 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -484,7 +484,7 @@ extern "C" { // There is no reason to include "." and ".." in the directory listing. if (!strncmp(entity[i]->d_name, "..", 3) || !strncmp(entity[i]->d_name, ".", 2)) { - f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); + f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]); continue; } @@ -551,16 +551,16 @@ extern "C" { names->array[names->used].used = size; names->used++; - f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); + f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]); } // for closedir(parent); for (; i < length; i++) { - f_memory_resize((void **) & entity[i], sizeof(char *), 1, 0); + f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]); } // for - f_memory_resize((void **) & entity, sizeof(struct dirent *), 1, 0); + f_memory_resize(1, 0, sizeof(struct dirent *), (void **) & entity); if (F_status_is_error(status)) return status; if (!length) return F_data_not; diff --git a/level_3/controller/c/private-common.h b/level_3/controller/c/private-common.h index 53fa17a..5f931ec 100644 --- a/level_3/controller/c/private-common.h +++ b/level_3/controller/c/private-common.h @@ -366,7 +366,7 @@ extern "C" { actions.used--; \ controller_macro_rule_action_t_delete_simple(actions.array[actions.used]); \ } \ - f_memory_delete((void **) & actions.array, sizeof(controller_rule_action_t), actions.size); \ + f_memory_delete(actions.size, sizeof(controller_rule_action_t), (void **) & actions.array); \ actions.size = 0; #endif // _di_controller_rule_actions_t_ @@ -417,7 +417,7 @@ extern "C" { items.used--; \ controller_macro_rule_item_t_delete_simple(items.array[items.used]); \ } \ - f_memory_delete((void **) & items.array, sizeof(controller_rule_item_t), items.size); \ + f_memory_delete(items.size, sizeof(controller_rule_item_t), (void **) & items.array); \ items.size = 0; #endif // _di_controller_rule_items_t_ @@ -564,7 +564,7 @@ extern "C" { rules.used--; \ controller_macro_rule_t_delete_simple(rules.array[rules.used]); \ } \ - f_memory_delete((void **) & rules.array, sizeof(controller_rule_t), rules.size); \ + f_memory_delete(rules.size, sizeof(controller_rule_t), (void **) & rules.array); \ rules.size = 0; #endif // _di_controller_rules_t_ @@ -633,7 +633,7 @@ extern "C" { actions.used--; \ controller_macro_entry_action_t_delete_simple(actions.array[actions.used]); \ } \ - f_memory_resize((void **) & actions.array, sizeof(controller_entry_action_t), actions.size, 0); \ + f_memory_resize(actions.size, 0, sizeof(controller_entry_action_t), (void **) & actions.array); \ actions.size = 0; #endif // _di_controller_entry_actions_t_ @@ -678,7 +678,7 @@ extern "C" { items.used--; \ controller_macro_entry_item_t_delete_simple(items.array[items.used]); \ } \ - f_memory_delete((void **) & items.array, sizeof(controller_entry_item_t), items.size); \ + f_memory_delete(items.size, sizeof(controller_entry_item_t), (void **) & items.array); \ items.size = 0; #endif // _di_controller_entry_items_t_ diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index d7442e5..e1cc196 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -76,7 +76,7 @@ extern "C" { return F_status_set_error(F_array_too_large); } - const f_status_t status = f_memory_resize((void **) & actions->array, sizeof(controller_entry_action_t), actions->size, actions->used + amount); + const f_status_t status = f_memory_resize(actions->size, actions->used + amount, sizeof(controller_entry_action_t), (void **) & actions->array); if (F_status_is_error_not(status)) { actions->size = actions->used + amount; @@ -579,7 +579,7 @@ extern "C" { return F_status_set_error(F_array_too_large); } - const f_status_t status = f_memory_resize((void **) & items->array, sizeof(controller_entry_item_t), items->size, items->used + amount); + const f_status_t status = f_memory_resize(items->size, items->used + amount, sizeof(controller_entry_item_t), (void **) & items->array); if (F_status_is_error_not(status)) { items->size = items->used + amount; diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index 5eca06a..a6939e3 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -165,7 +165,7 @@ extern "C" { return F_status_set_error(F_array_too_large); } - const f_status_t status = f_memory_resize((void **) & actions->array, sizeof(controller_rule_action_t), actions->size, actions->used + amount); + const f_status_t status = f_memory_resize(actions->size, actions->used + amount, sizeof(controller_rule_action_t), (void **) & actions->array); if (F_status_is_error_not(status)) { actions->size = actions->used + amount; @@ -1098,7 +1098,7 @@ extern "C" { return F_status_set_error(F_array_too_large); } - const f_status_t status = f_memory_resize((void **) & items->array, sizeof(controller_rule_item_t), items->size, items->used + amount); + const f_status_t status = f_memory_resize(items->size, items->used + amount, sizeof(controller_rule_item_t), (void **) & items->array); if (F_status_is_error_not(status)) { items->size = items->used + amount; @@ -3802,7 +3802,7 @@ extern "C" { size = f_array_length_t_size; } - const f_status_t status = f_memory_resize((void **) & rules->array, sizeof(controller_rule_t), rules->size, size); + const f_status_t status = f_memory_resize(rules->size, size, sizeof(controller_rule_t), (void **) & rules->array); if (F_status_is_error_not(status)) { rules->size = size; diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h index e5c6da8..9b3bc04 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h @@ -88,7 +88,7 @@ extern "C" { fss_basic_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ @@ -102,7 +102,7 @@ extern "C" { fss_basic_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.h b/level_3/fss_basic_read/c/private-fss_basic_read.h index 7590e83..3e93d39 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.h +++ b/level_3/fss_basic_read/c/private-fss_basic_read.h @@ -100,7 +100,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ @@ -115,7 +115,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_basic_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h index e50dee5..daa598f 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h @@ -113,7 +113,7 @@ extern "C" { fss_embedded_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_embedded_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ @@ -127,7 +127,7 @@ extern "C" { fss_embedded_list_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_embedded_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_embedded_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h index 9b11e3e..a1d4db0 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h @@ -89,7 +89,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ @@ -104,7 +104,7 @@ extern "C" { if (F_status_is_error(status)) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_list_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.h b/level_3/fss_extended_read/c/private-fss_extended_read.h index 4374abb..0b7c41d 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.h +++ b/level_3/fss_extended_read/c/private-fss_extended_read.h @@ -88,7 +88,7 @@ extern "C" { fss_extended_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ @@ -102,7 +102,7 @@ extern "C" { fss_extended_read_macro_depth_t_delete_simple(depths.array[i]); \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust(depths.size, new_length, sizeof(fss_extended_read_depth_t), (void **) & depths.array); \ if (status == F_none) { \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \