From: Kevin Day Date: Wed, 7 Apr 2021 04:58:47 +0000 (-0500) Subject: Cleanup: printing and stale code. X-Git-Tag: 0.5.3~71 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=18d7d5fa496a108d438b58400818ae6bdf3c1995;p=fll Cleanup: printing and stale code. Structural problems related to printing. Relocate how the final newline being printed on simulate is structured in the code. Remove stale "simulate" variable that is no longer used. --- diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 3125899..77abe1b 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -320,8 +320,8 @@ extern "C" { } // ensure a newline is always put at the end of the program execution, unless in quiet mode. - if (!(status == F_child || status == F_signal) && data->error.verbosity != f_console_verbosity_quiet) { - if (F_status_is_error(status)) { + if (!(status == F_child || status == F_signal)) { + if (F_status_is_error(status) && data->error.verbosity != f_console_verbosity_quiet) { fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index c4edbfe..726046a 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -1241,20 +1241,12 @@ extern "C" { fprintf(main.data->output.stream, "%c", f_string_eol_s[0]); fprintf(main.data->output.stream, "Done processing entry item '"); fprintf(main.data->output.stream, "%s%s%s", main.data->context.set.title.before->string, controller_string_main_s, main.data->context.set.title.after->string); - fprintf(main.data->output.stream, "'.%c", f_string_eol_s[0]); + fprintf(main.data->output.stream, "'.%c%c", f_string_eol_s[0], f_string_eol_s[0]); f_thread_mutex_unlock(&main.thread->lock.print); } } - if (F_status_is_error_not(status) && simulate) { - f_thread_mutex_lock(&main.thread->lock.print); - - fprintf(main.data->output.stream, "%c", f_string_eol_s[0]); - - f_thread_mutex_unlock(&main.thread->lock.print); - } - return status; } #endif // _di_controller_process_entry_ diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index 2dac31c..80c7323 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -2121,7 +2121,6 @@ extern "C" { f_array_length_t id_rule = 0; const f_array_length_t used_original_stack = process->stack.used; - const bool simulate = main.data->parameters[controller_parameter_test].result == f_console_result_found; f_thread_lock_read(&main.thread->lock.rule); diff --git a/level_3/controller/c/private-thread.c b/level_3/controller/c/private-thread.c index 84cb2c1..8699528 100644 --- a/level_3/controller/c/private-thread.c +++ b/level_3/controller/c/private-thread.c @@ -249,7 +249,6 @@ extern "C" { if (f_file_exists(setting->path_pid.string) == F_true) { if (data->error.verbosity != f_console_verbosity_quiet) { - f_thread_mutex_lock(&thread.lock.print); fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); @@ -501,7 +500,6 @@ extern "C" { if (f_file_exists(entry->setting->path_pid.string) == F_true) { if (data->error.verbosity != f_console_verbosity_quiet) { - f_thread_mutex_lock(&entry->main->thread->lock.print); fprintf(data->error.to.stream, "%c", f_string_eol_s[0]);