From: Kevin Day Date: Tue, 4 Jul 2023 03:05:03 +0000 (-0500) Subject: Cleanup: Don't bother with != for existence modulus checks. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=9f56da2e48c8aa7e18c7ff38c632007eb5d3546b;p=fll Cleanup: Don't bother with != for existence modulus checks. The 'X % 2' and 'X % 3' will be non-zero with they are not divisible by the given unit. The '!= 0' check is not necessary. --- diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index ee59d68..dfcce31 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -360,7 +360,7 @@ extern "C" { } if ((main->program.parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_ignore_e].values.used) { - if (main->program.parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) { + if (main->program.parameters.array[fss_write_parameter_ignore_e].values.used % 2) { main->setting.state.status = F_status_set_error(F_parameter); if ((main->setting.flag & fss_write_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 3dfe8e4..29cbade 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -259,7 +259,7 @@ extern "C" { } if (main->program.parameters.array[iki_read_parameter_replace_e].result != f_console_result_none_e) { - if ((main->program.parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_replace_e].values.used % 2 != 0) { + if ((main->program.parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_replace_e].values.used % 2) { main->setting.state.status = F_status_set_error(F_parameter); if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { @@ -354,7 +354,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) return; if (main->program.parameters.array[iki_read_parameter_wrap_e].result != f_console_result_none_e) { - if ((main->program.parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_wrap_e].values.used % 3 != 0) { + if ((main->program.parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->program.parameters.array[iki_read_parameter_wrap_e].values.used % 3) { main->setting.state.status = F_status_set_error(F_parameter); if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { @@ -605,7 +605,7 @@ extern "C" { if (!(parameter.result & f_console_result_found_e)) return F_false; - if ((parameter.result & f_console_result_found_e) || parameter.values.used % 3 != 0) { + if ((parameter.result & f_console_result_found_e) || parameter.values.used % 3) { main->setting.state.status = F_status_set_error(F_parameter); if ((main->setting.flag & iki_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {