diff options
| author | Martin Rudalics | 2013-11-30 17:25:51 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2013-11-30 17:25:51 +0100 |
| commit | 90caab3fe722c43bfcf299d82c7aca3b60c24633 (patch) | |
| tree | 3c01222da6e554e0502a8f17491ab89a04964d9a /src | |
| parent | 6ae87264fd7d9ce6614e7048bc57a431d480098a (diff) | |
| download | emacs-90caab3fe722c43bfcf299d82c7aca3b60c24633.tar.gz emacs-90caab3fe722c43bfcf299d82c7aca3b60c24633.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/window.c | 96 | ||||
| -rw-r--r-- | src/xdisp.c | 4 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2013-11-30 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | Remove some unused items introduced during pixelwise change. | ||
| 4 | * window.c (window_resize_total_check): Remove unused function. | ||
| 5 | * xdisp.c (remember_mouse_glyph): Remove unused label. | ||
| 6 | (Ftool_bar_height): Move declaration inside #if. | ||
| 7 | * xterm.c (x_set_window_size): Don't use r and c. | ||
| 8 | |||
| 1 | 2013-11-30 Juanma Barranquero <lekktu@gmail.com> | 9 | 2013-11-30 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 10 | ||
| 3 | * xdisp.c (Fwindow_text_pixel_size): Remove unused variables | 11 | * 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) | |||
| 3784 | : FRAME_LINE_HEIGHT (f))); | 3784 | : FRAME_LINE_HEIGHT (f))); |
| 3785 | } | 3785 | } |
| 3786 | 3786 | ||
| 3787 | static int | ||
| 3788 | window_resize_total_check (struct window *w, int horflag) | ||
| 3789 | { | ||
| 3790 | struct frame *f = XFRAME (w->frame); | ||
| 3791 | struct window *c; | ||
| 3792 | |||
| 3793 | if (WINDOW_VERTICAL_COMBINATION_P (w)) | ||
| 3794 | /* W is a vertical combination. */ | ||
| 3795 | { | ||
| 3796 | c = XWINDOW (w->contents); | ||
| 3797 | if (horflag) | ||
| 3798 | /* All child windows of W must have the same width as W. */ | ||
| 3799 | { | ||
| 3800 | while (c) | ||
| 3801 | { | ||
| 3802 | if (XINT (c->new_pixel) != XINT (w->new_pixel) | ||
| 3803 | /** || XINT (c->new_total != XINT (w->new_total)) **/ | ||
| 3804 | || !window_resize_check (c, horflag)) | ||
| 3805 | return 0; | ||
| 3806 | |||
| 3807 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | ||
| 3808 | } | ||
| 3809 | |||
| 3810 | return 1; | ||
| 3811 | } | ||
| 3812 | else | ||
| 3813 | /* The sum of the heights of the child windows of W must equal | ||
| 3814 | W's height. */ | ||
| 3815 | { | ||
| 3816 | int sum_of_pixels = 0, sum_of_totals = 0; | ||
| 3817 | |||
| 3818 | while (c) | ||
| 3819 | { | ||
| 3820 | if (!window_resize_check (c, horflag)) | ||
| 3821 | return 0; | ||
| 3822 | |||
| 3823 | sum_of_pixels = sum_of_pixels + XINT (c->new_pixel); | ||
| 3824 | /** sum_of_totals = sum_of_totals + XINT (c->new_total); **/ | ||
| 3825 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | ||
| 3826 | } | ||
| 3827 | |||
| 3828 | return (sum_of_pixels == XINT (w->new_pixel) | ||
| 3829 | /** && sum_of_totals == XINT (w->new_total) **/ | ||
| 3830 | ); | ||
| 3831 | } | ||
| 3832 | } | ||
| 3833 | else if (WINDOW_HORIZONTAL_COMBINATION_P (w)) | ||
| 3834 | /* W is a horizontal combination. */ | ||
| 3835 | { | ||
| 3836 | c = XWINDOW (w->contents); | ||
| 3837 | if (horflag) | ||
| 3838 | /* The sum of the widths of the child windows of W must equal W's | ||
| 3839 | width. */ | ||
| 3840 | { | ||
| 3841 | int sum_of_pixels = 0, sum_of_totals = 0; | ||
| 3842 | |||
| 3843 | while (c) | ||
| 3844 | { | ||
| 3845 | if (!window_resize_check (c, horflag)) | ||
| 3846 | return 0; | ||
| 3847 | |||
| 3848 | sum_of_pixels = sum_of_pixels + XINT (c->new_pixel); | ||
| 3849 | sum_of_totals = sum_of_totals + XINT (c->new_total); | ||
| 3850 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | ||
| 3851 | } | ||
| 3852 | |||
| 3853 | return (sum_of_pixels == XINT (w->new_pixel) | ||
| 3854 | /** && sum_of_totals == XINT (w->new_total) **/ | ||
| 3855 | ); | ||
| 3856 | } | ||
| 3857 | else | ||
| 3858 | /* All child windows of W must have the same height as W. */ | ||
| 3859 | { | ||
| 3860 | while (c) | ||
| 3861 | { | ||
| 3862 | if (XINT (c->new_pixel) != XINT (w->new_pixel) | ||
| 3863 | /** || XINT (c->new_total) != XINT (w->new_total) **/ | ||
| 3864 | || !window_resize_check (c, horflag)) | ||
| 3865 | return 0; | ||
| 3866 | |||
| 3867 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | ||
| 3868 | } | ||
| 3869 | |||
| 3870 | return 1; | ||
| 3871 | } | ||
| 3872 | } | ||
| 3873 | else | ||
| 3874 | /* A leaf window. Make sure it's not too small. The following | ||
| 3875 | hardcodes the values of `window-safe-min-width' (2) and | ||
| 3876 | `window-safe-min-height' (1) which are defined in window.el. */ | ||
| 3877 | return (XINT (w->new_pixel) >= (horflag | ||
| 3878 | ? (2 * FRAME_COLUMN_WIDTH (f)) | ||
| 3879 | : FRAME_LINE_HEIGHT (f)) | ||
| 3880 | /** && XINT (w->new_total) >= (horflag ? 2 : 1) **/ | ||
| 3881 | ); | ||
| 3882 | } | ||
| 3883 | 3787 | ||
| 3884 | /* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to | 3788 | /* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to |
| 3885 | w->new_pixel for window W and recursively all child windows of W. | 3789 | 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) | |||
| 2484 | goto store_rect; | 2484 | goto store_rect; |
| 2485 | } | 2485 | } |
| 2486 | 2486 | ||
| 2487 | pixelwise: | ||
| 2488 | gx += WINDOW_LEFT_EDGE_X (w); | 2487 | gx += WINDOW_LEFT_EDGE_X (w); |
| 2489 | gy += WINDOW_TOP_EDGE_Y (w); | 2488 | gy += WINDOW_TOP_EDGE_Y (w); |
| 2490 | 2489 | ||
| @@ -12108,10 +12107,11 @@ If FRAME is nil or omitted, use the selected frame. Optional argument | |||
| 12108 | PIXELWISE non-nil means return the height of the tool bar inpixels. */) | 12107 | PIXELWISE non-nil means return the height of the tool bar inpixels. */) |
| 12109 | (Lisp_Object frame, Lisp_Object pixelwise) | 12108 | (Lisp_Object frame, Lisp_Object pixelwise) |
| 12110 | { | 12109 | { |
| 12111 | struct frame *f = decode_any_frame (frame); | ||
| 12112 | int height = 0; | 12110 | int height = 0; |
| 12113 | 12111 | ||
| 12114 | #if ! defined (USE_GTK) && ! defined (HAVE_NS) | 12112 | #if ! defined (USE_GTK) && ! defined (HAVE_NS) |
| 12113 | struct frame *f = decode_any_frame (frame); | ||
| 12114 | |||
| 12115 | if (WINDOWP (f->tool_bar_window) | 12115 | if (WINDOWP (f->tool_bar_window) |
| 12116 | && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0) | 12116 | && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0) |
| 12117 | { | 12117 | { |
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 | |||
| 8747 | 8747 | ||
| 8748 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) | 8748 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
| 8749 | { | 8749 | { |
| 8750 | int r, c, text_width, text_height; | 8750 | int text_width, text_height; |
| 8751 | 8751 | ||
| 8752 | /* When the frame is maximized/fullscreen or running under for | 8752 | /* When the frame is maximized/fullscreen or running under for |
| 8753 | example Xmonad, x_set_window_size_1 will be a no-op. | 8753 | 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 | |||
| 8764 | #endif | 8764 | #endif |
| 8765 | text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f)); | 8765 | text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f)); |
| 8766 | text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh); | 8766 | text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh); |
| 8767 | r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh); | ||
| 8768 | /* Update f->scroll_bar_actual_width because it is used in | 8767 | /* Update f->scroll_bar_actual_width because it is used in |
| 8769 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */ | 8768 | FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */ |
| 8770 | f->scroll_bar_actual_width | 8769 | f->scroll_bar_actual_width |
| 8771 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); | 8770 | = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
| 8772 | c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); | ||
| 8773 | change_frame_size (f, text_width, text_height, 0, 1, 0, 1); | 8771 | change_frame_size (f, text_width, text_height, 0, 1, 0, 1); |
| 8774 | } | 8772 | } |
| 8775 | 8773 | ||