From 5b333b8b6a96612959671350111fd790f7a88730 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 8 Sep 2019 21:15:07 -0500 Subject: [PATCH] Update: use unsigned long for argc --- level_0/f_console/c/console.h | 4 ++-- level_1/fl_console/c/console.c | 4 ++-- level_3/byte_dump/c/byte_dump.c | 1 - level_3/byte_dump/c/main.c | 2 +- level_3/firewall/c/main.c | 2 +- level_3/fss_basic_list_read/c/main.c | 2 +- level_3/fss_basic_list_write/c/main.c | 2 +- level_3/fss_basic_read/c/main.c | 2 +- level_3/fss_basic_write/c/main.c | 2 +- level_3/fss_extended_read/c/main.c | 2 +- level_3/fss_extended_write/c/main.c | 2 +- level_3/fss_status_code/c/main.c | 2 +- level_3/init/c/main.c | 2 +- level_3/status_code/c/main.c | 2 +- 14 files changed, 15 insertions(+), 16 deletions(-) diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index 5d393b4..8703194 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -203,8 +203,8 @@ extern "C" { */ #ifndef _di_f_console_arguments_ typedef struct { - const int argc; - const f_string *argv; + const unsigned long argc; + const f_string *argv; } f_console_arguments; #endif // _di_f_console_arguments_ diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index 0ea8b94..c90314e 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -14,7 +14,7 @@ extern "C" { f_console_id result = 0; f_bool found = f_false; - f_array_length location = 1; // Parameter 0 represents the program name so skip it. + unsigned long location = 1; // Parameter 0 represents the program name so skip it. f_string_length sub_location = 0; f_string_length increment_by = 0; f_string_length string_length = 0; @@ -87,7 +87,7 @@ extern "C" { needs_additional.array[i] = needs_additional.array[i + 1]; } // for } - else if (console_short > f_console_none) { + else if (console_short != f_console_none) { // The sub_location is used on a per increment basis (such as 'tar -xcf', the '-' would have an increment of 1, therefore x, c, and f would all be three separate parameters). while (sub_location < string_length) { for (parameter_counter = 0; parameter_counter < parameters.used; parameter_counter++) { diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 6c52202..ff6487f 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -74,7 +74,6 @@ extern "C" { return f_status_set_error(status); } - if (choice == byte_dump_parameter_hexidecimal) { data->mode = byte_dump_mode_hexidecimal; } diff --git a/level_3/byte_dump/c/main.c b/level_3/byte_dump/c/main.c index 7818477..9fc3443 100644 --- a/level_3/byte_dump/c/main.c +++ b/level_3/byte_dump/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; byte_dump_data data = byte_dump_data_initialize; diff --git a/level_3/firewall/c/main.c b/level_3/firewall/c/main.c index 7eac475..39af538 100644 --- a/level_3/firewall/c/main.c +++ b/level_3/firewall/c/main.c @@ -1,7 +1,7 @@ #include #include -int main(const int argc, const f_string *argv) { +int main(const f_s_int argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; firewall_data data = firewall_data_initialize; diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index 5edc171..4ccd184 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_basic_list_read_data data = fss_basic_list_read_data_initialize; diff --git a/level_3/fss_basic_list_write/c/main.c b/level_3/fss_basic_list_write/c/main.c index 2b06cb4..46161a2 100644 --- a/level_3/fss_basic_list_write/c/main.c +++ b/level_3/fss_basic_list_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_basic_list_write_data data = fss_basic_list_write_data_initialize; diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index 21a1b6f..7d796b0 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_basic_read_data data = fss_basic_read_data_initialize; diff --git a/level_3/fss_basic_write/c/main.c b/level_3/fss_basic_write/c/main.c index d2cc816..aa524b4 100644 --- a/level_3/fss_basic_write/c/main.c +++ b/level_3/fss_basic_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_basic_write_data data = fss_basic_write_data_initialize; diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index bb92005..d11baad 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_extended_read_data data = fss_extended_read_data_initialize; diff --git a/level_3/fss_extended_write/c/main.c b/level_3/fss_extended_write/c/main.c index 5098d16..e556376 100644 --- a/level_3/fss_extended_write/c/main.c +++ b/level_3/fss_extended_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_extended_write_data data = fss_extended_write_data_initialize; diff --git a/level_3/fss_status_code/c/main.c b/level_3/fss_status_code/c/main.c index 3bf1ed5..9d899c3 100644 --- a/level_3/fss_status_code/c/main.c +++ b/level_3/fss_status_code/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; fss_status_code_data data = fss_status_code_data_initialize; diff --git a/level_3/init/c/main.c b/level_3/init/c/main.c index 5b4257b..351e9ac 100644 --- a/level_3/init/c/main.c +++ b/level_3/init/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; init_argument data = init_argument_initialize; diff --git a/level_3/status_code/c/main.c b/level_3/status_code/c/main.c index fc6375e..820b4cf 100644 --- a/level_3/status_code/c/main.c +++ b/level_3/status_code/c/main.c @@ -1,6 +1,6 @@ #include -int main(const int argc, const f_string *argv) { +int main(const unsigned long argc, const f_string *argv) { const f_console_arguments arguments = { argc, argv }; status_code_data data = status_code_data_initialize; -- 1.8.3.1