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.
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;
}
}
}
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) {
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;
}
}
}
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) {
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;
}
}
}
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) {
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;
}
}
}
// 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;
incomplete = F_false;
if (how > 3) {
- mode_result -= mode_result & mode_umask;
+ mode_result &= ~mode_umask;
}
on = 0;
// 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;
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;
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) {
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);
// 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;
}
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;
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) {
return;
}
else {
- main->setting.flag -= flags[i] & main->setting.flag;
+ main->setting.flag &= ~flags[i];
}
} // for
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) {
// 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;
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.
// 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;
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;
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);
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;
}
}
}
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;
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) {
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) {
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) {
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 {
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) {
// 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;
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;
}
{
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];
}
}
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
}
}
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);
// 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;
// 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;
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) {
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) {
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) {
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)) {
// 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;
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;
}
{
// 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;
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;
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;
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;
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;
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;
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;
// 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;
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) {
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) {
}
// 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);
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;
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;
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;
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;
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;
}
// 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);
// 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;
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))) {
// 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;
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) {
// 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;
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) {
// 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;
}
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;
}
}
}
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) {
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) {
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) {
}
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) {
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) {