From 2ba606d8dd6838e1fd2074f77c2a4e75c1b976c4 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 9 May 2022 20:55:52 -0500 Subject: [PATCH] Update: Remove unused code, cast (char) to (unsigned int) for array indexes, and fix bitwise problem. A bit of stale code is exposed by running the compiler with -Wall. Example: fake clean build -d -Wall fake clean build -d -Wall -m clang Using char (generally) is fine because the numbers match. However, there tends to be specific cases and behaviors that might result in char being not treated as expected. Explicitly cast to an (unsigned int) to play it safe. The fwrite_unlocked() response checks were previously mass refactored to use a size check on the response. Mistakes in this resulted in the the not operation "!" being left there resulting in a bad if condition check. Clang warnings about not having parenthesis when using "&&" and "||". I would argue that this is simply an ignorance or incompetence in the programmers. The programmers should be expected to understand basic parts of a language, such as order of operations. Rather than fight this battle, I am just adding parenthesis. --- level_0/f_conversion/c/conversion.c | 4 +-- level_0/f_file/c/file.c | 8 ++--- level_0/f_print/c/print.c | 2 +- level_0/f_print/c/print/private-to.c | 11 ++---- level_0/f_print/c/private-print.c | 12 ++----- level_1/fl_directory/c/private-directory.c | 2 -- level_1/fl_print/c/private-print.c | 58 ++++++++++-------------------- level_1/fl_string/c/private-string.c | 8 ----- level_2/fll_execute/c/execute.c | 2 +- level_2/fll_fss/c/fss/embedded_list.c | 1 - level_2/fll_program/c/program.c | 6 ++-- 11 files changed, 31 insertions(+), 83 deletions(-) diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index e261414..49033e5 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -122,7 +122,7 @@ extern "C" { return F_none; } - if (character > 0x40 && character < 0x43 || character > 0x60 && character < 0x63) { + if ((character > 0x40 && character < 0x43) || (character > 0x60 && character < 0x63)) { *number = 9 + (0xf & character); return F_none; @@ -144,7 +144,7 @@ extern "C" { return F_none; } - if (character > 0x40 && character < 0x47 || character > 0x60 && character < 0x67) { + if ((character > 0x40 && character < 0x47) || (character > 0x60 && character < 0x67)) { *number = 9 + (0xf & character); return F_none; diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index 026ba26..0fcb4fa 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -1249,11 +1249,7 @@ extern "C" { // 1 = add, 2 = replace, 3 = subtract. uint8_t how = 0; - // 0 = none, 0x1 = leading zero. - uint8_t option = 0; - f_array_length_t i = 0; - f_array_length_t j = 0; if (code.string[0] == f_string_ascii_plus_s.string[0]) { how = 1; @@ -1865,7 +1861,7 @@ extern "C" { #ifndef _di_f_file_role_change_ f_status_t f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference) { - if (uid == -1 && gid == -1 || !path.used) { + if ((uid == -1 && gid == -1) || !path.used) { return F_data_not; } @@ -1876,7 +1872,7 @@ extern "C" { #ifndef _di_f_file_role_change_at_ f_status_t f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag) { - if (uid == -1 && gid == -1 || !path.used) { + if ((uid == -1 && gid == -1) || !path.used) { return F_data_not; } diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index 825b7e1..c36e435 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -55,7 +55,7 @@ extern "C" { } } else { - if (fwrite_unlocked(f_print_sequence_set_control_s[character].string, 1, f_print_sequence_set_control_s[character].used, output) == f_print_sequence_set_control_s[character].used) { + if (fwrite_unlocked(f_print_sequence_set_control_s[(unsigned int) character].string, 1, f_print_sequence_set_control_s[(unsigned int) character].used, output) == f_print_sequence_set_control_s[(unsigned int) character].used) { return F_none; } } diff --git a/level_0/f_print/c/print/private-to.c b/level_0/f_print/c/print/private-to.c index 990ac65..5332178 100644 --- a/level_0/f_print/c/print/private-to.c +++ b/level_0/f_print/c/print/private-to.c @@ -15,6 +15,7 @@ extern "C" { * The appropriate status. */ static inline f_status_t private_inline_f_print_to_error(void) { + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); if (errno == EBADF) return F_status_set_error(F_file_descriptor); if (errno == EDESTADDRREQ) return F_status_set_error(F_socket_not); @@ -83,7 +84,7 @@ static inline f_status_t private_inline_f_print_to_error(void) { } } else { - if (write(id, f_print_sequence_set_control_s[character].string, f_print_sequence_set_control_s[character].used) != -1) { + if (write(id, f_print_sequence_set_control_s[(unsigned int) character].string, f_print_sequence_set_control_s[(unsigned int) character].used) != -1) { return F_none; } } @@ -198,7 +199,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { f_array_length_t start = offset; f_array_length_t total = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_empty_s; uint8_t width = 0; @@ -274,7 +274,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { f_array_length_t start = offset; f_array_length_t total = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_empty_s; uint8_t width = 0; @@ -506,7 +505,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { f_array_length_t start = i; f_array_length_t total = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_empty_s; uint8_t width = 0; @@ -612,7 +610,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { f_array_length_t start = i; f_array_length_t total = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_empty_s; uint8_t width = 0; @@ -764,8 +761,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { #if !defined(_di_f_print_to_dynamic_raw_safely_) || !defined(_di_f_print_to_dynamic_partial_raw_safely_) || !defined(_di_f_print_to_raw_safely_) f_status_t private_f_print_to_raw_safely(const f_string_t string, const f_array_length_t length, const int id) { - f_status_t status = F_none; - register f_array_length_t i = 0; f_array_length_t start = 0; f_array_length_t total = 0; @@ -831,8 +826,6 @@ static inline f_status_t private_inline_f_print_to_error(void) { #if !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_safely_) f_status_t private_f_print_to_safely(const f_string_t string, const f_array_length_t length, const int id) { - f_status_t status = F_none; - register f_array_length_t i = 0; f_array_length_t start = 0; f_array_length_t total = 0; diff --git a/level_0/f_print/c/private-print.c b/level_0/f_print/c/private-print.c index cf153c2..f6dd92b 100644 --- a/level_0/f_print/c/private-print.c +++ b/level_0/f_print/c/private-print.c @@ -63,7 +63,7 @@ extern "C" { return f_string_empty_s; } - return f_print_sequence_set_control_s[character]; + return f_print_sequence_set_control_s[(unsigned int) character]; } #endif // !defined(_di_f_print_character_safely_get_) || !defined(_di_f_print_dynamic_partial_safely_) || !defined(_di_f_print_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_safely_) @@ -340,7 +340,6 @@ extern "C" { f_array_length_t total = 0; f_array_length_t count = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_static_t_initialize; uint8_t width = 0; @@ -492,7 +491,6 @@ extern "C" { f_array_length_t total = 0; f_array_length_t count = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_static_t_initialize; uint8_t width = 0; @@ -726,7 +724,6 @@ extern "C" { f_array_length_t total = 0; f_array_length_t count = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_static_t_initialize; uint8_t width = 0; @@ -836,7 +833,6 @@ extern "C" { f_array_length_t total = 0; f_array_length_t count = 0; - f_status_t status = F_none; f_string_static_t safe = f_string_static_t_initialize; uint8_t width = 0; @@ -1011,8 +1007,6 @@ extern "C" { #if !defined(_di_f_print_raw_safely_) || !defined(_di_f_print_raw_safely_dynamic_) || !defined(_di_f_print_raw_safely_dynamic_partial_) f_status_t private_f_print_raw_safely(const f_string_t string, const f_array_length_t length, FILE * const output) { - f_status_t status = F_none; - register f_array_length_t i = 0; f_array_length_t start = 0; f_array_length_t total = 0; @@ -1109,8 +1103,6 @@ extern "C" { #if !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_dynamic_) || !defined(_di_f_print_safely_dynamic_partial_) f_status_t private_f_print_safely(const f_string_t string, const f_array_length_t length, FILE * const output) { - f_status_t status = F_none; - register f_array_length_t i = 0; f_array_length_t start = 0; f_array_length_t total = 0; @@ -1239,7 +1231,7 @@ extern "C" { return f_string_empty_s; } - return f_print_sequence_set_control_s[character[0]]; + return f_print_sequence_set_control_s[(unsigned int) character[0]]; } #endif // !defined(_di_f_print_character_safely_get_) || !defined(_di_f_print_dynamic_partial_safely_) || !defined(_di_f_print_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_safely_) diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index f7b3eff..f087cb5 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -450,7 +450,6 @@ extern "C" { struct dirent **entity = 0; - f_array_length_t size = 0; f_status_t status = F_none; DIR *parent = opendir(path.string); @@ -490,7 +489,6 @@ extern "C" { f_string_static_t name_directory = f_string_static_t_initialize; f_string_dynamics_t *names = 0; - f_array_length_t total = 0; struct stat file_stat; int mode = 0; size_t i = 0; diff --git a/level_1/fl_print/c/private-print.c b/level_1/fl_print/c/private-print.c index 94f9b4f..32332e3 100644 --- a/level_1/fl_print/c/private-print.c +++ b/level_1/fl_print/c/private-print.c @@ -484,9 +484,6 @@ extern "C" { } } else { - const f_array_lengths_t except_at = f_array_lengths_t_initialize; - const f_string_ranges_t except_in = f_string_ranges_t_initialize; - if (partial.start > partial.stop) { *status = F_data_not; @@ -886,9 +883,6 @@ extern "C" { } } else { - const f_array_lengths_t except_at = f_array_lengths_t_initialize; - const f_string_ranges_t except_in = va_arg(apl, f_string_ranges_t); - if (partial.start > partial.stop) { *status = F_data_not; @@ -1254,8 +1248,6 @@ extern "C" { i += macro_f_utf_byte_width(string[i]); } // while - f_string_t s = 0; - while (i < length) { while (at < except_at.used && except_at.array[at] < i) { @@ -1465,8 +1457,6 @@ extern "C" { i += macro_f_utf_byte_width(string[i]); } // while - f_string_t s = 0; - while (i < length) { while (at < except_at.used && except_at.array[at] < i) { @@ -1528,7 +1518,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length) break; @@ -1589,8 +1579,6 @@ extern "C" { f_status_t status = F_none; - f_string_t s = 0; - // Skip past leading whitespace. while (i < length) { @@ -1689,7 +1677,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length || status == F_true) break; @@ -1718,7 +1706,7 @@ extern "C" { } if (i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -1746,7 +1734,7 @@ extern "C" { } } else { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } } @@ -1768,7 +1756,7 @@ extern "C" { } if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -1805,8 +1793,6 @@ extern "C" { f_status_t status = F_none; - f_string_t s = 0; - // Skip past leading whitespace. while (i < length) { @@ -1905,7 +1891,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length || status == F_true || !string[i]) break; @@ -1934,7 +1920,7 @@ extern "C" { } if (i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -1958,7 +1944,7 @@ extern "C" { } } else { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } } @@ -1980,7 +1966,7 @@ extern "C" { } if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -2037,8 +2023,6 @@ extern "C" { i += macro_f_utf_byte_width(string[i]); } // while - f_string_t s = 0; - while (i < length) { status = f_utf_is_whitespace(string + i, (length - i) + 1); @@ -2162,8 +2146,6 @@ extern "C" { i += macro_f_utf_byte_width(string[i]); } // while - f_string_t s = 0; - while (i < length) { status = f_utf_is_whitespace(string + i, (length - i) + 1); @@ -2183,7 +2165,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length) break; @@ -2220,8 +2202,6 @@ extern "C" { f_status_t status = F_none; - f_string_t s = 0; - // Skip past leading whitespace. while (i < length) { @@ -2258,7 +2238,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length || status == F_true) break; @@ -2267,7 +2247,7 @@ extern "C" { while (i < j) { if (i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -2295,7 +2275,7 @@ extern "C" { } } else { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } } @@ -2317,7 +2297,7 @@ extern "C" { } if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -2350,8 +2330,6 @@ extern "C" { f_status_t status = F_none; - f_string_t s = 0; - // Skip past leading whitespace. while (i < length) { @@ -2388,7 +2366,7 @@ extern "C" { status = f_utf_is_whitespace(string + j, (length - j) + 1); - if (F_status_is_error(status) || status == F_false && string[i]) break; + if (F_status_is_error(status) || (status == F_false && string[i])) break; } // while if (j == length || status == F_true || !string[i]) break; @@ -2397,7 +2375,7 @@ extern "C" { while (i < j) { if (i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } @@ -2421,7 +2399,7 @@ extern "C" { } } else { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } } @@ -2443,7 +2421,7 @@ extern "C" { } if (status == F_false || i + macro_f_utf_byte_width(string[i]) >= length) { - if (!fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { + if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, stream) < f_print_sequence_unknown_s.used) { return F_status_set_error(F_output); } diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index ae970d3..f5a1ab6 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -340,14 +340,6 @@ extern "C" { f_array_length_t i1 = offset1; f_array_length_t i2 = offset2; - f_string_static_t debug1; - debug1.string = string1 + offset1; - debug1.used = (stop1 - offset1) + 1; - - f_string_static_t debug2; - debug2.string = string2 + offset2; - debug2.used = (stop2 - offset2) + 1; - uint8_t width = 0; f_array_length_t width_max = 0; f_status_t status = F_none; diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index a4fbdaa..c5cf3cf 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -293,7 +293,7 @@ extern "C" { private_fll_execute_path_arguments_fixate(program.used ? program : arguments.array[0], arguments, last_slash, !program.used, program_name, fixed_arguments); // Determine full path when the environment is to be cleared or full path is explicitly requested. - if (parameter && parameter->environment || parameter && (parameter->option & FL_execute_parameter_option_path_d)) { + if ((parameter && parameter->environment) || (parameter && (parameter->option & FL_execute_parameter_option_path_d))) { f_string_dynamic_t path = f_string_dynamic_t_initialize; f_string_dynamics_t paths = f_string_dynamics_t_initialize; f_string_dynamic_t *found = 0; diff --git a/level_2/fll_fss/c/fss/embedded_list.c b/level_2/fll_fss/c/fss/embedded_list.c index 6cd0d27..9bf5141 100644 --- a/level_2/fll_fss/c/fss/embedded_list.c +++ b/level_2/fll_fss/c/fss/embedded_list.c @@ -14,7 +14,6 @@ extern "C" { #endif // _di_level_2_parameter_checking_ f_status_t status = F_none; - f_status_t status2 = F_none; f_array_length_t initial_used = 0; bool found_data = F_false; diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index e47bd72..3b41cfc 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -377,11 +377,11 @@ extern "C" { return F_interrupt_not; } - fll_program_data_t *main = (fll_program_data_t *) state_ptr->custom; + fll_program_data_t *data = (fll_program_data_t *) state_ptr->custom; - main->signal_received = fll_program_standard_signal_received(main); + data->signal_received = fll_program_standard_signal_received(data); - if (main->signal_received == F_signal_abort || main->signal_received == F_signal_broken_pipe || main->signal_received == F_signal_hangup || main->signal_received == F_signal_interrupt || main->signal_received == F_signal_quit || main->signal_received == F_signal_termination) { + if (data->signal_received == F_signal_abort || data->signal_received == F_signal_broken_pipe || data->signal_received == F_signal_hangup || data->signal_received == F_signal_interrupt || data->signal_received == F_signal_quit || data->signal_received == F_signal_termination) { return F_status_set_error(F_interrupt); } -- 1.8.3.1