]> Kevux Git Server - fll/commitdiff
Cleanup: Add missing return statements and remove unused variables.
authorKevin Day <thekevinday@gmail.com>
Sun, 31 Jul 2022 04:20:04 +0000 (23:20 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 31 Jul 2022 04:57:01 +0000 (23:57 -0500)
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/controller/c/thread/private-thread_process.c
level_3/fake/c/fake.c
level_3/fake/c/private-make-operate_validate_type.c
level_3/firewall/c/private-firewall.c
level_3/iki_read/c/private-read.c
level_3/utf8/c/private-print.c

index e46955c6a6f9f588ddd1fd34fabf7237c712ab30..36a94355bbc309141be293181478a3433fab7880 100644 (file)
@@ -2315,6 +2315,8 @@ extern "C" {
     if (F_status_is_error(status)) return status;
 
     ++setting_maps->used;
+
+    return F_none;
   }
 #endif // _di_controller_entry_settings_read_map_
 
index 2b2b81b2083076e1d291bdd66da0639541c83680..ce0ee4c4e44b68512e0506913ecf7e85cf9dd9d8 100644 (file)
@@ -969,8 +969,6 @@ extern "C" {
 
     f_string_maps_t environment = f_string_maps_t_initialize;
 
-    const f_string_dynamics_t arguments_none = f_string_dynamics_t_initialize;
-
     controller_execute_set_t execute_set = macro_controller_execute_set_t_initialize(0, 0, &environment, &signals, 0, fl_execute_as_t_initialize);
 
     if (process->rule.affinity.used) {
index dfed74ba415697232ddb11b9c1f34a3b48a0fb71..29f54446467c161681cad59a8e22803b68d908f3 100644 (file)
@@ -73,8 +73,6 @@ extern "C" {
       f_thread_mutex_unlock(&global.thread->lock.alert);
     }
 
-    f_array_length_t spent = 0;
-
     struct timespec time;
 
     controller_entry_t *entry = 0;
index 6c8f973e8764d502dded9dd7a6471cb81301b15f..4b3c64278d8fd42298e0443d31c2eac5181115ef 100644 (file)
@@ -283,7 +283,7 @@ extern "C" {
     }
 
     if (F_status_is_error_not(status) && main->process_pipe) {
-      if (operations_length > 1 || operations[0] != fake_operation_make_e) {
+      if (operations_length > 1 || operations_length && operations[0] != fake_operation_make_e) {
         status = F_status_set_error(F_parameter);
 
         if (main->error.verbosity != f_console_verbosity_quiet_e) {
index c40b3771f0547c0425ae8bf8e347896c8c375be4..9e78e013a5822d0dd140a4e5c96d9a2edff7388b 100644 (file)
@@ -233,6 +233,8 @@ extern "C" {
 
       return F_status_set_error(F_failure);
     }
+
+    return F_none;
   }
 #endif // _di_fake_make_operate_validate_type_compile_
 
index bccfe59c8fcad46333a6b5a2080160c425c41676..e9450cee4ed34f8a0442176344df59076e1d42eb 100644 (file)
@@ -14,7 +14,6 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
   bool is_ip_list = F_false;
 
   // Iptables command arguments
-  bool device_all = F_false;
   bool ip_list_direction = F_false; // false = source, true = destination.
   bool use_protocol = F_false;
   uint8_t tool = firewall_program_ip46tables_e;
@@ -37,10 +36,7 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
   f_string_dynamic_t protocol = f_string_dynamic_t_initialize;
   f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
 
-  if (local->is_global) {
-    device_all = F_true;
-  }
-  else {
+  if (!local->is_global) {
     if (data->devices.array[local->device].used) {
       device.used = 0;
 
@@ -159,8 +155,6 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
       else if (fl_string_dynamic_compare_string(local->buffer.string + local->rule_contents.array[i].array[0].start, firewall_device_all_s, length) == F_equal_to) {
         f_string_dynamic_resize(0, &device);
 
-        device_all = F_true;
-
         continue;
       }
       else if (fl_string_dynamic_compare_string(local->buffer.string + local->rule_contents.array[i].array[0].start, firewall_device_this_s, length) == F_equal_to) {
@@ -178,8 +172,6 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
           f_string_dynamic_resize(0, &device);
         }
 
-        device_all = F_false;
-
         continue;
       }
 
@@ -192,8 +184,6 @@ f_status_t firewall_perform_commands(firewall_data_t * const data, firewall_loca
           if (F_status_is_error(status)) break;
         }
 
-        device_all = F_false;
-
         continue;
       }
     }
index 0c7046ea765b288a27e2749dd59fa9b29ec3a8a9..79b2b32d0710aee4d0da9554f7cbfb2e0e455c3f 100644 (file)
@@ -348,12 +348,9 @@ extern "C" {
 
     f_string_dynamics_t names = f_string_dynamics_t_initialize;
     f_string_range_t name_range = f_string_range_t_initialize;
-    f_string_range_t substitution_range = f_string_range_t_initialize;
 
     bool name_missed = F_true;
 
-    substitution_range.start = 0;
-
     if (data->main->parameters.array[iki_read_parameter_name_e].result == f_console_result_additional_e) {
       f_array_length_t i = 0;
       f_array_length_t j = 0;
index 395116db6ca9603ed8117a9210f275e30c6dd705..32346cd68124a79fd677bdc05fa58898dbd613e9 100644 (file)
@@ -275,8 +275,6 @@ extern "C" {
     if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_found_e) return;
     if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return;
 
-    f_status_t status = F_none;
-
     if (data->mode & utf8_mode_to_combining_d) {
       utf8_print_error_combining_or_width(data);
     }