From 1d4cbaa61f225650c54e2f2bc4ad19c7caaf81ea Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 2 Jan 2021 22:08:55 -0600 Subject: [PATCH] Cleanup: remove redundant memset() calls. The f_memory_*() functions already call memset() where appropriate. --- level_0/f_account/c/account-common.h | 10 --- level_0/f_directory/c/directory_type.h | 10 --- level_0/f_fss/c/fss_named.h | 10 --- level_0/f_fss/c/fss_nest.h | 30 -------- level_0/f_fss/c/fss_set.h | 20 ----- level_0/f_memory/c/memory_structure.h | 10 --- level_0/f_string/c/string_dynamic.h | 10 --- level_0/f_string/c/string_map.h | 20 ----- level_0/f_string/c/string_triple.h | 10 --- level_0/f_thread/c/thread-common.h | 90 ---------------------- level_0/f_utf/c/utf-common.h | 10 --- .../c/private-fss_basic_list_read.h | 12 --- level_3/fss_basic_read/c/private-fss_basic_read.h | 12 --- .../c/private-fss_embedded_list_read.h | 12 --- .../c/private-fss_extended_list_read.h | 12 --- .../c/private-fss_extended_read.h | 12 --- level_3/iki_read/c/iki_read.h | 12 --- 17 files changed, 302 deletions(-) diff --git a/level_0/f_account/c/account-common.h b/level_0/f_account/c/account-common.h index 8176234..ae27b7c 100644 --- a/level_0/f_account/c/account-common.h +++ b/level_0/f_account/c/account-common.h @@ -170,11 +170,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & accounts.array, sizeof(f_account_t), accounts.size, new_length); \ if (status == F_none) { \ - if (new_length > accounts.size) { \ - for (f_array_length_t _macro__i = accounts.size; _macro__i < new_length; _macro__i++) { \ - memset(&accounts.array[_macro__i], 0, sizeof(f_account_t)); \ - } \ - } \ accounts.size = new_length; \ if (accounts.used > accounts.size) accounts.used = new_length; \ } @@ -189,11 +184,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & accounts.array, sizeof(f_account_t), accounts.size, new_length); \ if (status == F_none) { \ - if (new_length > accounts.size) { \ - for (f_array_length_t _macro__i = accounts.size; _macro__i < new_length; _macro__i++) { \ - memset(&accounts.array[_macro__i], 0, sizeof(f_account_t)); \ - } \ - } \ accounts.size = new_length; \ if (accounts.used > accounts.size) accounts.used = new_length; \ } diff --git a/level_0/f_directory/c/directory_type.h b/level_0/f_directory/c/directory_type.h index c23345c..53f77b2 100644 --- a/level_0/f_directory/c/directory_type.h +++ b/level_0/f_directory/c/directory_type.h @@ -197,11 +197,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ if (status == F_none) { \ - if (new_length > structures.size) { \ - for (f_array_length_t _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(f_directory_status_t)); \ - } \ - } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } @@ -216,11 +211,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ if (status == F_none) { \ - if (new_length > structures.size) { \ - for (f_array_length_t _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(f_directory_status_t)); \ - } \ - } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } diff --git a/level_0/f_fss/c/fss_named.h b/level_0/f_fss/c/fss_named.h index 1a63dad..2262c51 100644 --- a/level_0/f_fss/c/fss_named.h +++ b/level_0/f_fss/c/fss_named.h @@ -227,11 +227,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_named_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_named_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } @@ -253,11 +248,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_named_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_named_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } diff --git a/level_0/f_fss/c/fss_nest.h b/level_0/f_fss/c/fss_nest.h index f271f8c..6df60b8 100644 --- a/level_0/f_fss/c/fss_nest.h +++ b/level_0/f_fss/c/fss_nest.h @@ -270,11 +270,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item_t), items.size, new_length); \ if (status == F_none) { \ - if (new_length > items.size) { \ - for (f_array_length_t _macro__i = items.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.array[_macro__i], 0, sizeof(f_fss_item_t)); \ - } \ - } \ items.size = new_length; \ if (items.used > items.size) items.used = new_length; \ } @@ -296,11 +291,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item_t), items.size, new_length); \ if (status == F_none) { \ - if (new_length > items.size) { \ - for (length_variable _macro__i = items.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.array[_macro__i], 0, sizeof(f_fss_item_t)); \ - } \ - } \ items.size = new_length; \ if (items.used > items.size) items.used = new_length; \ } @@ -438,11 +428,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items_t), nest.size, new_length); \ if (status == F_none) { \ - if (new_length > nest.size) { \ - for (f_array_length_t _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ - memset(&nest.depth[_macro__i], 0, sizeof(f_fss_items_t)); \ - } \ - } \ nest.size = new_length; \ if (nest.used > nest.size) nest.used = new_length; \ } @@ -464,11 +449,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item_t), nest.size, new_length); \ if (status == F_none) { \ - if (new_length > nest.size) { \ - for (f_array_length_t _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.depth[_macro__i], 0, sizeof(f_fss_item_t)); \ - } \ - } \ nest.size = new_length; \ if (nest.used > nest.size) nest.used = new_length; \ } @@ -601,11 +581,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest_t), nests.size, new_length); \ if (status == F_none) { \ - if (new_length > nests.size) { \ - for (f_array_length_t _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ - memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest_t)); \ - } \ - } \ nests.size = new_length; \ if (nests.used > nests.size) nests.used = new_length; \ } @@ -627,11 +602,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest_t), nests.size, new_length); \ if (status == F_none) { \ - if (new_length > nests.size) { \ - for (f_array_length_t _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ - memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest_t)); \ - } \ - } \ nests.size = new_length; \ if (nests.used > nests.size) nests.used = new_length; \ } diff --git a/level_0/f_fss/c/fss_set.h b/level_0/f_fss/c/fss_set.h index 0d2ac75..eb294d6 100644 --- a/level_0/f_fss/c/fss_set.h +++ b/level_0/f_fss/c/fss_set.h @@ -203,11 +203,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } @@ -229,11 +224,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } @@ -467,11 +457,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set_quote_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quote_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } @@ -493,11 +478,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set_quote_t), sets.size, new_length); \ if (status == F_none) { \ - if (new_length > sets.size) { \ - for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quote_t)); \ - } \ - } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } diff --git a/level_0/f_memory/c/memory_structure.h b/level_0/f_memory/c/memory_structure.h index fd4f5db..97f2b8e 100644 --- a/level_0/f_memory/c/memory_structure.h +++ b/level_0/f_memory/c/memory_structure.h @@ -275,11 +275,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type_structures), structures.size, new_length); \ if (status == F_none) { \ - if (new_length > structures.size) { \ - for (length_variable _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(type_structures)); \ - } \ - } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } @@ -306,11 +301,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(type_structures), structures.size, new_length); \ if (status == F_none) { \ - if (new_length > structures.size) { \ - for (length_variable _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(type_structures)); \ - } \ - } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } diff --git a/level_0/f_string/c/string_dynamic.h b/level_0/f_string/c/string_dynamic.h index 9e1b2d4..b44204b 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -206,11 +206,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ - if (new_length > dynamics.size) { \ - for (f_array_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic_t)); \ - } \ - } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } @@ -225,11 +220,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ - if (new_length > dynamics.size) { \ - for (f_array_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic_t)); \ - } \ - } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } diff --git a/level_0/f_string/c/string_map.h b/level_0/f_string/c/string_map.h index b2fa00a..5b8a5ba 100644 --- a/level_0/f_string/c/string_map.h +++ b/level_0/f_string/c/string_map.h @@ -139,11 +139,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_t), maps.size, new_length); \ if (status == F_none) { \ - if (new_length > maps.size) { \ - for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_t)); \ - } \ - } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } @@ -158,11 +153,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_t), maps.size, new_length); \ if (status == F_none) { \ - if (new_length > maps.size) { \ - for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_t)); \ - } \ - } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } @@ -284,11 +274,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, new_length); \ if (status == F_none) { \ - if (new_length > maps.size) { \ - for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi_t)); \ - } \ - } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } @@ -303,11 +288,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, new_length); \ if (status == F_none) { \ - if (new_length > maps.size) { \ - for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi_t)); \ - } \ - } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } diff --git a/level_0/f_string/c/string_triple.h b/level_0/f_string/c/string_triple.h index e4c12da..812d696 100644 --- a/level_0/f_string/c/string_triple.h +++ b/level_0/f_string/c/string_triple.h @@ -152,11 +152,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & triples.array, sizeof(f_string_triple_t), triples.size, new_length); \ if (status == F_none) { \ - if (new_length > triples.size) { \ - for (f_array_length_t _macro__i = triples.size; _macro__i < new_length; _macro__i++) { \ - memset(&triples.array[_macro__i], 0, sizeof(f_string_triple_t)); \ - } \ - } \ triples.size = new_length; \ if (triples.used > triples.size) triples.used = new_length; \ } @@ -171,11 +166,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & triples.array, sizeof(f_string_triple_t), triples.size, new_length); \ if (status == F_none) { \ - if (new_length > triples.size) { \ - for (f_array_length_t _macro__i = triples.size; _macro__i < new_length; _macro__i++) { \ - memset(&triples.array[_macro__i], 0, sizeof(f_string_triple_t)); \ - } \ - } \ triples.size = new_length; \ if (triples.used > triples.size) triples.used = new_length; \ } diff --git a/level_0/f_thread/c/thread-common.h b/level_0/f_thread/c/thread-common.h index aa0e126..76aad67 100644 --- a/level_0/f_thread/c/thread-common.h +++ b/level_0/f_thread/c/thread-common.h @@ -85,11 +85,6 @@ extern "C" { #define f_macro_thread_attributes_t_resize(status, attributes, new_length) \ status = f_memory_resize((void **) & attributes.array, sizeof(f_thread_attribute_t), attributes.size, new_length); \ if (status == F_none) { \ - if (new_length > attributes.size) { \ - for (f_array_length_t _macro__i = attributes.size; _macro__i < new_length; _macro__i++) { \ - memset(&attributes.array[_macro__i], 0, sizeof(f_thread_attribute_t)); \ - } \ - } \ attributes.size = new_length; \ if (attributes.used > attributes.size) attributes.used = new_length; \ } @@ -97,11 +92,6 @@ extern "C" { #define f_macro_thread_attributes_t_adjust(status, attributes, new_length) \ status = f_memory_adjust((void **) & attributes.array, sizeof(f_thread_attribute_t), attributes.size, new_length); \ if (status == F_none) { \ - if (new_length > attributes.size) { \ - for (f_array_length_t _macro__i = attributes.size; _macro__i < new_length; _macro__i++) { \ - memset(&attributes.array[_macro__i], 0, sizeof(f_thread_attribute_t)); \ - } \ - } \ attributes.size = new_length; \ if (attributes.used > attributes.size) attributes.used = new_length; \ } @@ -175,11 +165,6 @@ extern "C" { #define f_macro_thread_conditions_t_resize(status, conditions, new_length) \ status = f_memory_resize((void **) & conditions.array, sizeof(f_thread_condition_t), conditions.size, new_length); \ if (status == F_none) { \ - if (new_length > conditions.size) { \ - for (f_array_length_t _macro__i = conditions.size; _macro__i < new_length; _macro__i++) { \ - memset(&conditions.array[_macro__i], 0, sizeof(f_thread_condition_t)); \ - } \ - } \ conditions.size = new_length; \ if (conditions.used > conditions.size) conditions.used = new_length; \ } @@ -187,11 +172,6 @@ extern "C" { #define f_macro_thread_conditions_t_adjust(status, conditions, new_length) \ status = f_memory_adjust((void **) & conditions.array, sizeof(f_thread_condition_t), conditions.size, new_length); \ if (status == F_none) { \ - if (new_length > conditions.size) { \ - for (f_array_length_t _macro__i = conditions.size; _macro__i < new_length; _macro__i++) { \ - memset(&conditions.array[_macro__i], 0, sizeof(f_thread_condition_t)); \ - } \ - } \ conditions.size = new_length; \ if (conditions.used > conditions.size) conditions.used = new_length; \ } @@ -265,11 +245,6 @@ extern "C" { #define f_macro_thread_ids_t_resize(status, ids, new_length) \ status = f_memory_resize((void **) & ids.array, sizeof(f_thread_id_t), ids.size, new_length); \ if (status == F_none) { \ - if (new_length > ids.size) { \ - for (f_array_length_t _macro__i = ids.size; _macro__i < new_length; _macro__i++) { \ - memset(&ids.array[_macro__i], 0, sizeof(f_thread_id_t)); \ - } \ - } \ ids.size = new_length; \ if (ids.used > ids.size) ids.used = new_length; \ } @@ -277,11 +252,6 @@ extern "C" { #define f_macro_thread_ids_t_adjust(status, ids, new_length) \ status = f_memory_adjust((void **) & ids.array, sizeof(f_thread_id_t), ids.size, new_length); \ if (status == F_none) { \ - if (new_length > ids.size) { \ - for (f_array_length_t _macro__i = ids.size; _macro__i < new_length; _macro__i++) { \ - memset(&ids.array[_macro__i], 0, sizeof(f_thread_id_t)); \ - } \ - } \ ids.size = new_length; \ if (ids.used > ids.size) ids.used = new_length; \ } @@ -355,11 +325,6 @@ extern "C" { #define f_macro_thread_keys_t_resize(status, keys, new_length) \ status = f_memory_resize((void **) & keys.array, sizeof(f_thread_key_t), keys.size, new_length); \ if (status == F_none) { \ - if (new_length > keys.size) { \ - for (f_array_length_t _macro__i = keys.size; _macro__i < new_length; _macro__i++) { \ - memset(&keys.array[_macro__i], 0, sizeof(f_thread_key_t)); \ - } \ - } \ keys.size = new_length; \ if (keys.used > keys.size) keys.used = new_length; \ } @@ -367,11 +332,6 @@ extern "C" { #define f_macro_thread_keys_t_adjust(status, keys, new_length) \ status = f_memory_adjust((void **) & keys.array, sizeof(f_thread_key_t), keys.size, new_length); \ if (status == F_none) { \ - if (new_length > keys.size) { \ - for (f_array_length_t _macro__i = keys.size; _macro__i < new_length; _macro__i++) { \ - memset(&keys.array[_macro__i], 0, sizeof(f_thread_key_t)); \ - } \ - } \ keys.size = new_length; \ if (keys.used > keys.size) keys.used = new_length; \ } @@ -445,11 +405,6 @@ extern "C" { #define f_macro_thread_locks_t_resize(status, locks, new_length) \ status = f_memory_resize((void **) & locks.array, sizeof(f_thread_lock_t), locks.size, new_length); \ if (status == F_none) { \ - if (new_length > locks.size) { \ - for (f_array_length_t _macro__i = locks.size; _macro__i < new_length; _macro__i++) { \ - memset(&locks.array[_macro__i], 0, sizeof(f_thread_lock_t)); \ - } \ - } \ locks.size = new_length; \ if (locks.used > locks.size) locks.used = new_length; \ } @@ -457,11 +412,6 @@ extern "C" { #define f_macro_thread_locks_t_adjust(status, locks, new_length) \ status = f_memory_adjust((void **) & locks.array, sizeof(f_thread_lock_t), locks.size, new_length); \ if (status == F_none) { \ - if (new_length > locks.size) { \ - for (f_array_length_t _macro__i = locks.size; _macro__i < new_length; _macro__i++) { \ - memset(&locks.array[_macro__i], 0, sizeof(f_thread_lock_t)); \ - } \ - } \ locks.size = new_length; \ if (locks.used > locks.size) locks.used = new_length; \ } @@ -535,11 +485,6 @@ extern "C" { #define f_macro_thread_mutexs_t_resize(status, mutexs, new_length) \ status = f_memory_resize((void **) & mutexs.array, sizeof(f_thread_mutex_t), mutexs.size, new_length); \ if (status == F_none) { \ - if (new_length > mutexs.size) { \ - for (f_array_length_t _macro__i = mutexs.size; _macro__i < new_length; _macro__i++) { \ - memset(&mutexs.array[_macro__i], 0, sizeof(f_thread_mutex_t)); \ - } \ - } \ mutexs.size = new_length; \ if (mutexs.used > mutexs.size) mutexs.used = new_length; \ } @@ -547,11 +492,6 @@ extern "C" { #define f_macro_thread_mutexs_t_adjust(status, mutexs, new_length) \ status = f_memory_adjust((void **) & mutexs.array, sizeof(f_thread_mutex_t), mutexs.size, new_length); \ if (status == F_none) { \ - if (new_length > mutexs.size) { \ - for (f_array_length_t _macro__i = mutexs.size; _macro__i < new_length; _macro__i++) { \ - memset(&mutexs.array[_macro__i], 0, sizeof(f_thread_mutex_t)); \ - } \ - } \ mutexs.size = new_length; \ if (mutexs.used > mutexs.size) mutexs.used = new_length; \ } @@ -625,11 +565,6 @@ extern "C" { #define f_macro_thread_mutex_attributes_t_resize(status, mutex_attributes, new_length) \ status = f_memory_resize((void **) & mutex_attributes.array, sizeof(f_thread_mutex_attribute_t), mutex_attributes.size, new_length); \ if (status == F_none) { \ - if (new_length > mutex_attributes.size) { \ - for (f_array_length_t _macro__i = mutex_attributes.size; _macro__i < new_length; _macro__i++) { \ - memset(&mutex_attributes.array[_macro__i], 0, sizeof(f_thread_mutex_attribute_t)); \ - } \ - } \ mutex_attributes.size = new_length; \ if (mutex_attributes.used > mutex_attributes.size) mutex_attributes.used = new_length; \ } @@ -637,11 +572,6 @@ extern "C" { #define f_macro_thread_mutex_attributes_t_adjust(status, mutex_attributes, new_length) \ status = f_memory_adjust((void **) & mutex_attributes.array, sizeof(f_thread_mutex_attribute_t), mutex_attributes.size, new_length); \ if (status == F_none) { \ - if (new_length > mutex_attributes.size) { \ - for (f_array_length_t _macro__i = mutex_attributes.size; _macro__i < new_length; _macro__i++) { \ - memset(&mutex_attributes.array[_macro__i], 0, sizeof(f_thread_mutex_attribute_t)); \ - } \ - } \ mutex_attributes.size = new_length; \ if (mutex_attributes.used > mutex_attributes.size) mutex_attributes.used = new_length; \ } @@ -715,11 +645,6 @@ extern "C" { #define f_macro_thread_onces_t_resize(status, onces, new_length) \ status = f_memory_resize((void **) & onces.array, sizeof(f_thread_once_t), onces.size, new_length); \ if (status == F_none) { \ - if (new_length > onces.size) { \ - for (f_array_length_t _macro__i = onces.size; _macro__i < new_length; _macro__i++) { \ - memset(&onces.array[_macro__i], 0, sizeof(f_thread_once_t)); \ - } \ - } \ onces.size = new_length; \ if (onces.used > onces.size) onces.used = new_length; \ } @@ -727,11 +652,6 @@ extern "C" { #define f_macro_thread_onces_t_adjust(status, onces, new_length) \ status = f_memory_adjust((void **) & onces.array, sizeof(f_thread_once_t), onces.size, new_length); \ if (status == F_none) { \ - if (new_length > onces.size) { \ - for (f_array_length_t _macro__i = onces.size; _macro__i < new_length; _macro__i++) { \ - memset(&onces.array[_macro__i], 0, sizeof(f_thread_once_t)); \ - } \ - } \ onces.size = new_length; \ if (onces.used > onces.size) onces.used = new_length; \ } @@ -816,11 +736,6 @@ extern "C" { #define f_macro_thread_sets_t_resize(status, threads, new_length) \ status = f_memory_resize((void **) & threads.array, sizeof(f_thread_set_t), threads.size, new_length); \ if (status == F_none) { \ - if (new_length > threads.size) { \ - for (f_array_length_t _macro__i = threads.size; _macro__i < new_length; _macro__i++) { \ - memset(&threads.array[_macro__i], 0, sizeof(f_thread_set_t)); \ - } \ - } \ threads.size = new_length; \ if (threads.used > threads.size) threads.used = new_length; \ } @@ -828,11 +743,6 @@ extern "C" { #define f_macro_thread_sets_t_adjust(status, threads, new_length) \ status = f_memory_adjust((void **) & threads.array, sizeof(f_thread_set_t), threads.size, new_length); \ if (status == F_none) { \ - if (new_length > threads.size) { \ - for (f_array_length_t _macro__i = threads.size; _macro__i < new_length; _macro__i++) { \ - memset(&threads.array[_macro__i], 0, sizeof(f_thread_set_t)); \ - } \ - } \ threads.size = new_length; \ if (threads.used > threads.size) threads.used = new_length; \ } diff --git a/level_0/f_utf/c/utf-common.h b/level_0/f_utf/c/utf-common.h index 2e58e55..d9ba3ad 100644 --- a/level_0/f_utf/c/utf-common.h +++ b/level_0/f_utf/c/utf-common.h @@ -454,11 +454,6 @@ extern "C" { } \ 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) { \ - if (new_length > dynamics.size) { \ - for (f_utf_string_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic_t)); \ - } \ - } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } @@ -473,11 +468,6 @@ extern "C" { } \ 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) { \ - if (new_length > dynamics.size) { \ - for (f_utf_string_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic_t)); \ - } \ - } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } 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 04b26c6..e9b6972 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 @@ -104,12 +104,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } @@ -125,12 +119,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth_t)); \ - } \ - } \ 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 537254f..1b4ba5e 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 @@ -104,12 +104,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } @@ -125,12 +119,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_read_depth_t)); \ - } \ - } \ 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 349c383..622c900 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 @@ -129,12 +129,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_embedded_list_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } @@ -150,12 +144,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_embedded_list_read_depth_t)); \ - } \ - } \ 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 298a92e..e1740ee 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 @@ -104,12 +104,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } @@ -125,12 +119,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth_t)); \ - } \ - } \ 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 6c4249f..06183c5 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 @@ -104,12 +104,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } @@ -125,12 +119,6 @@ extern "C" { } \ 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) { \ - if (new_length > depths.size) { \ - f_array_length_t i = depths.size; \ - for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_read_depth_t)); \ - } \ - } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index dfa412e..f9f24bc 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -199,12 +199,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_resize((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ if (status == F_none) { \ - if (new_length > replacements.size) { \ - f_array_length_t i = replacements.size; \ - for (; i < new_length; i++) { \ - memset(&replacements.array[i], 0, sizeof(iki_read_substitution_t)); \ - } \ - } \ replacements.size = new_length; \ if (replacements.used > replacements.size) replacements.used = new_length; \ } @@ -219,12 +213,6 @@ extern "C" { } \ if (status == F_none) status = f_memory_adjust((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ if (status == F_none) { \ - if (new_length > replacements.size) { \ - f_array_length_t i = replacements.size; \ - for (; i < new_length; i++) { \ - memset(&replacements.array[i], 0, sizeof(iki_read_substitution_t)); \ - } \ - } \ replacements.size = new_length; \ if (replacements.used > replacements.size) replacements.used = new_length; \ } -- 1.8.3.1