From 90caab3fe722c43bfcf299d82c7aca3b60c24633 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 30 Nov 2013 17:25:51 +0100 Subject: [PATCH] Remove some unused items introduced during pixelwise change. * window.c (window_resize_total_check): Remove unused function. * xdisp.c (remember_mouse_glyph): Remove unused label. (Ftool_bar_height): Move declaration inside #if. * xterm.c (x_set_window_size): Don't use r and c. --- src/ChangeLog | 8 +++++ src/window.c | 96 --------------------------------------------------- src/xdisp.c | 4 +-- src/xterm.c | 4 +-- 4 files changed, 11 insertions(+), 101 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2a24c4b1ba8..ac19a830599 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2013-11-30 Martin Rudalics + + Remove some unused items introduced during pixelwise change. + * window.c (window_resize_total_check): Remove unused function. + * xdisp.c (remember_mouse_glyph): Remove unused label. + (Ftool_bar_height): Move declaration inside #if. + * xterm.c (x_set_window_size): Don't use r and c. + 2013-11-30 Juanma Barranquero * xdisp.c (Fwindow_text_pixel_size): Remove unused variables diff --git a/src/window.c b/src/window.c index bf914662df7..e62fdad6827 100644 --- a/src/window.c +++ b/src/window.c @@ -3784,102 +3784,6 @@ window_resize_check (struct window *w, bool horflag) : FRAME_LINE_HEIGHT (f))); } -static int -window_resize_total_check (struct window *w, int horflag) -{ - struct frame *f = XFRAME (w->frame); - struct window *c; - - if (WINDOW_VERTICAL_COMBINATION_P (w)) - /* W is a vertical combination. */ - { - c = XWINDOW (w->contents); - if (horflag) - /* All child windows of W must have the same width as W. */ - { - while (c) - { - if (XINT (c->new_pixel) != XINT (w->new_pixel) -/** || XINT (c->new_total != XINT (w->new_total)) **/ - || !window_resize_check (c, horflag)) - return 0; - - c = NILP (c->next) ? 0 : XWINDOW (c->next); - } - - return 1; - } - else - /* The sum of the heights of the child windows of W must equal - W's height. */ - { - int sum_of_pixels = 0, sum_of_totals = 0; - - while (c) - { - if (!window_resize_check (c, horflag)) - return 0; - - sum_of_pixels = sum_of_pixels + XINT (c->new_pixel); -/** sum_of_totals = sum_of_totals + XINT (c->new_total); **/ - c = NILP (c->next) ? 0 : XWINDOW (c->next); - } - - return (sum_of_pixels == XINT (w->new_pixel) -/** && sum_of_totals == XINT (w->new_total) **/ - ); - } - } - else if (WINDOW_HORIZONTAL_COMBINATION_P (w)) - /* W is a horizontal combination. */ - { - c = XWINDOW (w->contents); - if (horflag) - /* The sum of the widths of the child windows of W must equal W's - width. */ - { - int sum_of_pixels = 0, sum_of_totals = 0; - - while (c) - { - if (!window_resize_check (c, horflag)) - return 0; - - sum_of_pixels = sum_of_pixels + XINT (c->new_pixel); - sum_of_totals = sum_of_totals + XINT (c->new_total); - c = NILP (c->next) ? 0 : XWINDOW (c->next); - } - - return (sum_of_pixels == XINT (w->new_pixel) -/** && sum_of_totals == XINT (w->new_total) **/ - ); - } - else - /* All child windows of W must have the same height as W. */ - { - while (c) - { - if (XINT (c->new_pixel) != XINT (w->new_pixel) -/** || XINT (c->new_total) != XINT (w->new_total) **/ - || !window_resize_check (c, horflag)) - return 0; - - c = NILP (c->next) ? 0 : XWINDOW (c->next); - } - - return 1; - } - } - else - /* A leaf window. Make sure it's not too small. The following - hardcodes the values of `window-safe-min-width' (2) and - `window-safe-min-height' (1) which are defined in window.el. */ - return (XINT (w->new_pixel) >= (horflag - ? (2 * FRAME_COLUMN_WIDTH (f)) - : FRAME_LINE_HEIGHT (f)) -/** && XINT (w->new_total) >= (horflag ? 2 : 1) **/ - ); -} /* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to w->new_pixel for window W and recursively all child windows of W. diff --git a/src/xdisp.c b/src/xdisp.c index e45a99d29d7..35db8a0d8ad 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2484,7 +2484,6 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect) goto store_rect; } - pixelwise: gx += WINDOW_LEFT_EDGE_X (w); gy += WINDOW_TOP_EDGE_Y (w); @@ -12108,10 +12107,11 @@ If FRAME is nil or omitted, use the selected frame. Optional argument PIXELWISE non-nil means return the height of the tool bar inpixels. */) (Lisp_Object frame, Lisp_Object pixelwise) { - struct frame *f = decode_any_frame (frame); int height = 0; #if ! defined (USE_GTK) && ! defined (HAVE_NS) + struct frame *f = decode_any_frame (frame); + if (WINDOWP (f->tool_bar_window) && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0) { diff --git a/src/xterm.c b/src/xterm.c index 46419aed154..9673535be79 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8747,7 +8747,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b if (NILP (tip_frame) || XFRAME (tip_frame) != f) { - int r, c, text_width, text_height; + int text_width, text_height; /* When the frame is maximized/fullscreen or running under for example Xmonad, x_set_window_size_1 will be a no-op. @@ -8764,12 +8764,10 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b #endif text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f)); text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh); - r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh); /* Update f->scroll_bar_actual_width because it is used in FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */ f->scroll_bar_actual_width = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); - c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); change_frame_size (f, text_width, text_height, 0, 1, 0, 1); } -- 2.39.2