From acaba37642db5deeeb88d4e8c085df14ea3eba05 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 8 Jun 2012 23:49:36 -0500 Subject: [PATCH] Update: remove *_initialize for specific types Data types that are numeric, non-pointer, and non-structure should not need an *_initializer macros. It has been decided for simplicity purposes that these will be left alone. All other data types that are either non-numeric, pointers, or structures will continue to require *_initialize macros. --- level_0/f_fss/c/fss.h | 8 ++-- level_0/f_memory/c/memory.h | 2 +- level_0/f_strings/c/strings.h | 9 ++--- level_0/f_types/c/types.h | 6 --- level_0/f_types/c/types_array.h | 2 +- level_1/fl_colors/c/colors.c | 2 +- level_1/fl_console/c/console.c | 18 ++++----- level_1/fl_directory/c/directory.c | 4 +- level_1/fl_file/c/file.c | 12 +++--- level_1/fl_fss/c/fss.c | 6 +-- level_1/fl_fss/c/fss_basic.c | 22 +++++------ level_1/fl_fss/c/fss_basic_list.c | 14 +++---- level_1/fl_fss/c/fss_extended.c | 28 ++++++------- level_1/fl_fss/c/fss_macro.h | 46 +++++++++++----------- level_1/fl_serialized/c/serialized.c | 6 +-- level_1/fl_strings/c/strings.c | 10 ++--- level_2/fll_colors/c/colors.c | 2 +- level_2/fll_execute/c/execute.c | 10 ++--- level_2/fll_fss/c/fss_basic.c | 6 +-- level_2/fll_fss/c/fss_basic_list.c | 6 +-- level_2/fll_fss/c/fss_extended.c | 6 +-- level_3/firewall/c/firewall.c | 16 ++++---- level_3/firewall/c/private-firewall.c | 28 ++++++------- .../fss_basic_list_read/c/fss_basic_list_read.c | 24 +++++------ .../fss_basic_list_write/c/fss_basic_list_write.c | 8 ++-- level_3/fss_basic_read/c/fss_basic_read.c | 24 +++++------ level_3/fss_basic_write/c/fss_basic_write.c | 8 ++-- level_3/fss_extended_read/c/fss_extended_read.c | 26 ++++++------ level_3/fss_extended_write/c/fss_extended_write.c | 8 ++-- level_3/fss_return_code/c/fss_return_code.c | 20 +++++----- level_3/return_code/c/return_code.c | 20 +++++----- 31 files changed, 200 insertions(+), 207 deletions(-) diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 0e8ab32..04e0983 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -114,7 +114,7 @@ enum { f_string_length used; // total number of allocated spaces used } f_fss_headers; - #define f_fss_headers_initialize { 0, f_string_length_initialize, f_string_length_initialize } + #define f_fss_headers_initialize { 0, 0, 0 } #define f_delete_fss_headers(status, headers) \ f_delete_structure(status, headers, f_fss_header) @@ -155,7 +155,7 @@ enum { f_string_length used; // total number of allocated spaces used } f_fss_objects; - #define f_fss_objects_initialize { 0, f_string_length_initialize, f_string_length_initialize } + #define f_fss_objects_initialize { 0, 0, 0 } #define f_delete_fss_objects(status, objects) \ f_delete_structure(status, objects, f_fss_object) @@ -181,7 +181,7 @@ enum { f_array_length used; // total number of allocated spaces used } f_fss_content; - #define f_fss_content_initialize { 0, f_array_length_initialize, f_array_length_initialize } + #define f_fss_content_initialize { 0, 0, 0 } #define f_delete_fss_content(status, content) \ f_delete_structure(status, content, f_string_location) @@ -204,7 +204,7 @@ enum { f_array_length used; // total number of allocated spaces used } f_fss_contents; - #define f_fss_contents_initialize { 0, f_array_length_initialize, f_array_length_initialize } + #define f_fss_contents_initialize { 0, 0, 0 } #define f_delete_fss_contents(status, contents) \ f_delete_structures(status, contents, f_fss_content) diff --git a/level_0/f_memory/c/memory.h b/level_0/f_memory/c/memory.h index 855af54..2aab097 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -161,7 +161,7 @@ extern "C"{ if (status != f_none) break; \ } \ if (status == f_none) status = f_delete((void **) & structures.array, sizeof(type), structures.size); \ - if (status == f_none) structures.used = f_string_length_initialize; + if (status == f_none) structures.used = 0; #endif // _di_f_delete_structures_ #ifndef _di_f_destroy_structures_ diff --git a/level_0/f_strings/c/strings.h b/level_0/f_strings/c/strings.h index b7382da..51da7ad 100644 --- a/level_0/f_strings/c/strings.h +++ b/level_0/f_strings/c/strings.h @@ -88,7 +88,6 @@ extern "C"{ #ifndef _di_f_string_length_ typedef f_u_long f_string_length; - #define f_string_length_initialize 0 #define f_string_length_printf string_format_long_unsigned #define f_new_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length) @@ -109,7 +108,7 @@ extern "C"{ f_array_length used; // total number of allocated spaces used } f_string_lengths; - #define f_string_lengths_initialize { 0, f_array_length_initialize, f_array_length_initialize } + #define f_string_lengths_initialize { 0, 0, 0 } #define f_delete_string_lengths(status, lengths) \ f_delete_structure(status, lengths, f_string_length) @@ -153,7 +152,7 @@ extern "C"{ f_array_length used; // total number of allocated spaces used } f_string_locations; - #define f_string_locations_initialize {0, f_array_length_initialize, f_array_length_initialize} + #define f_string_locations_initialize {0, 0, 0} #define f_delete_string_locations(status, locations) \ f_delete_structure(status, locations, f_string_location) @@ -177,7 +176,7 @@ extern "C"{ f_string_length used; // total number of allocated spaces used } f_dynamic_string; - #define f_dynamic_string_initialize { f_string_initialize, f_string_length_initialize, f_string_length_initialize } + #define f_dynamic_string_initialize { f_string_initialize, 0, 0 } #define f_delete_dynamic_string(status, dynamic) \ status = f_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ @@ -216,7 +215,7 @@ extern "C"{ f_string_length used; // total number of allocated spaces used } f_dynamic_strings; - #define f_dynamic_strings_initialize { 0, f_string_length_initialize, f_string_length_initialize } + #define f_dynamic_strings_initialize { 0, 0, 0 } #define f_delete_dynamic_strings(status, dynamics) \ status = f_none; \ diff --git a/level_0/f_types/c/types.h b/level_0/f_types/c/types.h index 2243909..4965341 100644 --- a/level_0/f_types/c/types.h +++ b/level_0/f_types/c/types.h @@ -111,8 +111,6 @@ extern "C"{ #ifndef _di_f_status_ typedef uint16_t f_status; - #define f_status_initialize 0 - // The c language gives warnings about return types of constants, I pretty much hate not being able to forcefully specify that these are not the be changed as that could be a security issue // Therefore, I need to remove the const for c, but keep it for c++, thus I define the type f_return_status, which is only for function call declarations & prototypes // DO NOT DECLARE THESE FOR THE RETURN DATA TYPES THEMSELVES, USE f_status. ONLY USE THESE FOR FUNCTION PROTOTYPES AND DECLARATIONS @@ -155,10 +153,6 @@ extern "C"{ typedef f_u_long f_array_length; typedef f_u_int f_array_length_short; typedef f_u_long_long f_array_length_long; - - #define f_array_length_initialize 0 - #define f_array_length_short_initialize f_array_length_initialize - #define f_array_length_long_initialize f_array_length_initialize #endif // _di_f_array_length_ #ifdef __cplusplus diff --git a/level_0/f_types/c/types_array.h b/level_0/f_types/c/types_array.h index c44cb26..c800518 100644 --- a/level_0/f_types/c/types_array.h +++ b/level_0/f_types/c/types_array.h @@ -29,7 +29,7 @@ extern "C"{ f_array_length used; // total number of allocated spaces used } f_array_lengths; - #define f_array_lengths_initialize { f_array_length_initialize, f_array_length_initialize, f_array_length_initialize } + #define f_array_lengths_initialize { 0, 0, 0 } #define f_delete_array_lengths(status, lengths) \ f_delete_structure(status, lengths, f_array_length) diff --git a/level_1/fl_colors/c/colors.c b/level_1/fl_colors/c/colors.c index 5c8e8a9..84876c7 100644 --- a/level_1/fl_colors/c/colors.c +++ b/level_1/fl_colors/c/colors.c @@ -54,7 +54,7 @@ extern "C"{ // make sure there is enough allocated space, if not, then allocate some more if (buffer->size - buffer->used - 1 < string_size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_dynamic_string(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index e272b88..68b18f2 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -16,7 +16,7 @@ extern "C"{ if (remaining == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_console_id result = 0; f_bool found = f_false; @@ -61,7 +61,7 @@ extern "C"{ if (parameters[parameter_counter].has_additional) { if (extra_initiator.used >= extra_initiator.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, extra_initiator, extra_initiator.size + f_console_default_allocation_step); if (f_error_is_error(allocation_status)) { @@ -82,7 +82,7 @@ extern "C"{ if (parameters[parameter_counter].has_additional) { if (extra_initiator.used >= extra_initiator.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, extra_initiator, extra_initiator.size + f_console_default_allocation_step); @@ -114,7 +114,7 @@ extern "C"{ if (parameters[parameter_counter].has_additional) { if (extra_initiator.used >= extra_initiator.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, extra_initiator, extra_initiator.size + f_console_default_allocation_step); @@ -136,7 +136,7 @@ extern "C"{ if (parameters[parameter_counter].has_additional) { if (extra_initiator.used >= extra_initiator.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, extra_initiator, extra_initiator.size + f_console_default_allocation_step); @@ -164,7 +164,7 @@ extern "C"{ if (parameters[parameter_counter].type == f_console_type_other) { if (parameters[parameter_counter].length > 0 && parameters[parameter_counter].symbol_other != 0) { if (strncmp(argv[location], parameters[parameter_counter].symbol_other, parameters[parameter_counter].length + 1) == 0) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; if (parameters[parameter_counter].additional.used >= parameters[parameter_counter].additional.size) { f_resize_string_lengths(allocation_status, parameters[parameter_counter].additional, parameters[parameter_counter].additional.size + f_console_default_allocation_step); @@ -190,7 +190,7 @@ extern "C"{ if (!found) { if (extra_initiator.used > 0) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; if (parameters[extra_initiator.array[0]].additional.used >= parameters[extra_initiator.array[0]].additional.size) { f_resize_string_lengths(allocation_status, parameters[extra_initiator.array[0]].additional, parameters[extra_initiator.array[0]].additional.size + f_console_default_allocation_step); @@ -214,7 +214,7 @@ extern "C"{ } } else { if (remaining->used >= remaining->size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, (*remaining), remaining->size + f_console_default_allocation_step); @@ -240,7 +240,7 @@ extern "C"{ } { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, extra_initiator); } diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 8e44469..96b6647 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -21,8 +21,8 @@ extern "C"{ struct dirent **listing = 0; f_s_int length = 0; f_s_int counter = 0; - f_string_length size = f_string_length_initialize; - f_status status = f_status_initialize; + f_string_length size = 0; + f_status status = f_none; length = scandir(directory_path, &listing, 0, alphasort); diff --git a/level_1/fl_file/c/file.c b/level_1/fl_file/c/file.c index b8ec523..1f27bf6 100644 --- a/level_1/fl_file/c/file.c +++ b/level_1/fl_file/c/file.c @@ -22,8 +22,8 @@ extern "C"{ if (file.file == 0) return f_error_set_warning(f_file_not_open); - f_status status = f_status_initialize; - f_string_length size = f_string_length_initialize; + f_status status = f_none; + f_string_length size = 0; f_bool infinite = f_false; // when total_elements is 0, this means the file read will until EOF is reached @@ -73,8 +73,8 @@ extern "C"{ if (file.file == 0) return f_error_set_warning(f_file_not_open); - f_status status = f_status_initialize; - f_string_length size = f_string_length_initialize; + f_status status = f_none; + f_string_length size = 0; size = f_file_default_read_size; @@ -111,7 +111,7 @@ extern "C"{ f_return_status fl_file_write(f_file file, const f_dynamic_string buffer) { if (file.file == 0) return f_error_set_error(f_file_not_open); - f_status status = f_status_initialize; + f_status status = f_none; f_size_t size = 0; size = fwrite(buffer.string, file.byte_size, buffer.used, file.file); @@ -132,7 +132,7 @@ extern "C"{ if (file.file == 0) return f_file_not_open; - f_status status = f_status_initialize; + f_status status = f_none; f_size_t size = 0; f_string_length total = buffer.used - (position.stop - position.start + 1); diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index 2e39dfb..2f8d7b3 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -109,7 +109,7 @@ extern "C"{ clearerr(file_information->file); - f_status status = f_status_initialize; + f_status status = f_none; f_dynamic_string buffer = f_dynamic_string_initialize; f_file_position location = f_file_position_initialize; @@ -152,8 +152,8 @@ f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, const f_string if (location.start >= buffer->used) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_string_length position = f_string_length_initialize; - f_string_length distance = f_string_length_initialize; + f_string_length position = 0; + f_string_length distance = 0; position = location.start; diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index dbe0ccd..c5f1c6a 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -77,7 +77,7 @@ extern "C"{ if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step); @@ -145,7 +145,7 @@ extern "C"{ if (slash_count % 2 == 0) { if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -181,7 +181,7 @@ extern "C"{ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, delimits); } @@ -204,7 +204,7 @@ extern "C"{ return fl_fss_found_object; } else { if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -251,7 +251,7 @@ extern "C"{ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, delimits); } @@ -266,7 +266,7 @@ extern "C"{ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop) } else if (buffer->string[input->start] == f_eol) { { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, delimits); } @@ -289,7 +289,7 @@ extern "C"{ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, delimits); } @@ -350,12 +350,12 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_bool quoted = f_false; f_string_location buffer_position = f_string_location_initialize; f_string_length start_position = f_string_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; + f_string_length pre_allocate_size = 0; fl_macro_fss_skip_past_delimit_placeholders(object, (*input)) @@ -554,11 +554,11 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_string_location input_position = f_string_location_initialize; f_string_location buffer_position = f_string_location_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; + f_string_length pre_allocate_size = 0; // add an additional 1 to ensure that there is room for the terminating newline. pre_allocate_size = buffer->used + (content.used) + 1 + f_fss_default_allocation_step; diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index c781373..7b6bab0 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -84,7 +84,7 @@ extern "C"{ input->start = first_slash; if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -257,7 +257,7 @@ extern "C"{ } if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -351,12 +351,12 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_string_location buffer_position = f_string_location_initialize; f_string_length start_position = f_string_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; - f_string_length start_buffer = f_string_length_initialize; + f_string_length pre_allocate_size = 0; + f_string_length start_buffer = 0; fl_macro_fss_skip_past_delimit_placeholders(object, (*input)) @@ -473,13 +473,13 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_bool is_comment = f_false; f_bool has_graph = f_false; f_string_location buffer_position = f_string_location_initialize; f_string_length start_position = f_string_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; + f_string_length pre_allocate_size = 0; fl_macro_fss_skip_past_delimit_placeholders(content, (*input)) diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 35d65f9..1f646d1 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -77,7 +77,7 @@ extern "C"{ if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step); @@ -144,7 +144,7 @@ extern "C"{ input->start = first_slash; if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -198,7 +198,7 @@ extern "C"{ return fl_fss_found_object; } else { if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -301,13 +301,13 @@ extern "C"{ return fl_fss_found_no_content; } - f_status status = f_status_initialize; + f_status status = f_none; f_bool has_delimit = f_false; f_autochar quoted = f_eos; f_bool continue_main_loop = f_false; - f_string_length location = f_string_length_initialize; + f_string_length location = 0; f_array_length already_used = found->used; while (input->start <= input->stop && input->start < buffer->used) { @@ -317,7 +317,7 @@ extern "C"{ f_resize_fss_content(status, (*found), found->size + f_fss_default_allocation_step); if (f_error_is_error(status)){ - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_delete_string_lengths(allocation_status, delimits); return status; @@ -368,7 +368,7 @@ extern "C"{ if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step); @@ -436,7 +436,7 @@ extern "C"{ if (slash_count % 2 == 0) { if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -489,7 +489,7 @@ extern "C"{ continue; } else { if (delimits.used + (slash_count / 2) >= delimits.size) { - f_status allocation_status = f_status_initialize; + f_status allocation_status = f_none; f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); @@ -608,12 +608,12 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_bool quoted = f_false; f_string_location buffer_position = f_string_location_initialize; f_string_length start_position = f_string_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; + f_string_length pre_allocate_size = 0; fl_macro_fss_skip_past_delimit_placeholders(object, (*input)) @@ -828,12 +828,12 @@ extern "C"{ if (buffer == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_autochar quoted = f_eos; f_string_location buffer_position = f_string_location_initialize; - f_string_length start_position = f_string_length_initialize; - f_string_length pre_allocate_size = f_string_length_initialize; + f_string_length start_position = 0; + f_string_length pre_allocate_size = 0; // add an additional 1 to ensure that there is room for the terminating newline. pre_allocate_size = buffer->used + (content.used) + 1 + f_fss_default_allocation_step; diff --git a/level_1/fl_fss/c/fss_macro.h b/level_1/fl_fss/c/fss_macro.h index 68f9584..9631e32 100644 --- a/level_1/fl_fss/c/fss_macro.h +++ b/level_1/fl_fss/c/fss_macro.h @@ -17,7 +17,7 @@ extern "C"{ #ifndef _di_fl_macro_fss_apply_delimit_placeholders_ #define fl_macro_fss_apply_delimit_placeholders(buffer, delimits) \ { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ \ f_string_length i = 0; \ \ @@ -65,13 +65,13 @@ extern "C"{ #ifndef _di_fl_macro_fss_object_return_on_overflow_ #define fl_macro_fss_object_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.stop = buffer.used - 1; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.stop = input.stop; \ @@ -82,7 +82,7 @@ extern "C"{ #ifndef _di_fl_macro_fss_object_delimited_return_on_overflow_ #define fl_macro_fss_object_delimited_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -94,7 +94,7 @@ extern "C"{ found.stop = buffer.used - 1; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -111,13 +111,13 @@ extern "C"{ #ifndef _di_fl_macro_fss_content_return_on_overflow_ #define fl_macro_fss_content_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.array[found.used].stop = buffer.used - 1; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.array[found.used].stop = input.stop; \ @@ -128,7 +128,7 @@ extern "C"{ #ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_ #define fl_macro_fss_content_delimited_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -140,7 +140,7 @@ extern "C"{ found.array[found.used].stop = buffer.used - 1; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -157,14 +157,14 @@ extern "C"{ #ifndef _di_fl_macro_fss_content_return_on_overflow_reset_ #define fl_macro_fss_content_return_on_overflow_reset(buffer, input, found, delimits, eos_status, stop_status, set_stop) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ input.start = set_stop; \ found.array[found.used].stop = set_stop; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ input.start = set_stop; \ @@ -176,7 +176,7 @@ extern "C"{ #ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_reset_ #define fl_macro_fss_content_delimited_return_on_overflow_reset(buffer, input, found, delimits, eos_status, stop_status, set_stop) \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -189,7 +189,7 @@ extern "C"{ found.array[found.used].stop = set_stop; \ return eos_status; \ } else if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -207,11 +207,11 @@ extern "C"{ #ifndef _di_fl_macro_fss_allocate_content_if_necessary_ #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \ if (content.used >= content.size) { \ - f_status status = f_status_initialize; \ + f_status status = f_none; \ \ f_resize_fss_content(status, content, content.size + f_fss_default_allocation_step); \ if (f_error_is_error(status)) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ return status; \ @@ -224,13 +224,13 @@ extern "C"{ while (buffer.string[input.start] != f_eol) { \ ++input.start; \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ return eos_status; \ } \ if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ return stop_status; \ @@ -243,7 +243,7 @@ extern "C"{ while (buffer.string[input.start] != f_eol) { \ ++input.start; \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -255,7 +255,7 @@ extern "C"{ return eos_status; \ } \ if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -274,14 +274,14 @@ extern "C"{ while (buffer.string[input.start] != f_eol) { \ ++input.start; \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.array[found.used].stop = input.stop; \ return eos_status; \ } \ if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_delete_string_lengths(allocation_status, delimits); \ \ found.array[found.used].stop = input.stop; \ @@ -295,7 +295,7 @@ extern "C"{ while (buffer.string[input.start] != f_eol) { \ ++input.start; \ if (input.start >= buffer.used) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -308,7 +308,7 @@ extern "C"{ return eos_status; \ } \ if (input.start > input.stop) { \ - f_status allocation_status = f_status_initialize; \ + f_status allocation_status = f_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ diff --git a/level_1/fl_serialized/c/serialized.c b/level_1/fl_serialized/c/serialized.c index 5c50c59..17c75db 100644 --- a/level_1/fl_serialized/c/serialized.c +++ b/level_1/fl_serialized/c/serialized.c @@ -16,7 +16,7 @@ extern "C" { if (serialized == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; if (serialized->used + value.used + 1 >= serialized->size) { @@ -44,7 +44,7 @@ extern "C" { if (locations == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_array_length i = 0; f_array_length start = 0; @@ -83,7 +83,7 @@ extern "C" { if (location == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_array_length i = 0; f_array_length current = 0; diff --git a/level_1/fl_strings/c/strings.c b/level_1/fl_strings/c/strings.c index bf7ac2c..50fd977 100644 --- a/level_1/fl_strings/c/strings.c +++ b/level_1/fl_strings/c/strings.c @@ -24,7 +24,7 @@ extern "C"{ f_string_length size = position.stop - position.start + 1; if (size > 0) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_dynamic_string(status, (*results), size); @@ -116,8 +116,8 @@ extern "C"{ if (length2 <= 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_string_length i1 = f_string_length_initialize; - f_string_length i2 = f_string_length_initialize; + f_string_length i1 = 0; + f_string_length i2 = 0; f_string_length stop1 = length1; f_string_length stop2 = length2; @@ -150,8 +150,8 @@ extern "C"{ if (string2.used <= 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ - f_string_length i1 = f_string_length_initialize; - f_string_length i2 = f_string_length_initialize; + f_string_length i1 = 0; + f_string_length i2 = 0; f_string_length stop1 = string1.used; f_string_length stop2 = string2.used; diff --git a/level_2/fll_colors/c/colors.c b/level_2/fll_colors/c/colors.c index e9b2585..d6287b6 100644 --- a/level_2/fll_colors/c/colors.c +++ b/level_2/fll_colors/c/colors.c @@ -16,7 +16,7 @@ extern "C"{ if (data == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; // switch to the appropriate terminal color mode { diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 89e4227..0ebc98c 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -23,7 +23,7 @@ extern "C"{ #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls - f_status status = f_status_initialize; + f_status status = f_none; f_autochar **arguments_array = 0; f_string last_slash = f_string_initialize; @@ -50,14 +50,14 @@ extern "C"{ status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2); if (f_error_is_error(status)) { - f_status tmp_status = f_status_initialize; + f_status tmp_status = f_none; f_delete_string(tmp_status, program_name, name_size); return status; } { - f_string_length counter = f_string_length_initialize; + f_string_length counter = 0; arguments_array[0] = program_name; counter++; @@ -108,7 +108,7 @@ extern "C"{ #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls - f_status status = f_status_initialize; + f_status status = f_none; f_autochar **arguments_array = 0; status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2); @@ -116,7 +116,7 @@ extern "C"{ if (f_error_is_error(status)) return status; { - f_string_length counter = f_string_length_initialize; + f_string_length counter = 0; arguments_array[0] = program_name; counter++; diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index f1ee7c2..2325f7e 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -18,7 +18,7 @@ extern "C"{ if (contents == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_string_length initial_used = objects->used; f_bool found_data = f_false; @@ -45,7 +45,7 @@ extern "C"{ objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); @@ -83,7 +83,7 @@ extern "C"{ found_data = f_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index 2858f9f..402bee1 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -18,7 +18,7 @@ extern "C"{ if (contents == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_string_length initial_used = objects->used; f_bool found_data = f_false; @@ -45,7 +45,7 @@ extern "C"{ objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); @@ -83,7 +83,7 @@ extern "C"{ found_data = f_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 1f8bdb6..db5ee00 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -18,7 +18,7 @@ extern "C"{ if (contents == f_null) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_status_initialize; + f_status status = f_none; f_string_length initial_used = objects->used; f_bool found_data = f_false; @@ -45,7 +45,7 @@ extern "C"{ objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); @@ -83,7 +83,7 @@ extern "C"{ found_data = f_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_status_initialize; + f_status status = f_none; f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index b7b06aa..dda945d 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -108,8 +108,8 @@ extern "C"{ #ifndef _di_firewall_main_ f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, firewall_total_parameters, &data->remaining); @@ -224,7 +224,7 @@ extern "C"{ show_mangle = f_false; show_ports = f_false; - f_string_length counter = f_string_length_initialize; + f_string_length counter = 0; for (; counter < data->remaining.used; counter++) { if (strncmp("nat", argv[data->remaining.array[counter]], 4) != 0) { @@ -347,7 +347,7 @@ extern "C"{ fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_program_name); fprintf(f_standard_error, " "); - f_string_length i = f_string_length_initialize; + f_string_length i = 0; fl_print_color_code(f_standard_error, data->context.error); @@ -404,7 +404,7 @@ extern "C"{ // remove "lo" (loopback) from the device listing { - f_string_length i = f_string_length_initialize; + f_string_length i = 0; for (; i < data->devices.used; i++) { if (fl_compare_strings((f_string) firewall_device_loop, data->devices.array[i].string, firewall_device_loop_length + 1, data->devices.array[i].used) == f_equal_to) { @@ -431,8 +431,8 @@ extern "C"{ } { - f_array_length i = f_array_length_initialize; - f_string_length length = f_string_length_initialize; + f_array_length i = 0; + f_string_length length = 0; for (; i < local.chain_objects.used; i++) { length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1; @@ -673,7 +673,7 @@ extern "C"{ #ifndef _di_firewall_delete_data_ f_return_status firewall_delete_data(firewall_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < firewall_total_parameters) { diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 3ba6f5a..24bf28d 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -6,15 +6,15 @@ #ifndef _di_firewall_perform_commands_ f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; - f_string_length i = f_string_length_initialize; + f_string_length i = 0; f_dynamic_string argument = f_dynamic_string_initialize; f_dynamic_strings arguments = f_dynamic_strings_initialize; f_s_int results = 0; - f_string_length length = f_string_length_initialize; + f_string_length length = 0; f_bool invalid = f_false; f_bool is_ip_list = f_false; f_dynamic_string ip_list = f_dynamic_string_initialize; @@ -481,7 +481,7 @@ // last up is the "rule" if ((!is_ip_list && local.rule_contents.array[i].used > 0) || (is_ip_list && local.rule_contents.array[i].used > 1)) { - f_string_length subcounter = f_string_length_initialize; + f_string_length subcounter = 0; if (is_ip_list) { // skip past the direction @@ -638,8 +638,8 @@ status = f_error_set_error(status); } else { - f_string_length buffer_counter = f_string_length_initialize; - f_string_length ip_length = f_string_length_initialize; + f_string_length buffer_counter = 0; + f_string_length ip_length = 0; f_dynamic_string ip_argument = f_dynamic_string_initialize; f_dynamic_string ip_list_action = f_dynamic_string_initialize; @@ -695,7 +695,7 @@ fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", firewall_program_name); fprintf(f_standard_error, " "); - f_string_length i = f_string_length_initialize; + f_string_length i = 0; fl_print_color_code(f_standard_error, data.context.error); @@ -757,7 +757,7 @@ fl_print_color_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", firewall_program_name); fprintf(f_standard_error, " "); - f_string_length i = f_string_length_initialize; + f_string_length i = 0; fl_print_color_code(f_standard_error, data.context.error); @@ -795,10 +795,10 @@ f_bool new_chain = f_false; f_s_int results = 0; - f_array_length i = f_array_length_initialize; - f_array_length j = f_array_length_initialize; + f_array_length i = 0; + f_array_length j = 0; - f_string_length length = f_string_length_initialize; + f_string_length length = 0; f_string_location location = f_string_location_initialize; f_dynamic_strings arguments = f_dynamic_strings_initialize; @@ -967,7 +967,7 @@ fl_print_color_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_program_name); fprintf(f_standard_error, " "); - f_string_length i = f_string_length_initialize; + f_string_length i = 0; fl_print_color_code(f_standard_error, data->context.error); @@ -1120,7 +1120,7 @@ #ifndef _di_firewall_delete_local_data_ f_return_status firewall_delete_local_data(firewall_local_data *local) { - f_status status = f_status_initialize; + f_status status = f_none; local->is_global = f_true; local->is_main = f_false; diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 78d200e..89b80e7 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -132,8 +132,8 @@ extern "C"{ f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility ("internal"))); f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_basic_list_read_total_parameters, &data->remaining); @@ -176,8 +176,8 @@ extern "C"{ } else if (data->parameters[fss_basic_list_read_parameter_version].result == f_console_result_found) { fss_basic_list_read_print_version(*data); } else if (data->remaining.used > 0 || data->process_pipe) { - f_string_length counter = f_string_length_initialize; - f_string_length target = f_string_length_initialize; + f_string_length counter = 0; + f_string_length target = 0; f_string_length original_size = data->file_position.total_elements; if (data->parameters[fss_basic_list_read_parameter_count].result == f_console_result_additional) { @@ -310,11 +310,11 @@ extern "C"{ } f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; - f_string_length current = f_string_length_initialize; - f_string_length found = f_string_length_initialize; + f_string_length current = 0; + f_string_length found = 0; { f_string_location input = f_string_location_initialize; @@ -444,9 +444,9 @@ extern "C"{ } else { current = 0; - f_string_length total = f_string_length_initialize; - f_string_length name_length = f_string_length_initialize; - f_string_length argv_length = f_string_length_initialize; + f_string_length total = 0; + f_string_length name_length = 0; + f_string_length argv_length = 0; if (data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_additional) { argv_length = strlen(argv[data->parameters[fss_basic_list_read_parameter_name].additional.array[0]]); @@ -572,7 +572,7 @@ extern "C"{ #ifndef _di_fss_basic_list_read_delete_data_ f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_basic_list_read_total_parameters) { diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index a324e69..14af7ce 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -104,8 +104,8 @@ extern "C"{ #ifndef _di_fss_basic_list_write_main_ f_return_status fss_basic_list_write_main(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_basic_list_write_total_parameters, &data->remaining); @@ -148,7 +148,7 @@ extern "C"{ } else if (data->parameters[fss_basic_list_write_parameter_version].result == f_console_result_found) { fss_basic_list_write_print_version(*data); } else { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; f_bool object = (data->parameters[fss_basic_list_write_parameter_object].result == f_console_result_found); f_dynamic_string buffer = f_dynamic_string_initialize; @@ -282,7 +282,7 @@ extern "C"{ #ifndef _di_fss_basic_list_write_delete_data_ f_return_status fss_basic_list_write_delete_data(fss_basic_list_write_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_basic_list_write_total_parameters) { diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 091f05c..dc5da71 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -118,8 +118,8 @@ extern "C"{ f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility("internal"))); f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_basic_read_total_parameters, &data->remaining); @@ -162,8 +162,8 @@ extern "C"{ } else if (data->parameters[fss_basic_read_parameter_version].result == f_console_result_found) { fss_basic_read_print_version(*data); } else if (data->remaining.used > 0 || data->process_pipe) { - f_string_length counter = f_string_length_initialize; - f_string_length target = f_string_length_initialize; + f_string_length counter = 0; + f_string_length target = 0; f_string_length original_size = data->file_position.total_elements; if (data->parameters[fss_basic_read_parameter_count].result == f_console_result_additional) { @@ -302,11 +302,11 @@ extern "C"{ } f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; - f_string_length current = f_string_length_initialize; - f_string_length found = f_string_length_initialize; + f_string_length current = 0; + f_string_length found = 0; { f_string_location input = f_string_location_initialize; @@ -385,9 +385,9 @@ extern "C"{ } else { current = 0; - f_string_length total = f_string_length_initialize; - f_string_length name_length = f_string_length_initialize; - f_string_length argv_length = f_string_length_initialize; + f_string_length total = 0; + f_string_length name_length = 0; + f_string_length argv_length = 0; if (data->parameters[fss_basic_read_parameter_name].result == f_console_result_additional) { argv_length = strlen(argv[data->parameters[fss_basic_read_parameter_name].additional.array[0]]); @@ -463,7 +463,7 @@ extern "C"{ #ifndef _di_fss_basic_read_delete_data_ f_return_status fss_basic_read_delete_data(fss_basic_read_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_basic_read_total_parameters) { diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index 82ee763..83aabfe 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -104,8 +104,8 @@ extern "C"{ #ifndef _di_fss_basic_write_main_ f_return_status fss_basic_write_main(const f_array_length argc, const f_string argv[], fss_basic_write_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_basic_write_total_parameters, &data->remaining); @@ -148,7 +148,7 @@ extern "C"{ } else if (data->parameters[fss_basic_write_parameter_version].result == f_console_result_found) { fss_basic_write_print_version(*data); } else { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; f_bool object = (data->parameters[fss_basic_write_parameter_object].result == f_console_result_found); f_dynamic_string buffer = f_dynamic_string_initialize; @@ -282,7 +282,7 @@ extern "C"{ #ifndef _di_fss_basic_write_delete_data_ f_return_status fss_basic_write_delete_data(fss_basic_write_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_basic_write_total_parameters) { diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index 61fd032..159e9e3 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -125,8 +125,8 @@ extern "C"{ f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) __attribute__((visibility("internal"))); f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_extended_read_total_parameters, &data->remaining); @@ -169,9 +169,9 @@ extern "C"{ } else if (data->parameters[fss_extended_read_parameter_version].result == f_console_result_found) { fss_extended_read_print_version(*data); } else if (data->remaining.used > 0 || data->process_pipe) { - f_string_length counter = f_string_length_initialize; - f_string_length target = f_string_length_initialize; - f_string_length select = f_string_length_initialize; + f_string_length counter = 0; + f_string_length target = 0; + f_string_length select = 0; f_string_length original_size = data->file_position.total_elements; if (data->parameters[fss_extended_read_parameter_count].result == f_console_result_additional) { @@ -316,11 +316,11 @@ extern "C"{ } f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; - f_string_length current = f_string_length_initialize; - f_string_length found = f_string_length_initialize; + f_string_length current = 0; + f_string_length found = 0; { f_string_location input = f_string_location_initialize; @@ -399,9 +399,9 @@ extern "C"{ } else { current = 0; - f_string_length total = f_string_length_initialize; - f_string_length name_length = f_string_length_initialize; - f_string_length argv_length = f_string_length_initialize; + f_string_length total = 0; + f_string_length name_length = 0; + f_string_length argv_length = 0; if (data->parameters[fss_extended_read_parameter_name].result == f_console_result_additional) { argv_length = strlen(argv[data->parameters[fss_extended_read_parameter_name].additional.array[0]]); @@ -477,7 +477,7 @@ extern "C"{ #ifndef _di_fss_extended_read_delete_data_ f_return_status fss_extended_read_delete_data(fss_extended_read_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_extended_read_total_parameters) { diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 0139847..9c6a3e4 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -111,8 +111,8 @@ extern "C"{ #ifndef _di_fss_extended_write_main_ f_return_status fss_extended_write_main(const f_array_length argc, const f_string argv[], fss_extended_write_data *data) { - f_status status = f_status_initialize; - f_status status2 = f_status_initialize; + f_status status = f_none; + f_status status2 = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_extended_write_total_parameters, &data->remaining); @@ -155,7 +155,7 @@ extern "C"{ } else if (data->parameters[fss_extended_write_parameter_version].result == f_console_result_found) { fss_extended_write_print_version(*data); } else { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; f_bool object = (data->parameters[fss_extended_write_parameter_object].result == f_console_result_found); f_dynamic_string buffer = f_dynamic_string_initialize; @@ -327,7 +327,7 @@ extern "C"{ #ifndef _di_fss_extended_write_delete_data_ f_return_status fss_extended_write_delete_data(fss_extended_write_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_extended_write_total_parameters) { diff --git a/level_3/fss_return_code/c/fss_return_code.c b/level_3/fss_return_code/c/fss_return_code.c index 1bbccfb..1296892 100644 --- a/level_3/fss_return_code/c/fss_return_code.c +++ b/level_3/fss_return_code/c/fss_return_code.c @@ -117,8 +117,8 @@ extern "C"{ #ifndef _di_fss_return_code_main_ f_return_status fss_return_code_main(const f_array_length argc, const f_string argv[], fss_return_code_data *data) { - f_status status = f_status_initialize; - f_status allocation_status = f_status_initialize; + f_status status = f_none; + f_status allocation_status = f_none; status = fl_process_parameters(argc, argv, data->parameters, fss_return_code_total_parameters, &data->remaining); @@ -161,9 +161,9 @@ extern "C"{ } else if (data->parameters[fss_return_code_parameter_version].result == f_console_result_found) { fss_return_code_print_version(*data); } else if (data->parameters[fss_return_code_parameter_is_error].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -184,9 +184,9 @@ extern "C"{ fss_return_code_delete_data(data); return f_false; } else if (data->parameters[fss_return_code_parameter_is_warning].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -207,9 +207,9 @@ extern "C"{ fss_return_code_delete_data(data); return f_false; } else if (data->parameters[fss_return_code_parameter_is_fine].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -230,7 +230,7 @@ extern "C"{ fss_return_code_delete_data(data); return f_false; } else if (data->remaining.used > 0 || data->process_pipe) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; if (data->process_pipe) { // TODO: how should this be done? @@ -258,7 +258,7 @@ extern "C"{ #ifndef _di_fss_return_code_delete_data_ f_return_status fss_return_code_delete_data(fss_return_code_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < fss_return_code_total_parameters) { diff --git a/level_3/return_code/c/return_code.c b/level_3/return_code/c/return_code.c index 04defb3..58f0ea5 100644 --- a/level_3/return_code/c/return_code.c +++ b/level_3/return_code/c/return_code.c @@ -117,8 +117,8 @@ extern "C"{ #ifndef _di_return_code_main_ f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data) { - f_status status = f_status_initialize; - f_status allocation_status = f_status_initialize; + f_status status = f_none; + f_status allocation_status = f_none; status = fl_process_parameters(argc, argv, data->parameters, return_code_total_parameters, &data->remaining); @@ -161,9 +161,9 @@ extern "C"{ } else if (data->parameters[return_code_parameter_version].result == f_console_result_found) { return_code_print_version(*data); } else if (data->parameters[return_code_parameter_is_error].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -184,9 +184,9 @@ extern "C"{ return_code_delete_data(data); return f_false; } else if (data->parameters[return_code_parameter_is_warning].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -207,9 +207,9 @@ extern "C"{ return_code_delete_data(data); return f_false; } else if (data->parameters[return_code_parameter_is_fine].result == f_console_result_found && data->remaining.used > 0) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; - f_status code = f_status_initialize; + f_status code = f_none; for (; counter < data->remaining.used; counter++) { code = (f_status) atoll(argv[data->remaining.array[counter]]); @@ -230,7 +230,7 @@ extern "C"{ return_code_delete_data(data); return f_false; } else if (data->remaining.used > 0 || data->process_pipe) { - f_array_length counter = f_array_length_initialize; + f_array_length counter = 0; if (data->process_pipe) { // TODO: how should this be done? @@ -258,7 +258,7 @@ extern "C"{ #ifndef _di_return_code_delete_data_ f_return_status return_code_delete_data(return_code_data *data) { - f_status status = f_status_initialize; + f_status status = f_none; f_string_length i = 0; while (i < return_code_total_parameters) { -- 1.8.3.1