Macros should be used sparingly, if at all.
When macros are used, they should be used carefully.
In this case, I was defining a variable "i".
The substituted data also included an "i", which caused a non-obvious problem.
Use a more unique counter variable name "_macro__i" to help avoid these problems in the future.
#define f_macro_directory_statuss_resize(status, structures, new_length) \
status = F_none; \
if (new_length < structures.size) { \
- f_array_length i = structures.size - new_length; \
- for (; i < structures.size; i++) { \
- f_macro_directory_status_delete(status, structures.array[i]); \
+ for (f_array_length _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \
+ f_macro_directory_status_delete(status, structures.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status), structures.size, new_length); \
if (status == F_none) { \
if (new_length > structures.size) { \
- f_array_length i = structures.size; \
- for (; i < new_length; i++) { \
- memset(&structures.array[i], 0, sizeof(f_directory_status)); \
+ for (f_array_length _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \
+ memset(&structures.array[_macro__i], 0, sizeof(f_directory_status)); \
} \
} \
structures.size = new_length; \
#define f_macro_directory_statuss_adjust(status, structures, new_length) \
status = F_none; \
if (new_length < structures.size) { \
- f_array_length i = structures.size - new_length; \
- for (; i < structures.size; i++) { \
- f_macro_directory_status_destroy(status, structures.array[i]); \
+ for (f_array_length _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \
+ f_macro_directory_status_destroy(status, structures.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status), structures.size, new_length); \
if (status == F_none) { \
if (new_length > structures.size) { \
- f_array_length i = structures.size; \
- for (; i < new_length; i++) { \
- memset(&structures.array[i], 0, sizeof(f_directory_status)); \
+ for (f_array_length _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \
+ memset(&structures.array[_macro__i], 0, sizeof(f_directory_status)); \
} \
} \
structures.size = new_length; \
#define f_macro_fss_nameds_resize(status, sets, new_length) \
status = F_none; \
if (new_length < sets.size) { \
- f_array_length i = sets.size - new_length; \
- for (; i < sets.size; i++) { \
- f_macro_fss_named_delete(status, sets.array[i]); \
+ for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \
+ f_macro_fss_named_delete(status, sets.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_named), sets.size, new_length); \
if (status == F_none) { \
if (new_length > sets.size) { \
- f_array_length i = sets.size; \
- for (; i < new_length; i++) { \
- memset(&sets.array[i], 0, sizeof(f_fss_named)); \
+ for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \
+ memset(&sets.array[_macro__i], 0, sizeof(f_fss_named)); \
} \
} \
sets.size = new_length; \
#define f_macro_fss_nameds_adjust(status, sets, new_length) \
status = F_none; \
if (new_length < sets.size) { \
- f_array_length i = sets.size - new_length; \
- for (; i < sets.size; i++) { \
- f_macro_fss_named_destroy(status, sets.array[i]); \
+ for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \
+ f_macro_fss_named_destroy(status, sets.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_named), sets.size, new_length); \
if (status == F_none) { \
if (new_length > sets.size) { \
- f_array_length i = sets.size; \
- for (; i < new_length; i++) { \
- memset(&sets.array[i], 0, sizeof(f_fss_named)); \
+ for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \
+ memset(&sets.array[_macro__i], 0, sizeof(f_fss_named)); \
} \
} \
sets.size = new_length; \
#define f_macro_fss_items_resize(status, items, new_length) \
status = F_none; \
if (new_length < items.size) { \
- f_array_length i = items.size - new_length; \
- for (; i < items.size; i++) { \
- f_macro_fss_item_delete(status, items.array[i]); \
+ for (f_array_length _macro__i = items.size - new_length; _macro__i < items.size; _macro__i++) { \
+ f_macro_fss_item_delete(status, items.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \
if (status == F_none) { \
if (new_length > items.size) { \
- f_array_length i = items.size; \
- for (; i < new_length; i++) { \
- memset(&items.array[i], 0, sizeof(f_fss_item)); \
+ for (f_array_length _macro__i = items.size; _macro__i < new_length; _macro__i++) { \
+ memset(&items.array[_macro__i], 0, sizeof(f_fss_item)); \
} \
} \
items.size = new_length; \
#define f_macro_fss_items_adjust(status, items, new_length) \
status = F_none; \
if (new_length < items.size) { \
- length_variable i = items.size - new_length; \
- for (; i < items.size; i++) { \
- f_macro_fss_item_destroy(status, items.array[i]); \
+ for (length_variable _macro__i = items.size - new_length; _macro__i < items.size; _macro__i++) { \
+ f_macro_fss_item_destroy(status, items.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \
if (status == F_none) { \
if (new_length > items.size) { \
- length_variable i = items.size; \
- for (; i < new_length; i++) { \
- memset(&items.array[i], 0, sizeof(f_fss_item)); \
+ for (length_variable _macro__i = items.size; _macro__i < new_length; _macro__i++) { \
+ memset(&items.array[_macro__i], 0, sizeof(f_fss_item)); \
} \
} \
items.size = new_length; \
#define f_macro_fss_nest_resize(status, nest, new_length) \
status = F_none; \
if (new_length < nest.size) { \
- f_array_length i = nest.size - new_length; \
- for (; i < nest.size; i++) { \
- f_macro_fss_items_delete(status, nest.depth[i]); \
+ for (f_array_length _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \
+ f_macro_fss_items_delete(status, nest.depth[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items), nest.size, new_length); \
if (status == F_none) { \
if (new_length > nest.size) { \
- f_array_length i = nest.size; \
- for (; i < new_length; i++) { \
- memset(&nest.depth[i], 0, sizeof(f_fss_items)); \
+ for (f_array_length _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \
+ memset(&nest.depth[_macro__i], 0, sizeof(f_fss_items)); \
} \
} \
nest.size = new_length; \
#define f_macro_fss_nest_adjust(status, nest, new_length) \
status = F_none; \
if (new_length < nest.size) { \
- f_array_length i = nest.size - new_length; \
- for (; i < nest.size; i++) { \
- f_macro_fss_items_destroy(status, nest.depth[i]); \
+ for (f_array_length _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \
+ f_macro_fss_items_destroy(status, nest.depth[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item), nest.size, new_length); \
if (status == F_none) { \
if (new_length > nest.size) { \
- f_array_length i = nest.size; \
- for (; i < new_length; i++) { \
- memset(&items.depth[i], 0, sizeof(f_fss_item)); \
+ for (f_array_length _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \
+ memset(&items.depth[_macro__i], 0, sizeof(f_fss_item)); \
} \
} \
nest.size = new_length; \
#define f_macro_fss_nests_resize(status, nests, new_length) \
status = F_none; \
if (new_length < nests.size) { \
- f_array_length i = nests.size - new_length; \
- for (; i < nests.size; i++) { \
- f_macro_fss_nest_delete(status, nests.array[i]); \
+ for (f_array_length _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \
+ f_macro_fss_nest_delete(status, nests.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \
if (status == F_none) { \
if (new_length > nests.size) { \
- f_array_length i = nests.size; \
- for (; i < new_length; i++) { \
- memset(&nests.array[i], 0, sizeof(f_fss_nest)); \
+ for (f_array_length _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \
+ memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest)); \
} \
} \
nests.size = new_length; \
#define f_macro_fss_nests_adjust(status, nests, new_length) \
status = F_none; \
if (new_length < nests.size) { \
- f_array_length i = nests.size - new_length; \
- for (; i < nests.size; i++) { \
- f_macro_fss_nest_destroy(status, nests.array[i]); \
+ for (f_array_length _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \
+ f_macro_fss_nest_destroy(status, nests.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \
if (status == F_none) { \
if (new_length > nests.size) { \
- f_array_length i = nests.size; \
- for (; i < new_length; i++) { \
- memset(&nests.array[i], 0, sizeof(f_fss_nest)); \
+ for (f_array_length _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \
+ memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest)); \
} \
} \
nests.size = new_length; \
#define f_macro_fss_sets_resize(status, sets, new_length) \
status = F_none; \
if (new_length < sets.size) { \
- f_array_length i = sets.size - new_length; \
- for (; i < sets.size; i++) { \
- f_macro_fss_set_delete(status, sets.array[i]); \
+ for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \
+ f_macro_fss_set_delete(status, sets.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set), sets.size, new_length); \
if (status == F_none) { \
if (new_length > sets.size) { \
- f_array_length i = sets.size; \
- for (; i < new_length; i++) { \
- memset(&sets.array[i], 0, sizeof(f_fss_set)); \
+ for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \
+ memset(&sets.array[_macro__i], 0, sizeof(f_fss_set)); \
} \
} \
sets.size = new_length; \
#define f_macro_fss_sets_adjust(status, sets, new_length) \
status = F_none; \
if (new_length < sets.size) { \
- f_array_length i = sets.size - new_length; \
- for (; i < sets.size; i++) { \
- f_macro_fss_set_destroy(status, sets.array[i]); \
+ for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \
+ f_macro_fss_set_destroy(status, sets.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set), sets.size, new_length); \
if (status == F_none) { \
if (new_length > sets.size) { \
- f_array_length i = sets.size; \
- for (; i < new_length; i++) { \
- memset(&sets.array[i], 0, sizeof(f_fss_set)); \
+ for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \
+ memset(&sets.array[_macro__i], 0, sizeof(f_fss_set)); \
} \
} \
sets.size = new_length; \
#define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, new_length, length_variable) \
status = F_none; \
if (new_length < structures.size) { \
- length_variable i = structures.size - new_length; \
- for (; i < structures.size; i++) { \
- f_macro_memory_structure_delete(status, structures.array[i], type_structure); \
+ for (length_variable _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \
+ f_macro_memory_structure_delete(status, structures.array[_macro__i], type_structure); \
if (status != F_none) break; \
} \
} \
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) { \
- length_variable i = structures.size; \
- for (; i < new_length; i++) { \
- memset(&structures.array[i], 0, sizeof(type_structures)); \
+ 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; \
#define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, new_length, length_variable) \
status = F_none; \
if (new_length < structures.size) { \
- length_variable i = structures.size - new_length; \
- for (; i < structures.size; i++) { \
- f_macro_memory_structure_destroy(status, structures.array[i], type_structure); \
+ for (length_variable _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \
+ f_macro_memory_structure_destroy(status, structures.array[_macro__i], type_structure); \
if (status != F_none) break; \
} \
} \
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) { \
- length_variable i = structures.size; \
- for (; i < new_length; i++) { \
- memset(&structures.array[i], 0, sizeof(type_structures)); \
+ 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; \
#define f_macro_string_dynamics_resize(status, dynamics, new_length) \
status = F_none; \
if (new_length < dynamics.size) { \
- f_array_length i = dynamics.size - new_length; \
- for (; i < dynamics.size; i++) { \
- f_macro_string_dynamic_delete(status, dynamics.array[i]); \
+ for (f_array_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \
+ f_macro_string_dynamic_delete(status, dynamics.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \
if (status == F_none) { \
if (new_length > dynamics.size) { \
- f_array_length i = dynamics.size; \
- for (; i < new_length; i++) { \
- memset(&dynamics.array[i], 0, sizeof(f_string_dynamic)); \
+ for (f_array_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \
+ memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic)); \
} \
} \
dynamics.size = new_length; \
#define f_macro_string_dynamics_adjust(status, dynamics, new_length) \
status = F_none; \
if (new_length < dynamics.size) { \
- f_array_length i = dynamics.size - new_length; \
- for (; i < dynamics.size; i++) { \
- f_macro_string_dynamic_destroy(status, dynamics.array[i], f_string_dynamic); \
+ for (f_array_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \
+ f_macro_string_dynamic_destroy(status, dynamics.array[_macro__i], f_string_dynamic); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \
if (status == F_none) { \
if (new_length > dynamics.size) { \
- f_array_length i = dynamics.size; \
- for (; i < new_length; i++) { \
- memset(&dynamics.array[i], 0, sizeof(f_string_dynamic)); \
+ for (f_array_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \
+ memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic)); \
} \
} \
dynamics.size = new_length; \
#define f_macro_string_maps_resize(status, maps, new_length) \
status = F_none; \
if (new_length < maps.size) { \
- f_array_length i = maps.size - new_length; \
- for (; i < maps.size; i++) { \
- f_macro_string_map_delete(status, maps.array[i]); \
+ for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \
+ f_macro_string_map_delete(status, maps.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map), maps.size, new_length); \
if (status == F_none) { \
if (new_length > maps.size) { \
- f_array_length i = maps.size; \
- for (; i < new_length; i++) { \
- memset(&maps.array[i], 0, sizeof(f_string_map)); \
+ for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \
+ memset(&maps.array[_macro__i], 0, sizeof(f_string_map)); \
} \
} \
maps.size = new_length; \
#define f_macro_string_maps_adjust(status, maps, new_length) \
status = F_none; \
if (new_length < maps.size) { \
- f_array_length i = maps.size - new_length; \
- for (; i < maps.size; i++) { \
- f_macro_string_map_destroy(status, maps.array[i], f_string_map); \
+ for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \
+ f_macro_string_map_destroy(status, maps.array[_macro__i], f_string_map); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map), maps.size, new_length); \
if (status == F_none) { \
if (new_length > maps.size) { \
- f_array_length i = maps.size; \
- for (; i < new_length; i++) { \
- memset(&maps.array[i], 0, sizeof(f_string_map)); \
+ for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \
+ memset(&maps.array[_macro__i], 0, sizeof(f_string_map)); \
} \
} \
maps.size = new_length; \
#define f_macro_string_map_multis_resize(status, maps, new_length) \
status = F_none; \
if (new_length < maps.size) { \
- f_array_length i = maps.size - new_length; \
- for (; i < maps.size; i++) { \
- f_macro_string_map_multi_delete(status, maps.array[i]); \
+ for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \
+ f_macro_string_map_multi_delete(status, maps.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_multi), maps.size, new_length); \
if (status == F_none) { \
if (new_length > maps.size) { \
- f_array_length i = maps.size; \
- for (; i < new_length; i++) { \
- memset(&maps.array[i], 0, sizeof(f_string_map_multi)); \
+ for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \
+ memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi)); \
} \
} \
maps.size = new_length; \
#define f_macro_string_map_multis_adjust(status, maps, new_length) \
status = F_none; \
if (new_length < maps.size) { \
- f_array_length i = maps.size - new_length; \
- for (; i < maps.size; i++) { \
- f_macro_string_map_multi_destroy(status, maps.array[i], f_string_map_multi); \
+ for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \
+ f_macro_string_map_multi_destroy(status, maps.array[_macro__i], f_string_map_multi); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_multi), maps.size, new_length); \
if (status == F_none) { \
if (new_length > maps.size) { \
- f_array_length i = maps.size; \
- for (; i < new_length; i++) { \
- memset(&maps.array[i], 0, sizeof(f_string_map_multi)); \
+ for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \
+ memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi)); \
} \
} \
maps.size = new_length; \
#define f_macro_utf_string_dynamics_resize(status, dynamics, new_length) \
status = F_none; \
if (new_length < dynamics.size) { \
- f_utf_string_length i = dynamics.size - new_length; \
- for (; i < dynamics.size; i++) { \
- f_macro_utf_string_dynamic_destroy(status, dynamics.array[i]); \
+ for (f_utf_string_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[_macro__i]); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \
if (status == F_none) { \
if (new_length > dynamics.size) { \
- f_utf_string_length i = dynamics.size; \
- for (; i < new_length; i++) { \
- memset(&dynamics.array[i], 0, sizeof(f_utf_string_dynamic)); \
+ for (f_utf_string_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \
+ memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic)); \
} \
} \
dynamics.size = new_length; \
#define f_macro_utf_string_dynamics_adjust(status, dynamics, new_length) \
status = F_none; \
if (new_length < dynamics.size) { \
- f_utf_string_length i = dynamics.size - new_length; \
- for (; i < dynamics.size; i++) { \
- f_macro_utf_string_dynamic_destroy(status, dynamics.array[i], f_utf_string_dynamic); \
+ for (f_utf_string_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \
+ f_macro_utf_string_dynamic_destroy(status, dynamics.array[_macro__i], f_utf_string_dynamic); \
if (status != F_none) break; \
} \
} \
if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \
if (status == F_none) { \
if (new_length > dynamics.size) { \
- f_utf_string_length i = dynamics.size; \
- for (; i < new_length; i++) { \
- memset(&dynamics.array[i], 0, sizeof(f_utf_string_dynamic)); \
+ for (f_utf_string_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \
+ memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic)); \
} \
} \
dynamics.size = new_length; \