From 936a0bdea9b651ad705552600779502dfec91127 Mon Sep 17 00:00:00 2001 From: rbuj Date: Fri, 28 Jan 2022 21:07:41 +0100 Subject: Remove TRUE, FALSE from if statement --- src/core/display.c | 2 +- src/core/testboxes.c | 16 ++++++++-------- src/core/window.c | 13 +++++-------- 3 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src/core') diff --git a/src/core/display.c b/src/core/display.c index a4c22665..6af38087 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -3855,7 +3855,7 @@ meta_display_end_grab_op (MetaDisplay *display, * For raise on click mode, the window was raised at the * beginning of the grab_op. */ - if (display->grab_threshold_movement_reached == FALSE) + if (!display->grab_threshold_movement_reached) meta_window_raise (display->grab_window); } diff --git a/src/core/testboxes.c b/src/core/testboxes.c index a48afa38..3352b697 100644 --- a/src/core/testboxes.c +++ b/src/core/testboxes.c @@ -208,10 +208,10 @@ test_basic_fitting (void) { get_random_rect (&temp1); get_random_rect (&temp2); - g_assert (meta_rectangle_contains_rect (&temp1, &temp2) == FALSE || - meta_rectangle_could_fit_rect (&temp1, &temp2) == TRUE); - g_assert (meta_rectangle_contains_rect (&temp2, &temp1) == FALSE || - meta_rectangle_could_fit_rect (&temp2, &temp1) == TRUE); + g_assert (!meta_rectangle_contains_rect (&temp1, &temp2) || + meta_rectangle_could_fit_rect (&temp1, &temp2)); + g_assert (!meta_rectangle_contains_rect (&temp2, &temp1) || + meta_rectangle_could_fit_rect (&temp2, &temp1)); } temp1 = meta_rect ( 0, 0, 10, 10); @@ -694,8 +694,8 @@ test_region_fitting (void) for (i = 0; i < NUM_RANDOM_RUNS; i++) { get_random_rect (&rect); - g_assert (meta_rectangle_contained_in_region (region, &rect) == FALSE || - meta_rectangle_could_fit_in_region (region, &rect) == TRUE); + g_assert (!meta_rectangle_contained_in_region (region, &rect) || + meta_rectangle_could_fit_in_region (region, &rect)); } g_list_free_full (region, g_free); @@ -748,7 +748,7 @@ test_clamping_to_region (void) fixed_directions, &rect, &min_size); - g_assert (meta_rectangle_could_fit_in_region (region, &rect) == TRUE); + g_assert (meta_rectangle_could_fit_in_region (region, &rect)); g_assert (rect.x == temp.x && rect.y == temp.y); } g_list_free_full (region, g_free); @@ -858,7 +858,7 @@ test_clipping_to_region (void) if (rect_overlaps_region (region, &rect)) { meta_rectangle_clip_to_region (region, 0, &rect); - g_assert (meta_rectangle_contained_in_region (region, &rect) == TRUE); + g_assert (meta_rectangle_contained_in_region (region, &rect)); } } g_list_free_full (region, g_free); diff --git a/src/core/window.c b/src/core/window.c index 8e15bed6..eef77bab 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1863,11 +1863,8 @@ intervening_user_event_occurred (MetaWindow *window) * deal with that case rapidly, we use special case it--this is * merely a preliminary optimization. :) */ - if ( ((window->net_wm_user_time_set == TRUE) && - (window->net_wm_user_time == 0)) - || - ((window->initial_timestamp_set == TRUE) && - (window->initial_timestamp == 0))) + if ((window->net_wm_user_time_set && (window->net_wm_user_time == 0)) || + (window->initial_timestamp_set && (window->initial_timestamp == 0))) { meta_topic (META_DEBUG_STARTUP, "window %s explicitly requested no focus\n", @@ -1875,7 +1872,7 @@ intervening_user_event_occurred (MetaWindow *window) return TRUE; } - if (!(window->net_wm_user_time_set) && !(window->initial_timestamp_set)) + if (!window->net_wm_user_time_set && !window->initial_timestamp_set) { meta_topic (META_DEBUG_STARTUP, "no information about window %s found\n", @@ -6941,7 +6938,7 @@ menu_callback (MetaWindowMenu *menu, case META_MENU_OP_ABOVE: case META_MENU_OP_UNABOVE: - if (window->wm_state_above == FALSE) + if (!window->wm_state_above) meta_window_make_above (window); else meta_window_unmake_above (window); @@ -7991,7 +7988,7 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window, * mouse button and they almost certainly do not want a * non-snapped movement to occur from the button release. */ - if (window->display->grab_last_user_action_was_snap == FALSE) + if (!window->display->grab_last_user_action_was_snap) { if (meta_grab_op_is_moving (window->display->grab_op)) { -- cgit v1.2.1