]> Kevux Git Server - fll/commitdiff
Cleanup: printing and stale code.
authorKevin Day <thekevinday@gmail.com>
Wed, 7 Apr 2021 04:58:47 +0000 (23:58 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 7 Apr 2021 04:58:47 +0000 (23:58 -0500)
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.

level_3/controller/c/controller.c
level_3/controller/c/private-controller.c
level_3/controller/c/private-rule.c
level_3/controller/c/private-thread.c

index 31258991d08a24ad26dd51a753128656f56e883b..77abe1b7646a0b6e5676fa86b218c77dcf808493 100644 (file)
@@ -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]);
       }
     }
index c4edbfe6b4deb84a2ddb7fd5e825e7b4cd4f538f..726046a8db5b4ccb2533ae998fd14c5458174f79 100644 (file)
@@ -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_
index 2dac31c99eb02af2cdd7053d3e9d6513d2ba59be..80c73231611980b3e1b83b86e16fa6dedc8b90a7 100644 (file)
@@ -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);
 
index 84cb2c10e7affbb5bf2cc8671e56ff8ea4046600..8699528113017df635b45e1e21fa8d8edf1b863a 100644 (file)
@@ -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]);