From 421353fec9f3607eb2e71d4c64f6a5c249526692 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 4 Mar 2023 20:01:15 -0600 Subject: [PATCH] Cleanup: Perform status child check before file check in Featureless Make. The file check is rather expensive and the child check is not. The process is an existing child when status is set to child. This process should not perform the file check. --- level_3/fake/c/private-build-library.c | 6 +++--- level_3/fake/c/private-build-object.c | 6 +++--- level_3/fake/c/private-build-objects.c | 2 +- level_3/fake/c/private-build-program.c | 6 +++--- level_3/fake/c/private-build-skeleton.c | 2 +- level_3/fake/c/private-build.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/level_3/fake/c/private-build-library.c b/level_3/fake/c/private-build-library.c index 7b0a7a6..67131ec 100644 --- a/level_3/fake/c/private-build-library.c +++ b/level_3/fake/c/private-build-library.c @@ -10,7 +10,7 @@ extern "C" { #ifndef _di_fake_build_library_script_ int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; fake_build_touch(data, file_stage, status); @@ -21,7 +21,7 @@ extern "C" { #ifndef _di_fake_build_library_shared_ int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { @@ -443,7 +443,7 @@ extern "C" { #ifndef _di_fake_build_library_static_ int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { diff --git a/level_3/fake/c/private-build-object.c b/level_3/fake/c/private-build-object.c index 465f1ee..78150f9 100644 --- a/level_3/fake/c/private-build-object.c +++ b/level_3/fake/c/private-build-object.c @@ -11,7 +11,7 @@ extern "C" { #ifndef _di_fake_build_object_script_ int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; fake_build_touch(data, file_stage, status); @@ -22,7 +22,7 @@ extern "C" { #ifndef _di_fake_build_object_shared_ int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { @@ -93,7 +93,7 @@ extern "C" { #ifndef _di_fake_build_object_static_ int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { diff --git a/level_3/fake/c/private-build-objects.c b/level_3/fake/c/private-build-objects.c index 29e50c1..6494e78 100644 --- a/level_3/fake/c/private-build-objects.c +++ b/level_3/fake/c/private-build-objects.c @@ -11,7 +11,7 @@ extern "C" { #ifndef _di_fake_build_objects_static_ int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_library.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { diff --git a/level_3/fake/c/private-build-program.c b/level_3/fake/c/private-build-program.c index 4f81738..e0e47e4 100644 --- a/level_3/fake/c/private-build-program.c +++ b/level_3/fake/c/private-build-program.c @@ -11,7 +11,7 @@ extern "C" { #ifndef _di_fake_build_program_script_ int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; fake_build_touch(data, file_stage, status); @@ -22,7 +22,7 @@ extern "C" { #ifndef _di_fake_build_program_shared_ int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { @@ -116,7 +116,7 @@ extern "C" { #ifndef _di_fake_build_program_static_ int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0; if (data->main->output.verbosity != f_console_verbosity_quiet_e && data->main->output.verbosity != f_console_verbosity_error_e) { diff --git a/level_3/fake/c/private-build-skeleton.c b/level_3/fake/c/private-build-skeleton.c index 8e15020..26e3a5a 100644 --- a/level_3/fake/c/private-build-skeleton.c +++ b/level_3/fake/c/private-build-skeleton.c @@ -11,7 +11,7 @@ extern "C" { #ifndef _di_fake_build_skeleton_ void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return; f_string_static_t path_headers = f_string_static_t_initialize; path_headers.used = data->path_build_includes.used + data_build->setting.path_headers.used; diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index ba6a10c..8139a7c 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -346,7 +346,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static #ifndef _di_fake_build_copy_ void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return; if (fll_program_standard_signal_received(data->main)) { fake_print_signal_received(data); @@ -553,7 +553,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static #ifndef _di_fake_build_execute_process_script_ int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(*status)|| *status == F_child || f_file_exists(file_stage, F_true) == F_true) return data->main->child; if (!process_script.used) return 0; f_string_dynamics_t arguments = f_string_dynamics_t_initialize; -- 1.8.3.1