diff options
author | rbuj <[email protected]> | 2019-02-27 12:56:19 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-03-28 13:58:49 +0100 |
commit | 83a915dc851f7d3385e0d38f57cc249e038dcd1d (patch) | |
tree | 29883b0cecffbc1ffe94fc272669119ef164763a | |
parent | 6f57d80bac06c6654f02652bcde562783a62d97f (diff) | |
download | marco-83a915dc851f7d3385e0d38f57cc249e038dcd1d.tar.bz2 marco-83a915dc851f7d3385e0d38f57cc249e038dcd1d.tar.xz |
Improve performance by removing unused assignments
-rw-r--r-- | src/core/boxes.c | 1 | ||||
-rw-r--r-- | src/core/edge-resistance.c | 4 | ||||
-rw-r--r-- | src/core/keybindings.c | 1 | ||||
-rw-r--r-- | src/core/screen.c | 3 | ||||
-rw-r--r-- | src/core/session.c | 1 | ||||
-rw-r--r-- | src/core/window.c | 9 | ||||
-rw-r--r-- | src/ui/frames.c | 6 | ||||
-rw-r--r-- | src/ui/preview-widget.c | 2 | ||||
-rw-r--r-- | src/ui/theme.c | 8 |
9 files changed, 8 insertions, 27 deletions
diff --git a/src/core/boxes.c b/src/core/boxes.c index 7ae5f699..c36abfcd 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -580,7 +580,6 @@ meta_rectangle_get_minimal_spanning_set_for_region ( *temp_rect = *basic_rect; ret = g_list_prepend (NULL, temp_rect); - strut_iter = all_struts; for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next) { GList *rect_iter; diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c index aa4fcb6a..8a0d1854 100644 --- a/src/core/edge-resistance.c +++ b/src/core/edge-resistance.c @@ -285,7 +285,6 @@ find_nearest_position (const GArray *edges, if (dist < best_dist) { best = compare; - best_dist = dist; } break; } @@ -461,7 +460,6 @@ apply_edge_resistance (MetaWindow *window, */ /* First, determine the threshold */ - threshold = 0; switch (edge->edge_type) { case META_EDGE_WINDOW: @@ -482,6 +480,8 @@ apply_edge_resistance (MetaWindow *window, else threshold = PIXEL_DISTANCE_THRESHOLD_AWAYFROM_SCREEN; break; + default: + threshold = 0; } if (ABS (compare - new_pos) < threshold) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 6211a941..7863e392 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2874,7 +2874,6 @@ handle_panel (MetaDisplay *display, Atom action_atom; XClientMessageEvent ev; - action_atom = None; switch (action) { /* FIXME: The numbers are wrong */ diff --git a/src/core/screen.c b/src/core/screen.c index e0e4e506..0b79c460 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -2167,10 +2167,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen, grid = g_new (int, grid_area); - current_row = -1; - current_col = -1; i = 0; - switch (screen->starting_corner) { case META_SCREEN_TOPLEFT: diff --git a/src/core/session.c b/src/core/session.c index 495ac950..ec1d3a71 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -881,7 +881,6 @@ save_state (void) client_id); windows = meta_display_list_windows (meta_get_display ()); - stack_position = 0; windows = g_slist_sort (windows, meta_display_stack_cmp); tmp = windows; diff --git a/src/core/window.c b/src/core/window.c index d108a0e8..01f1a6cb 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3475,8 +3475,6 @@ meta_window_move_resize_internal (MetaWindow *window, gboolean need_move_frame = FALSE; gboolean need_resize_client = FALSE; gboolean need_resize_frame = FALSE; - int frame_size_dx; - int frame_size_dy; int size_dx; int size_dy; gboolean is_configure_request; @@ -3581,7 +3579,7 @@ meta_window_move_resize_internal (MetaWindow *window, if (have_window_frame) { - int new_w, new_h; + int frame_size_dx, frame_size_dy, new_w, new_h; new_w = window->rect.width + fgeom.left_width + fgeom.right_width; @@ -3603,11 +3601,6 @@ meta_window_move_resize_internal (MetaWindow *window, window->frame->rect.width, window->frame->rect.height); } - else - { - frame_size_dx = 0; - frame_size_dy = 0; - } /* For nice effect, when growing the window we want to move/resize * the frame first, when shrinking the window we want to move/resize diff --git a/src/ui/frames.c b/src/ui/frames.c index d1a62656..87d075e9 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -1478,7 +1478,7 @@ meta_frames_button_press_event (GtkWidget *widget, (control == META_FRAME_CONTROL_MAXIMIZE || control == META_FRAME_CONTROL_UNMAXIMIZE)) { - MetaGrabOp op = META_GRAB_OP_NONE; + MetaGrabOp op; switch (control) { @@ -1490,8 +1490,6 @@ meta_frames_button_press_event (GtkWidget *widget, op = op > META_GRAB_OP_CLICKING_MAXIMIZE_HORIZONTAL ? META_GRAB_OP_CLICKING_MAXIMIZE : op; break; case META_FRAME_CONTROL_UNMAXIMIZE: - op = META_GRAB_OP_CLICKING_UNMAXIMIZE + event->button - 1; - op = op > META_GRAB_OP_CLICKING_UNMAXIMIZE_HORIZONTAL ? META_GRAB_OP_CLICKING_UNMAXIMIZE : op; op = META_GRAB_OP_CLICKING_UNMAXIMIZE; break; case META_FRAME_CONTROL_DELETE: @@ -1523,7 +1521,7 @@ meta_frames_button_press_event (GtkWidget *widget, break; default: g_assert_not_reached (); - break; + op = META_GRAB_OP_NONE; } meta_core_begin_grab_op (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c index 6dc4691c..c1c3ad0b 100644 --- a/src/ui/preview-widget.c +++ b/src/ui/preview-widget.c @@ -233,8 +233,6 @@ meta_preview_draw (GtkWidget *widget, if (preview->theme) { - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - meta_theme_draw_frame (preview->theme, widget, cr, diff --git a/src/ui/theme.c b/src/ui/theme.c index b97b0118..33a502b8 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -667,10 +667,6 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, fgeom->left_titlebar_edge = layout->left_titlebar_edge; fgeom->right_titlebar_edge = layout->right_titlebar_edge; - /* gcc warnings */ - button_width = -1; - button_height = -1; - switch (layout->button_sizing) { case META_BUTTON_SIZING_ASPECT: @@ -683,7 +679,9 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout, break; case META_BUTTON_SIZING_LAST: g_assert_not_reached (); - break; + default: + button_width = -1; + button_height = -1; } /* FIXME all this code sort of pretends that duplicate buttons |