comparison src/window.c @ 110564:08d10ad776d8

Fix int/EMACS_INT use in textprop.c and window.c. window.c (Fpos_visible_in_window_p, Fdelete_other_windows) (Fselect_window, window_scroll_pixel_based) (window_scroll_line_based, Frecenter, Fset_window_configuration): Use EMACS_INT for buffer positions. textprop.c (validate_interval_range, interval_of) (property_change_between_p, Fadd_text_properties) (set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties, Ftext_property_any) (Ftext_property_not_all, copy_text_properties) (text_property_list, extend_property_ranges) (verify_interval_modification): Use EMACS_INT for buffer positions.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 25 Sep 2010 09:21:20 -0400
parents d349244d7b08
children 589830c3f4cb
comparison
equal deleted inserted replaced
110563:5b5c2cab9a6a 110564:08d10ad776d8
309 off-window at the top and bottom of the row, ROWH is the height of the 309 off-window at the top and bottom of the row, ROWH is the height of the
310 display row, and VPOS is the row number (0-based) containing POS. */) 310 display row, and VPOS is the row number (0-based) containing POS. */)
311 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) 311 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
312 { 312 {
313 register struct window *w; 313 register struct window *w;
314 register int posint; 314 register EMACS_INT posint;
315 register struct buffer *buf; 315 register struct buffer *buf;
316 struct text_pos top; 316 struct text_pos top;
317 Lisp_Object in_window = Qnil; 317 Lisp_Object in_window = Qnil;
318 int rtop, rbot, rowh, vpos, fully_p = 1; 318 int rtop, rbot, rowh, vpos, fully_p = 1;
319 int x, y; 319 int x, y;
2498 function in a program gives strange scrolling, make sure the 2498 function in a program gives strange scrolling, make sure the
2499 window-start value is reasonable when this function is called. */) 2499 window-start value is reasonable when this function is called. */)
2500 (Lisp_Object window) 2500 (Lisp_Object window)
2501 { 2501 {
2502 struct window *w; 2502 struct window *w;
2503 int startpos; 2503 EMACS_INT startpos;
2504 int top, new_top; 2504 int top, new_top;
2505 2505
2506 if (NILP (window)) 2506 if (NILP (window))
2507 window = selected_window; 2507 window = selected_window;
2508 else 2508 else
3627 This is important when the buffer is in more 3627 This is important when the buffer is in more
3628 than one window. It also matters when 3628 than one window. It also matters when
3629 redisplay_window has altered point after scrolling, 3629 redisplay_window has altered point after scrolling,
3630 because it makes the change only in the window. */ 3630 because it makes the change only in the window. */
3631 { 3631 {
3632 register int new_point = marker_position (w->pointm); 3632 register EMACS_INT new_point = marker_position (w->pointm);
3633 if (new_point < BEGV) 3633 if (new_point < BEGV)
3634 SET_PT (BEGV); 3634 SET_PT (BEGV);
3635 else if (new_point > ZV) 3635 else if (new_point > ZV)
3636 SET_PT (ZV); 3636 SET_PT (ZV);
3637 else 3637 else
4846 } 4846 }
4847 4847
4848 /* Maybe modify window start instead of scrolling. */ 4848 /* Maybe modify window start instead of scrolling. */
4849 if (rbot > 0 || w->vscroll < 0) 4849 if (rbot > 0 || w->vscroll < 0)
4850 { 4850 {
4851 int spos; 4851 EMACS_INT spos;
4852 4852
4853 Fset_window_vscroll (window, make_number (0), Qt); 4853 Fset_window_vscroll (window, make_number (0), Qt);
4854 /* If there are other text lines above the current row, 4854 /* If there are other text lines above the current row,
4855 move window start to current row. Else to next row. */ 4855 move window start to current row. Else to next row. */
4856 if (rbot > 0) 4856 if (rbot > 0)
4900 /* Move iterator it from start the specified distance forward or 4900 /* Move iterator it from start the specified distance forward or
4901 backward. The result is the new window start. */ 4901 backward. The result is the new window start. */
4902 start_display (&it, w, start); 4902 start_display (&it, w, start);
4903 if (whole) 4903 if (whole)
4904 { 4904 {
4905 int start_pos = IT_CHARPOS (it); 4905 EMACS_INT start_pos = IT_CHARPOS (it);
4906 int dy = WINDOW_FRAME_LINE_HEIGHT (w); 4906 int dy = WINDOW_FRAME_LINE_HEIGHT (w);
4907 dy = max ((window_box_height (w) 4907 dy = max ((window_box_height (w)
4908 - next_screen_context_lines * dy), 4908 - next_screen_context_lines * dy),
4909 dy) * n; 4909 dy) * n;
4910 4910
4979 vscrolled = 1; 4979 vscrolled = 1;
4980 } 4980 }
4981 4981
4982 if (! vscrolled) 4982 if (! vscrolled)
4983 { 4983 {
4984 int pos = IT_CHARPOS (it); 4984 EMACS_INT pos = IT_CHARPOS (it);
4985 int bytepos; 4985 EMACS_INT bytepos;
4986 4986
4987 /* If in the middle of a multi-glyph character move forward to 4987 /* If in the middle of a multi-glyph character move forward to
4988 the next character. */ 4988 the next character. */
4989 if (in_display_vector_p (&it)) 4989 if (in_display_vector_p (&it))
4990 { 4990 {
5050 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 5050 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
5051 } 5051 }
5052 } 5052 }
5053 else if (n < 0) 5053 else if (n < 0)
5054 { 5054 {
5055 int charpos, bytepos; 5055 EMACS_INT charpos, bytepos;
5056 int partial_p; 5056 int partial_p;
5057 5057
5058 /* Save our position, for the 5058 /* Save our position, for the
5059 window_scroll_pixel_based_preserve_y case. */ 5059 window_scroll_pixel_based_preserve_y case. */
5060 charpos = IT_CHARPOS (it); 5060 charpos = IT_CHARPOS (it);
5120 5120
5121 static void 5121 static void
5122 window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) 5122 window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
5123 { 5123 {
5124 register struct window *w = XWINDOW (window); 5124 register struct window *w = XWINDOW (window);
5125 register int opoint = PT, opoint_byte = PT_BYTE; 5125 register EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
5126 register int pos, pos_byte; 5126 register EMACS_INT pos, pos_byte;
5127 register int ht = window_internal_height (w); 5127 register int ht = window_internal_height (w);
5128 register Lisp_Object tem; 5128 register Lisp_Object tem;
5129 int lose; 5129 int lose;
5130 Lisp_Object bolp; 5130 Lisp_Object bolp;
5131 int startpos; 5131 EMACS_INT startpos;
5132 Lisp_Object original_pos = Qnil; 5132 Lisp_Object original_pos = Qnil;
5133 5133
5134 /* If scrolling screen-fulls, compute the number of lines to 5134 /* If scrolling screen-fulls, compute the number of lines to
5135 scroll from the window's height. */ 5135 scroll from the window's height. */
5136 if (whole) 5136 if (whole)
5571 { 5571 {
5572 struct window *w = XWINDOW (selected_window); 5572 struct window *w = XWINDOW (selected_window);
5573 struct buffer *buf = XBUFFER (w->buffer); 5573 struct buffer *buf = XBUFFER (w->buffer);
5574 struct buffer *obuf = current_buffer; 5574 struct buffer *obuf = current_buffer;
5575 int center_p = 0; 5575 int center_p = 0;
5576 int charpos, bytepos; 5576 EMACS_INT charpos, bytepos;
5577 int iarg; 5577 int iarg;
5578 int this_scroll_margin; 5578 int this_scroll_margin;
5579 5579
5580 /* If redisplay is suppressed due to an error, try again. */ 5580 /* If redisplay is suppressed due to an error, try again. */
5581 obuf->display_error_modiff = 0; 5581 obuf->display_error_modiff = 0;
5912 register struct save_window_data *data; 5912 register struct save_window_data *data;
5913 struct Lisp_Vector *saved_windows; 5913 struct Lisp_Vector *saved_windows;
5914 Lisp_Object new_current_buffer; 5914 Lisp_Object new_current_buffer;
5915 Lisp_Object frame; 5915 Lisp_Object frame;
5916 FRAME_PTR f; 5916 FRAME_PTR f;
5917 int old_point = -1; 5917 EMACS_INT old_point = -1;
5918 5918
5919 CHECK_WINDOW_CONFIGURATION (configuration); 5919 CHECK_WINDOW_CONFIGURATION (configuration);
5920 5920
5921 data = (struct save_window_data *) XVECTOR (configuration); 5921 data = (struct save_window_data *) XVECTOR (configuration);
5922 saved_windows = XVECTOR (data->saved_windows); 5922 saved_windows = XVECTOR (data->saved_windows);