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/compositor/compositor-xrender.c | 10 +++++----- src/core/display.c | 2 +- src/core/testboxes.c | 16 ++++++++-------- src/core/window.c | 13 +++++-------- src/ui/theme.c | 9 +++------ 5 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index d496c384..dae88fc3 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -1014,7 +1014,7 @@ window_has_shadow (MetaCompWindow *cw) { MetaCompScreen *info = meta_screen_get_compositor_data (cw->screen); - if (info == NULL || info->have_shadows == FALSE) + if (info == NULL || !info->have_shadows) return FALSE; /* Always put a shadow around windows with a frame - This should override @@ -2605,9 +2605,9 @@ process_property_notify (MetaCompositorXRender *compositor, if (!cw) return; - if (meta_prop_get_cardinal (display, event->window, - compositor->atom_net_wm_window_opacity, - &value) == FALSE) + if (!meta_prop_get_cardinal (display, event->window, + compositor->atom_net_wm_window_opacity, + &value)) value = OPAQUE; cw->opacity = (guint)value; @@ -2769,7 +2769,7 @@ process_damage (MetaCompositorXRender *compositor, repair_win (cw); #ifdef USE_IDLE_REPAINT - if (event->more == FALSE) + if (!event->more) add_repair (compositor->display); #endif } 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)) { diff --git a/src/ui/theme.c b/src/ui/theme.c index c117eeb8..a78f9ce2 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -2917,7 +2917,7 @@ meta_parse_position_expression (MetaDrawSpec *spec, val = spec->value; else { - if (pos_eval (spec, env, &spec->value, err) == FALSE) + if (!pos_eval (spec, env, &spec->value, err)) { g_assert (err == NULL || *err != NULL); return FALSE; @@ -2946,7 +2946,7 @@ meta_parse_size_expression (MetaDrawSpec *spec, val = spec->value; else { - if (pos_eval (spec, env, &spec->value, err) == FALSE) + if (!pos_eval (spec, env, &spec->value, err)) { g_assert (err == NULL || *err != NULL); return FALSE; @@ -3095,10 +3095,7 @@ meta_draw_spec_new (MetaTheme *theme, spec->n_tokens, NULL); if (spec->constant) { - gboolean result; - - result = pos_eval (spec, NULL, &spec->value, error); - if (result == FALSE) + if (!pos_eval (spec, NULL, &spec->value, error)) { meta_draw_spec_free (spec); return NULL; -- cgit v1.2.1