]> Kevux Git Server - fll/commitdiff
Update: Optimize bitwise logic regarding removing bits.
authorKevin Day <thekevinday@gmail.com>
Wed, 3 Jan 2024 23:25:37 +0000 (17:25 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 3 Jan 2024 23:25:37 +0000 (17:25 -0600)
I intended to eventually do this and I finally got around to it.
Change the logic to use "x &= ~y" rather than "x -= x & y" or "if (x | y) x -= y".

In the case of "x -= x & y", the resulting object code is identical in my tests.
However, the code is simpler to write with the "x &= ~y".

The "if (x | y) x -= y" results in a lot more commands in the object.

21 files changed:
level_0/f_file/c/file.c
level_1/fl_conversion/c/private-conversion.c
level_3/byte_dump/c/main/common.c
level_3/control/c/main/common.c
level_3/controller/c/common.c
level_3/controller/c/controller.c
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/fake/c/main/common.c
level_3/firewall/c/common.c
level_3/fss_identify/c/main/common.c
level_3/fss_read/c/main/common.c
level_3/fss_read/c/main/main.c
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/main.c
level_3/fss_write/c/payload/fss_write.c
level_3/iki_read/c/main/common.c
level_3/iki_write/c/main/common.c
level_3/status_code/c/main/common.c
level_3/utf8/c/main/common.c

index 43804244c7bd9e0a7f64c77b4ea36e36c6554e0f..7d6a6ce0ffb6208bdb48155a7320ec6edcc30a5a 100644 (file)
@@ -694,36 +694,24 @@ extern "C" {
 
       if (mode_change & F_file_mode_t_block_special_d) {
         if (change & F_file_mode_t_mask_bit_set_owner_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_special_set_user_d) {
-            *mode -= F_file_mode_special_set_user_d;
-          }
+          *mode &= ~F_file_mode_special_set_user_d;
         }
         else if (change & F_file_mode_t_mask_bit_set_owner_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_special_set_user_d)) {
-            *mode |= F_file_mode_special_set_user_d;
-          }
+          *mode |= F_file_mode_special_set_user_d;
         }
 
         if (change & F_file_mode_t_mask_bit_set_group_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_special_set_group_d) {
-            *mode -= F_file_mode_special_set_group_d;
-          }
+          *mode &= ~F_file_mode_special_set_group_d;
         }
         else if (change & F_file_mode_t_mask_bit_set_group_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_special_set_group_d)) {
-            *mode |= F_file_mode_special_set_group_d;
-          }
+          *mode |= F_file_mode_special_set_group_d;
         }
 
         if (change & F_file_mode_t_mask_bit_sticky_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_special_sticky_d) {
-            *mode -= F_file_mode_special_sticky_d;
-          }
+          *mode &= ~F_file_mode_special_sticky_d;
         }
         else if (change & F_file_mode_t_mask_bit_sticky_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_special_sticky_d)) {
-            *mode |= F_file_mode_special_sticky_d;
-          }
+          *mode |= F_file_mode_special_sticky_d;
         }
       }
     }
@@ -753,39 +741,27 @@ extern "C" {
 
       if (mode_change & F_file_mode_t_block_owner_d) {
         if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_owner_r_d) {
-            *mode -= F_file_mode_owner_r_d;
-          }
+          *mode &= ~F_file_mode_owner_r_d;
         }
         else if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_owner_r_d)) {
-            *mode |= F_file_mode_owner_r_d;
-          }
+          *mode |= F_file_mode_owner_r_d;
         }
 
         if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_owner_w_d) {
-            *mode -= F_file_mode_owner_w_d;
-          }
+          *mode &= ~F_file_mode_owner_w_d;
         }
         else if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_owner_w_d)) {
-            *mode |= F_file_mode_owner_w_d;
-          }
+          *mode |= F_file_mode_owner_w_d;
         }
 
         if (change & F_file_mode_t_mask_bit_execute_d) {
           change &= F_file_mode_t_mask_bit_execute_d;
 
           if (change & F_file_mode_t_mask_how_subtract_d) {
-            if (*mode & F_file_mode_owner_x_d) {
-              *mode -= F_file_mode_owner_x_d;
-            }
+            *mode &= ~F_file_mode_owner_x_d;
           }
           else if (change & F_file_mode_t_mask_how_add_d) {
-            if (!(*mode & F_file_mode_owner_x_d)) {
-              *mode |= F_file_mode_owner_x_d;
-            }
+            *mode |= F_file_mode_owner_x_d;
           }
         }
         else if (change & F_file_mode_t_mask_bit_execute_only_d) {
@@ -793,14 +769,10 @@ extern "C" {
 
           if (directory_is || (mode_file & F_file_mode_owner_x_d)) {
             if (change & F_file_mode_t_mask_how_subtract_d) {
-              if (*mode & F_file_mode_owner_x_d) {
-                *mode -= F_file_mode_owner_x_d;
-              }
+              *mode &= ~F_file_mode_owner_x_d;
             }
             else if (change & F_file_mode_t_mask_how_add_d) {
-              if (!(*mode & F_file_mode_owner_x_d)) {
-                *mode |= F_file_mode_owner_x_d;
-              }
+              *mode |= F_file_mode_owner_x_d;
             }
           }
         }
@@ -832,39 +804,27 @@ extern "C" {
 
       if (mode_change & F_file_mode_t_block_group_d) {
         if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_group_r_d) {
-            *mode -= F_file_mode_group_r_d;
-          }
+          *mode &= ~F_file_mode_group_r_d;
         }
         else if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_group_r_d)) {
-            *mode |= F_file_mode_group_r_d;
-          }
+          *mode |= F_file_mode_group_r_d;
         }
 
         if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_group_w_d) {
-            *mode -= F_file_mode_group_w_d;
-          }
+          *mode &= ~F_file_mode_group_w_d;
         }
         else if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_group_w_d)) {
-            *mode |= F_file_mode_group_w_d;
-          }
+          *mode |= F_file_mode_group_w_d;
         }
 
         if (change & F_file_mode_t_mask_bit_execute_d) {
           change &= F_file_mode_t_mask_bit_execute_d;
 
           if (change & F_file_mode_t_mask_how_subtract_d) {
-            if (*mode & F_file_mode_group_x_d) {
-              *mode -= F_file_mode_group_x_d;
-            }
+            *mode &= ~F_file_mode_group_x_d;
           }
           else if (change & F_file_mode_t_mask_how_add_d) {
-            if (!(*mode & F_file_mode_group_x_d)) {
-              *mode |= F_file_mode_group_x_d;
-            }
+            *mode |= F_file_mode_group_x_d;
           }
         }
         else if (change & F_file_mode_t_mask_bit_execute_only_d) {
@@ -872,14 +832,10 @@ extern "C" {
 
           if (directory_is || (mode_file & F_file_mode_group_x_d)) {
             if (change & F_file_mode_t_mask_how_subtract_d) {
-              if (*mode & F_file_mode_group_x_d) {
-                *mode -= F_file_mode_group_x_d;
-              }
+              *mode &= ~F_file_mode_group_x_d;
             }
             else if (change & F_file_mode_t_mask_how_add_d) {
-              if (!(*mode & F_file_mode_group_x_d)) {
-                *mode |= F_file_mode_group_x_d;
-              }
+              *mode |= F_file_mode_group_x_d;
             }
           }
         }
@@ -911,39 +867,27 @@ extern "C" {
 
       if (mode_change & F_file_mode_t_block_world_d) {
         if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_world_r_d) {
-            *mode -= F_file_mode_world_r_d;
-          }
+          *mode &= ~F_file_mode_world_r_d;
         }
         else if (change & F_file_mode_t_mask_bit_read_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_world_r_d)) {
-            *mode |= F_file_mode_world_r_d;
-          }
+          *mode |= F_file_mode_world_r_d;
         }
 
         if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_subtract_d) {
-          if (*mode & F_file_mode_world_w_d) {
-            *mode -= F_file_mode_world_w_d;
-          }
+          *mode &= ~F_file_mode_world_w_d;
         }
         else if (change & F_file_mode_t_mask_bit_write_d & F_file_mode_t_mask_how_add_d) {
-          if (!(*mode & F_file_mode_world_w_d)) {
-            *mode |= F_file_mode_world_w_d;
-          }
+          *mode |= F_file_mode_world_w_d;
         }
 
         if (change & F_file_mode_t_mask_bit_execute_d) {
           change &= F_file_mode_t_mask_bit_execute_d;
 
           if (change & F_file_mode_t_mask_how_subtract_d) {
-            if (*mode & F_file_mode_world_x_d) {
-              *mode -= F_file_mode_world_x_d;
-            }
+            *mode &= ~F_file_mode_world_x_d;
           }
           else if (change & F_file_mode_t_mask_how_add_d) {
-            if (!(*mode & F_file_mode_world_x_d)) {
-              *mode |= F_file_mode_world_x_d;
-            }
+            *mode |= F_file_mode_world_x_d;
           }
         }
         else if (change & F_file_mode_t_mask_bit_execute_only_d) {
@@ -951,14 +895,10 @@ extern "C" {
 
           if (directory_is || (mode_file & F_file_mode_world_x_d)) {
             if (change & F_file_mode_t_mask_how_subtract_d) {
-              if (*mode & F_file_mode_world_x_d) {
-                *mode -= F_file_mode_world_x_d;
-              }
+              *mode &= ~F_file_mode_world_x_d;
             }
             else if (change & F_file_mode_t_mask_how_add_d) {
-              if (!(*mode & F_file_mode_world_x_d)) {
-                *mode |= F_file_mode_world_x_d;
-              }
+              *mode |= F_file_mode_world_x_d;
             }
           }
         }
@@ -1096,7 +1036,7 @@ extern "C" {
 
             // Clear by mask to prepare for replacement, which includes clearing the special block.
             mode_mask |= F_file_mode_t_block_special_d;
-            mode_result -= mode_result & mode_mask;
+            mode_result &= ~mode_mask;
 
             replace_result |= F_file_mode_t_replace_special_d;
 
@@ -1167,7 +1107,7 @@ extern "C" {
               incomplete = F_false;
 
               if (how > 3) {
-                mode_result -= mode_result & mode_umask;
+                mode_result &= ~mode_umask;
               }
 
               on = 0;
@@ -1190,7 +1130,7 @@ extern "C" {
 
                 // Clear by mask to prepare for replacement, which includes clearing the special block.
                 mode_mask |= F_file_mode_t_block_special_d;
-                mode_result -= mode_result & mode_mask;
+                mode_result &= ~mode_mask;
 
                 replace_result |= F_file_mode_t_replace_special_d;
 
@@ -1217,25 +1157,19 @@ extern "C" {
               if (how == 1 || how == 2 || how == 4 || how == 5) {
                 incomplete = F_false;
                 mode_result |= what & mode_mask & F_file_mode_t_mask_how_add_d;
-
-                if (mode_result & what & mode_mask & F_file_mode_t_mask_how_subtract_d) {
-                  mode_result -= mode_result & what & mode_mask & F_file_mode_t_mask_how_subtract_d;
-                }
+                mode_result &= ~F_file_mode_t_mask_how_subtract_d;
               }
               else if (how == 3 || how == 6) {
                 incomplete = F_false;
                 mode_result |= what & mode_mask & F_file_mode_t_mask_how_subtract_d;
-
-                if (mode_result & what & mode_mask & F_file_mode_t_mask_how_add_d) {
-                  mode_result -= mode_result & what & mode_mask & F_file_mode_t_mask_how_add_d;
-                }
+                mode_result &= ~F_file_mode_t_mask_how_add_d;
               }
             }
           } // for
 
           if (how > 3) {
             incomplete = F_false;
-            mode_result -= mode_result & mode_umask;
+            mode_result &= ~mode_umask;
           }
 
           if (!code.string[i]) break;
index 29239b8054a8aa483e9254299484f9205d2815dd..7148c703932b20fe290e2c5a48898231450a661d 100644 (file)
@@ -435,8 +435,8 @@ extern "C" {
     if (vector == -1) {
       data.flag |= fl_conversion_data_flag_negative_e;
     }
-    else if (data.flag & fl_conversion_data_flag_negative_e) {
-      data.flag -= fl_conversion_data_flag_negative_e;
+    else {
+      data.flag &= ~fl_conversion_data_flag_negative_e;
     }
 
     if (mode == 10 || mode == 16 || mode == 12 || mode == 8) {
@@ -578,9 +578,7 @@ extern "C" {
 
     fl_conversion_data_t data = macro_fl_conversion_data_t_initialize_1(mode, flag);
 
-    if (data.flag & fl_conversion_data_flag_negative_e) {
-      data.flag -= fl_conversion_data_flag_negative_e;
-    }
+    data.flag &= ~fl_conversion_data_flag_negative_e;
 
     if (mode == 10 || mode == 16 || mode == 12 || mode == 8) {
       status = private_fl_conversion_dynamic_to_base_unsigned(data, string + offset, length - offset, number);
index ab1ab90b69a04bc6b0fbf338b6d22146620679d8..dc9042889cb2f80664c5a3a9f3a4156db7cd8896 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & byte_dump_main_flag_print_first_e;
+      main->setting.flag &= ~byte_dump_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= byte_dump_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & byte_dump_main_flag_print_last_e;
+      main->setting.flag &= ~byte_dump_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= byte_dump_main_flag_print_last_e;
@@ -154,9 +154,7 @@ extern "C" {
         }
 
         if (choices.array[choice] == byte_dump_parameter_narrow_e) {
-          if (main->setting.flag & byte_dump_main_flag_wide_e) {
-            main->setting.flag -= byte_dump_main_flag_wide_e;
-          }
+          main->setting.flag &= ~byte_dump_main_flag_wide_e;
         }
         else if (choices.array[choice] == byte_dump_parameter_wide_e) {
           main->setting.flag |= byte_dump_main_flag_wide_e;
@@ -189,7 +187,7 @@ extern "C" {
       main->setting.flag |= byte_dump_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & byte_dump_main_flag_pipe_e;
+      main->setting.flag &= ~byte_dump_main_flag_pipe_e;
     }
 
     if (main->program.parameters.array[byte_dump_parameter_width_e].result & f_console_result_value_e) {
@@ -284,7 +282,7 @@ extern "C" {
           return;
         }
         else {
-          main->setting.flag -= flags[i] & main->setting.flag;
+          main->setting.flag &= ~flags[i];
         }
       } // for
 
@@ -310,28 +308,28 @@ extern "C" {
       main->setting.flag |= byte_dump_main_flag_text_e;
     }
     else {
-      main->setting.flag -= byte_dump_main_flag_text_e & main->setting.flag;
+      main->setting.flag &= ~byte_dump_main_flag_text_e;
     }
 
     if (main->program.parameters.array[byte_dump_parameter_unicode_e].result & f_console_result_found_e) {
       main->setting.flag |= byte_dump_main_flag_unicode_e;
     }
     else {
-      main->setting.flag -= byte_dump_main_flag_unicode_e & main->setting.flag;
+      main->setting.flag &= ~byte_dump_main_flag_unicode_e;
     }
 
     if (main->program.parameters.array[byte_dump_parameter_placeholder_e].result & f_console_result_found_e) {
       main->setting.flag |= byte_dump_main_flag_placeholder_e;
     }
     else {
-      main->setting.flag -= byte_dump_main_flag_placeholder_e & main->setting.flag;
+      main->setting.flag &= ~byte_dump_main_flag_placeholder_e;
     }
 
     if (main->program.parameters.array[byte_dump_parameter_classic_e].result & f_console_result_found_e) {
       main->setting.flag |= byte_dump_main_flag_classic_e;
     }
     else {
-      main->setting.flag -= byte_dump_main_flag_classic_e & main->setting.flag;
+      main->setting.flag &= ~byte_dump_main_flag_classic_e;
     }
 
     if (main->program.parameters.remaining.used) {
index db2c474d34ce5b4e4bb0623469a193f8ae6cfcb0..baf392a22259353a560c5d6258b800284f35261e 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & control_main_flag_print_first_e;
+      main->setting.flag &= ~control_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= control_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & control_main_flag_print_last_e;
+      main->setting.flag &= ~control_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= control_main_flag_print_last_e;
@@ -94,7 +94,7 @@ extern "C" {
       main->setting.flag |= control_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & control_main_flag_pipe_e;
+      main->setting.flag &= ~control_main_flag_pipe_e;
     }
 
     // The settings path is statically allocated.
index a9d714a62d0a0be9ed9aec5f92ea013880e14f5e..ea5d781d047fd182515c4977af815c251b5d0e52 100644 (file)
@@ -633,14 +633,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & controller_main_flag_print_first_e;
+      main->setting.flag &= ~controller_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= controller_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & controller_main_flag_print_last_e;
+      main->setting.flag &= ~controller_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= controller_main_flag_print_last_e;
index e0c7633e37a3ba1328c1655a4e153682c9513c7d..2d66ea68745975f31fd9d60f4f0bc1b5f27d7a7a 100644 (file)
@@ -273,15 +273,13 @@ extern "C" {
       if (main->parameters.array[controller_parameter_interruptible_e].result & f_console_result_found_e) {
         setting.flag |= controller_setting_flag_interruptible_e;
       }
-      else if (setting.flag & controller_setting_flag_interruptible_e) {
-        setting.flag -= controller_setting_flag_interruptible_e;
+      else {
+        setting.flag &= ~controller_setting_flag_interruptible_e;
       }
     }
     else {
       if (main->parameters.array[controller_parameter_uninterruptible_e].result & f_console_result_found_e) {
-        if (setting.flag & controller_setting_flag_interruptible_e) {
-          setting.flag -= controller_setting_flag_interruptible_e;
-        }
+        setting.flag &= ~controller_setting_flag_interruptible_e;
       }
       else {
         setting.flag |= controller_setting_flag_interruptible_e;
index fc3620d4c0545196332a95cadc66950d819b6def..289c0f595af67c0ae0d87085d16c9a9e798d7e3f 100644 (file)
@@ -526,9 +526,7 @@ extern "C" {
 
             if (action->status == F_okay) {
               if (action->parameters.used == 2) {
-                if (action->flag & controller_entry_action_flag_undefined_e) {
-                  action->flag -= controller_entry_action_flag_undefined_e;
-                }
+                action->flag &= ~controller_entry_action_flag_undefined_e;
 
                 status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, action->parameters.array[1], &action->number);
 
@@ -1803,9 +1801,7 @@ extern "C" {
                   for (k = 0; k < entry->items.used; ++k) {
 
                     if (f_compare_dynamic(action->parameters.array[0], entry->items.array[k].name) == F_equal_to) {
-                      if (missing & 0x1) {
-                        missing -= 0x1;
-                      }
+                      missing &= ~0x1;
 
                       break;
                     }
@@ -1962,9 +1958,7 @@ extern "C" {
           }
         }
         else {
-          if (global.setting->control.flag & controller_control_flag_readonly_e) {
-            global.setting->control.flag -= controller_control_flag_readonly_e;
-          }
+          global.setting->control.flag &= ~controller_control_flag_readonly_e;
         }
 
         cache->action.generic.used = 0;
@@ -2236,10 +2230,7 @@ extern "C" {
             continue;
           }
 
-          if (entry->flag & controller_entry_flag_timeout_exit_no_e) {
-            entry->flag -= controller_entry_flag_timeout_exit_no_e;
-          }
-
+          entry->flag &= ~controller_entry_flag_timeout_exit_no_e;
           time = &entry->timeout_exit;
         }
         else if (f_compare_dynamic_partial_string(controller_kill_s.string, cache->buffer_file, controller_kill_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
@@ -2249,10 +2240,7 @@ extern "C" {
             continue;
           }
 
-          if (entry->flag & controller_entry_flag_timeout_kill_no_e) {
-            entry->flag -= controller_entry_flag_timeout_kill_no_e;
-          }
-
+          entry->flag &= ~controller_entry_flag_timeout_kill_no_e;
           time = &entry->timeout_kill;
         }
         else if (f_compare_dynamic_partial_string(controller_start_s.string, cache->buffer_file, controller_start_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
@@ -2262,10 +2250,7 @@ extern "C" {
             continue;
           }
 
-          if (entry->flag & controller_entry_flag_timeout_start_no_e) {
-            entry->flag -= controller_entry_flag_timeout_start_no_e;
-          }
-
+          entry->flag &= ~controller_entry_flag_timeout_start_no_e;
           time = &entry->timeout_start;
         }
         else if (f_compare_dynamic_partial_string(controller_stop_s.string, cache->buffer_file, controller_stop_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) {
@@ -2275,10 +2260,7 @@ extern "C" {
             continue;
           }
 
-          if (entry->flag & controller_entry_flag_timeout_stop_no_e) {
-            entry->flag -= controller_entry_flag_timeout_stop_no_e;
-          }
-
+          entry->flag &= ~controller_entry_flag_timeout_stop_no_e;
           time = &entry->timeout_stop;
         }
         else {
index a0e22031460509f02c71c1a122cfaa2e8420153f..ca7a3074e4acfc9cf1a1adfe5d7735a3ce08e776 100644 (file)
@@ -535,17 +535,13 @@ extern "C" {
               item->with |= controller_with_session_new_d;
 
               // The "session_new" and "session_same" are mutually exclusive.
-              if (item->with & controller_with_session_same_d) {
-                item->with -= controller_with_session_same_d;
-              }
+              item->with &= ~controller_with_session_same_d;
             }
             else if (f_compare_dynamic_partial_string(controller_session_same_s.string, cache->buffer_item, controller_session_same_s.used, cache->content_action.array[i]) == F_equal_to) {
               item->with |= controller_with_session_same_d;
 
               // The "session_new" and "session_same" are mutually exclusive.
-              if (item->with & controller_with_session_new_d) {
-                item->with -= controller_with_session_new_d;
-              }
+              item->with &= ~controller_with_session_new_d;
             }
             else {
               if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
index 702a56491d637ec3a081f75781ee296f34721be4..4767ee1ba39e0e352c78aa4dcdbccef85002db5b 100644 (file)
@@ -27,14 +27,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fake_main_flag_print_first_e;
+      main->setting.flag &= ~fake_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= fake_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fake_main_flag_print_last_e;
+      main->setting.flag &= ~fake_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= fake_main_flag_print_last_e;
@@ -99,7 +99,7 @@ extern "C" {
       main->setting.flag |= fake_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fake_main_flag_pipe_e;
+      main->setting.flag &= ~fake_main_flag_pipe_e;
     }
 
     {
@@ -129,7 +129,7 @@ extern "C" {
           if (main->program.parameters.array[enables[i]].result & f_console_result_found_e) {
             if (main->program.parameters.array[disables[i]].result & f_console_result_found_e) {
               if (main->program.parameters.array[enables[i]].location < main->program.parameters.array[disables[i]].location) {
-                main->setting.flag -= main->setting.flag & flags[i];
+                main->setting.flag &= ~flags[i];
               }
               else {
                 main->setting.flag |= flags[i];
@@ -140,7 +140,7 @@ extern "C" {
             }
           }
           else if (main->program.parameters.array[disables[i]].result & f_console_result_found_e) {
-            main->setting.flag -= main->setting.flag & flags[i];
+            main->setting.flag &= ~flags[i];
           }
         } // for
       }
@@ -447,7 +447,7 @@ extern "C" {
     }
     else {
       main->setting.flag |= fake_main_flag_operation_make_e;
-      main->setting.flag -= main->setting.flag & fake_main_flag_operation_e;
+      main->setting.flag &= ~fake_main_flag_operation_e;
 
       main->setting.state.status = f_memory_array_increase_by(1, sizeof(uint8_t), (void **) &main->setting.operations.array, &main->setting.operations.used, &main->setting.operations.size);
 
index 59566585b04eb9f8743fca57407905b636d1e90a..6b19cf74972b939c5c20414733694dd5904b5995 100644 (file)
@@ -123,14 +123,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & firewall_main_flag_print_first_e;
+      main->setting.flag &= ~firewall_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= firewall_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & firewall_main_flag_print_last_e;
+      main->setting.flag &= ~firewall_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= firewall_main_flag_print_last_e;
index 714e4433ca047d1892b72c9cce0127215d7ad14d..d154a55784e5b672c91bbfba46744c7051e913a2 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_print_first_e;
+      main->setting.flag &= ~fss_identify_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= fss_identify_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_print_last_e;
+      main->setting.flag &= ~fss_identify_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= fss_identify_main_flag_print_last_e;
@@ -88,21 +88,21 @@ extern "C" {
       main->setting.flag |= fss_identify_main_flag_content_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_content_e;
+      main->setting.flag &= ~fss_identify_main_flag_content_e;
     }
 
     if (main->program.parameters.array[fss_identify_parameter_object_e].result & f_console_result_found_e) {
       main->setting.flag |= fss_identify_main_flag_object_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_object_e;
+      main->setting.flag &= ~fss_identify_main_flag_object_e;
     }
 
     if (main->program.parameters.array[fss_identify_parameter_total_e].result & f_console_result_found_e) {
       main->setting.flag |= fss_identify_main_flag_total_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_total_e;
+      main->setting.flag &= ~fss_identify_main_flag_total_e;
     }
 
     if (main->program.parameters.array[fss_identify_parameter_line_e].result & f_console_result_value_e) {
@@ -139,7 +139,7 @@ extern "C" {
       return;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_line_e;
+      main->setting.flag &= ~fss_identify_main_flag_line_e;
     }
 
     if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_value_e) {
@@ -253,7 +253,7 @@ extern "C" {
       return;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_parameter_name_e;
+      main->setting.flag &= ~fss_identify_parameter_name_e;
     }
 
     if (main->program.parameters.remaining.used) {
@@ -286,14 +286,14 @@ extern "C" {
       main->setting.flag |= fss_identify_main_flag_file_from_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_file_from_e;
+      main->setting.flag &= ~fss_identify_main_flag_file_from_e;
     }
 
     if (main->program.pipe & fll_program_data_pipe_input_e) {
       main->setting.flag |= fss_identify_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_identify_main_flag_pipe_e;
+      main->setting.flag &= ~fss_identify_main_flag_pipe_e;
     }
 
     if (!(main->setting.flag & fss_identify_main_flag_pipe_e | fss_identify_main_flag_file_from_e)) {
index 403e51d2fd81174d800693881a737b9adccdfc9f..cd4862cddcebfa070fc1dd9cb63cf2f7a4934f1f 100644 (file)
@@ -55,14 +55,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (parameters->array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_read_main_flag_print_first_e;
+      main->setting.flag &= ~fss_read_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= fss_read_main_flag_print_first_e;
     }
 
     if (parameters->array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_read_main_flag_print_last_e;
+      main->setting.flag &= ~fss_read_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= fss_read_main_flag_print_last_e;
@@ -139,7 +139,7 @@ extern "C" {
       main->setting.flag |= fss_read_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_read_main_flag_pipe_e;
+      main->setting.flag &= ~fss_read_main_flag_pipe_e;
     }
 
     {
index 4ba12a5958726cdef532e9b4162e9e3621e5eb75..059405435708a10701b3876fce33b9192f19bdf3 100644 (file)
@@ -113,12 +113,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     // Setup default standard (except for process_help): FSS-0000 (Basic).
     main->setting.standard = fss_read_basic_standard_s;
 
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_content_multiple_e;
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_object_as_line_e;
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_object_trim_e;
-    main->setting.flag -= main->setting.flag & fss_read_main_flag_trim_object_e;
+    main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+    main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+    main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+    main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
+    main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+    main->setting.flag &= ~fss_read_main_flag_trim_object_e;
 
     main->setting.flag |= fss_read_main_flag_line_single_e;
     main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
@@ -150,12 +150,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_basic_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_object_as_line_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_object_trim_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_trim_object_e;
+          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
+          main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+          main->setting.flag &= ~fss_read_main_flag_trim_object_e;
 
           main->setting.flag |= fss_read_main_flag_line_single_e;
           main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
@@ -176,11 +176,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_extended_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_object_as_line_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_object_trim_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_trim_object_e;
+          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
+          main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+          main->setting.flag &= ~fss_read_main_flag_trim_object_e;
 
           main->setting.flag |= fss_read_main_flag_line_single_e | fss_read_main_flag_content_multiple_e;
           main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
@@ -201,12 +201,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_basic_list_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_line_single_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
+          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_line_single_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
 
           main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
 
@@ -226,11 +226,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_extended_list_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_line_single_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
+          main->setting.flag &= ~fss_read_main_flag_line_single_e;
+          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
 
           main->setting.flag |= fss_read_main_flag_content_has_close_e;
           main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
@@ -251,10 +251,10 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_embedded_list_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_line_single_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
+          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+          main->setting.flag &= ~fss_read_main_flag_line_single_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
 
           main->setting.flag |= fss_read_main_flag_content_has_close_e | fss_read_main_flag_content_multiple_e;
           main->setting.flag |= fss_read_main_flag_depth_multiple_e;
@@ -276,12 +276,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_read_payload_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_has_close_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_content_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_depth_multiple_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_line_single_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
-          main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
+          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+          main->setting.flag &= ~fss_read_main_flag_line_single_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
 
           main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
 
index 6c478419ff45e80961c39daf6a87a21d09d2804e..203c3b3fd46725a9d1ef8b2b739b587ef16cdd0a 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_write_main_flag_print_first_e;
+      main->setting.flag &= ~fss_write_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= fss_write_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & fss_write_main_flag_print_last_e;
+      main->setting.flag &= ~fss_write_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= fss_write_main_flag_print_last_e;
@@ -84,7 +84,7 @@ extern "C" {
       main->setting.flag |= fss_write_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & fss_write_main_flag_pipe_e;
+      main->setting.flag &= ~fss_write_main_flag_pipe_e;
     }
 
     if (callback) {
@@ -544,9 +544,7 @@ extern "C" {
     else {
 
       // There is no Object or Content, so remove ignores if set.
-      if (main->setting.flag & fss_write_main_flag_ignore_e) {
-        main->setting.flag -= fss_write_main_flag_ignore_e;
-      }
+      main->setting.flag &= ~fss_write_main_flag_ignore_e;
     }
 
     if (main->program.parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
index 6faa74a63b61a5526ec1fd1966ad2ef3127a819c..24f322f7155eb3d05247ee546e7c4cb01fd6428b 100644 (file)
@@ -257,7 +257,7 @@ extern "C" {
         }
 
         // Reset the "has Content for Object" flag and associated contents array used length.
-        flag -= flag | 0x4;
+        flag &= ~0x4;
         main->setting.contents->used = 0;
 
         main->setting.state.status = f_memory_array_increase_by(main->setting.block.used, sizeof(f_char_t), (void **) &main->setting.object->string, &main->setting.object->used, &main->setting.object->size);
index 1160b0fb328951b563f439ab32ff81c73ece782e..ceeb28e7daeac0b46efdd9ce3114470c057aa319 100644 (file)
@@ -122,8 +122,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_write_basic_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_ignore_e;
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_content_multiple_e;
+          main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e);
 
           main->callback.process_content = &fss_write_basic_process_content;
           main->callback.process_help = &fss_write_basic_process_help;
@@ -140,8 +139,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_write_extended_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_ignore_e;
-
+          main->setting.flag &= ~fss_write_main_flag_ignore_e;
           main->setting.flag |= fss_write_main_flag_content_multiple_e;
 
           main->callback.process_content = &fss_write_extended_process_content;
@@ -159,8 +157,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_write_basic_list_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_ignore_e;
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_content_multiple_e;
+          main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e);
 
           main->callback.process_content = &fss_write_basic_list_process_content;
           main->callback.process_help = &fss_write_basic_list_process_help;
@@ -177,8 +174,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_write_extended_list_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_content_multiple_e;
-
+          main->setting.flag &= ~fss_write_main_flag_content_multiple_e;
           main->setting.flag |= fss_write_main_flag_ignore_e;
 
           main->callback.process_content = &fss_write_extended_list_process_content;
@@ -213,8 +209,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           main->setting.standard = fss_write_payload_standard_s;
 
           // Remove flags not supported for this standard.
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_ignore_e;
-          main->setting.flag -= main->setting.flag & fss_write_main_flag_content_multiple_e;
+          main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e);
 
           main->callback.process_content = 0;
           main->callback.process_help = &fss_write_payload_process_help;
index 105bde922a01672a5353ec0a15e2fc3f440401ee..4a4f90713f5f4fa2328f493cd4b8cbbd0288b6da 100644 (file)
@@ -129,7 +129,7 @@ extern "C" {
         }
 
         // Reset the "has Content for Object" flag and associated contents array used length.
-        flag -= flag | 0x4;
+        flag &= ~0x4;
         main->setting.contents->used = 0;
 
         main->setting.state.status = f_memory_array_increase_by(main->setting.block.used, sizeof(f_char_t), (void **) &main->setting.object->string, &main->setting.object->used, &main->setting.object->size);
index b2b5355780ae73446f978a11c18bee65109fbc54..4752e1ef08cd295740e6f29eb15c445fadd15f3b 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & iki_read_main_flag_print_first_e;
+      main->setting.flag &= ~iki_read_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= iki_read_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & iki_read_main_flag_print_last_e;
+      main->setting.flag &= ~iki_read_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= iki_read_main_flag_print_last_e;
@@ -86,7 +86,7 @@ extern "C" {
       main->setting.flag |= iki_read_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & iki_read_main_flag_pipe_e;
+      main->setting.flag &= ~iki_read_main_flag_pipe_e;
     }
 
     if (!(main->program.parameters.remaining.used || (main->program.pipe & fll_program_data_pipe_input_e))) {
index 5595c72e9b8e96bc0c3d06af7fd86326f44c44a6..e21e33d8f8cda21fa5d0b5a35f43cc2811435b84 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & iki_write_main_flag_print_first_e;
+      main->setting.flag &= ~iki_write_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= iki_write_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & iki_write_main_flag_print_last_e;
+      main->setting.flag &= ~iki_write_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= iki_write_main_flag_print_last_e;
@@ -90,7 +90,7 @@ extern "C" {
       main->setting.flag |= iki_write_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & iki_write_main_flag_pipe_e;
+      main->setting.flag &= ~iki_write_main_flag_pipe_e;
     }
 
     if (main->program.parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->program.parameters.array[iki_write_parameter_file_e].values.used) {
index 35d7b54e75cbde3c4de219a963b81848f1b84c42..90358390f85c04f42f3a0211a677c4ef6da65411 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & status_code_main_flag_print_first_e;
+      main->setting.flag &= ~status_code_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= status_code_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & status_code_main_flag_print_last_e;
+      main->setting.flag &= ~status_code_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= status_code_main_flag_print_last_e;
@@ -86,7 +86,7 @@ extern "C" {
       main->setting.flag |= status_code_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & status_code_main_flag_pipe_e;
+      main->setting.flag &= ~status_code_main_flag_pipe_e;
     }
 
     if (main->program.parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) {
index 10f1a641756e1502d150cad54dc3899afe3c2fd5..9a79b2a43132bdb219fae6d873cbeca95a8869bd 100644 (file)
@@ -17,14 +17,14 @@ extern "C" {
 
     // Identify and process first/last parameters.
     if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & utf8_main_flag_print_first_e;
+      main->setting.flag &= ~utf8_main_flag_print_first_e;
     }
     else {
       main->setting.flag |= utf8_main_flag_print_first_e;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
-      main->setting.flag -= main->setting.flag & utf8_main_flag_print_last_e;
+      main->setting.flag &= ~utf8_main_flag_print_last_e;
     }
     else {
       main->setting.flag |= utf8_main_flag_print_last_e;
@@ -88,11 +88,11 @@ extern "C" {
         }
 
         if (choices.array[choice] == utf8_parameter_from_bytesequence_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_from_codepoint_e;
+          main->setting.mode &= ~utf8_mode_from_codepoint_e;
           main->setting.mode |= utf8_mode_from_bytesequence_e;
         }
         else if (choices.array[choice] == utf8_parameter_from_codepoint_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_from_bytesequence_e;
+          main->setting.mode &= ~utf8_mode_from_bytesequence_e;
           main->setting.mode |= utf8_mode_from_codepoint_e;
         }
       }
@@ -117,22 +117,15 @@ extern "C" {
         }
 
         if (choices.array[choice] == utf8_parameter_to_bytesequence_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_to_codepoint_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_combining_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_width_e;
-
+          main->setting.mode &= ~(utf8_mode_to_codepoint_e | utf8_mode_to_combining_e | utf8_mode_to_width_e);
           main->setting.mode |= utf8_mode_to_bytesequence_e;
         }
         else if (choices.array[choice] == utf8_parameter_to_codepoint_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_to_bytesequence_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_combining_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_width_e;
-
+          main->setting.mode &= ~(utf8_mode_to_bytesequence_e | utf8_mode_to_combining_e | utf8_mode_to_width_e);
           main->setting.mode |= utf8_mode_to_codepoint_e;
         }
         else if (choices.array[choice] == utf8_parameter_to_combining_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_to_bytesequence_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_codepoint_e;
+          main->setting.mode &= ~(utf8_mode_to_bytesequence_e | utf8_mode_to_codepoint_e);
 
           // --to_width may be specified with --to_combining.
           if (main->program.parameters.array[utf8_parameter_to_width_e].result & f_console_result_found_e) {
@@ -142,8 +135,7 @@ extern "C" {
           main->setting.mode |= utf8_mode_to_combining_e;
         }
         else if (choices.array[choice] == utf8_parameter_to_width_e) {
-          main->setting.mode -= main->setting.mode & utf8_mode_to_bytesequence_e;
-          main->setting.mode -= main->setting.mode & utf8_mode_to_codepoint_e;
+          main->setting.mode &= ~(utf8_mode_to_bytesequence_e | utf8_mode_to_codepoint_e);
 
           // --to_width may be specified with --to_combining.
           if (main->program.parameters.array[utf8_parameter_to_combining_e].result & f_console_result_found_e) {
@@ -177,7 +169,7 @@ extern "C" {
       main->setting.flag |= utf8_main_flag_pipe_e;
     }
     else {
-      main->setting.flag -= main->setting.flag & utf8_main_flag_pipe_e;
+      main->setting.flag &= ~utf8_main_flag_pipe_e;
     }
 
     if (main->program.parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) {
@@ -263,7 +255,7 @@ extern "C" {
     }
     else {
       main->program.output.to = main->program.message.to;
-      main->setting.flag -= main->setting.flag & utf8_main_flag_file_to_e;
+      main->setting.flag &= ~utf8_main_flag_file_to_e;
     }
 
     if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_value_e) {
@@ -343,7 +335,7 @@ extern "C" {
       return;
     }
     else {
-      main->setting.flag -= main->setting.flag & utf8_main_flag_file_from_e;
+      main->setting.flag &= ~utf8_main_flag_file_from_e;
     }
 
     if (main->program.parameters.remaining.used) {