diff options
| author | Eli Zaretskii | 2010-09-25 09:21:20 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-09-25 09:21:20 -0400 |
| commit | 2452438f0cc613f65a944d7043fa6abe32ec17a0 (patch) | |
| tree | fa732a5082977a0d909cc057c5ac630671ae247e /src | |
| parent | e70153eb2fec2f9af9089feb98739b8f9385250d (diff) | |
| download | emacs-2452438f0cc613f65a944d7043fa6abe32ec17a0.tar.gz emacs-2452438f0cc613f65a944d7043fa6abe32ec17a0.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/textprop.c | 42 | ||||
| -rw-r--r-- | src/window.c | 26 |
3 files changed, 50 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 08e0adb7999..d54e7e7218f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,19 @@ | |||
| 1 | 2010-09-25 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-09-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * window.c (Fpos_visible_in_window_p, Fdelete_other_windows) | ||
| 4 | (Fselect_window, window_scroll_pixel_based) | ||
| 5 | (window_scroll_line_based, Frecenter, Fset_window_configuration): | ||
| 6 | Use EMACS_INT for buffer positions. | ||
| 7 | |||
| 8 | * textprop.c (validate_interval_range, interval_of) | ||
| 9 | (property_change_between_p, Fadd_text_properties) | ||
| 10 | (set_text_properties_1, Fremove_text_properties) | ||
| 11 | (Fremove_list_of_text_properties, Ftext_property_any) | ||
| 12 | (Ftext_property_not_all, copy_text_properties) | ||
| 13 | (text_property_list, extend_property_ranges) | ||
| 14 | (verify_interval_modification): Use EMACS_INT for buffer | ||
| 15 | positions. | ||
| 16 | |||
| 3 | * term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT | 17 | * term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT |
| 4 | for buffer positions. | 18 | for buffer positions. |
| 5 | 19 | ||
diff --git a/src/textprop.c b/src/textprop.c index 0e398e41e4a..88e869b13e9 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -125,7 +125,7 @@ INTERVAL | |||
| 125 | validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force) | 125 | validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force) |
| 126 | { | 126 | { |
| 127 | register INTERVAL i; | 127 | register INTERVAL i; |
| 128 | int searchpos; | 128 | EMACS_INT searchpos; |
| 129 | 129 | ||
| 130 | CHECK_STRING_OR_BUFFER (object); | 130 | CHECK_STRING_OR_BUFFER (object); |
| 131 | CHECK_NUMBER_COERCE_MARKER (*begin); | 131 | CHECK_NUMBER_COERCE_MARKER (*begin); |
| @@ -161,7 +161,7 @@ validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *en | |||
| 161 | } | 161 | } |
| 162 | else | 162 | else |
| 163 | { | 163 | { |
| 164 | int len = SCHARS (object); | 164 | EMACS_INT len = SCHARS (object); |
| 165 | 165 | ||
| 166 | if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end) | 166 | if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end) |
| 167 | && XINT (*end) <= len)) | 167 | && XINT (*end) <= len)) |
| @@ -519,7 +519,7 @@ INTERVAL | |||
| 519 | interval_of (int position, Lisp_Object object) | 519 | interval_of (int position, Lisp_Object object) |
| 520 | { | 520 | { |
| 521 | register INTERVAL i; | 521 | register INTERVAL i; |
| 522 | int beg, end; | 522 | EMACS_INT beg, end; |
| 523 | 523 | ||
| 524 | if (NILP (object)) | 524 | if (NILP (object)) |
| 525 | XSETBUFFER (object, current_buffer); | 525 | XSETBUFFER (object, current_buffer); |
| @@ -984,7 +984,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 984 | /* Return 1 if there's a change in some property between BEG and END. */ | 984 | /* Return 1 if there's a change in some property between BEG and END. */ |
| 985 | 985 | ||
| 986 | int | 986 | int |
| 987 | property_change_between_p (int beg, int end) | 987 | property_change_between_p (EMACS_INT beg, EMACS_INT end) |
| 988 | { | 988 | { |
| 989 | register INTERVAL i, next; | 989 | register INTERVAL i, next; |
| 990 | Lisp_Object object, pos; | 990 | Lisp_Object object, pos; |
| @@ -1173,7 +1173,8 @@ Return t if any property value actually changed, nil otherwise. */) | |||
| 1173 | (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) | 1173 | (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) |
| 1174 | { | 1174 | { |
| 1175 | register INTERVAL i, unchanged; | 1175 | register INTERVAL i, unchanged; |
| 1176 | register int s, len, modified = 0; | 1176 | register EMACS_INT s, len; |
| 1177 | register int modified = 0; | ||
| 1177 | struct gcpro gcpro1; | 1178 | struct gcpro gcpro1; |
| 1178 | 1179 | ||
| 1179 | properties = validate_plist (properties); | 1180 | properties = validate_plist (properties); |
| @@ -1202,7 +1203,7 @@ Return t if any property value actually changed, nil otherwise. */) | |||
| 1202 | skip it. */ | 1203 | skip it. */ |
| 1203 | if (interval_has_all_properties (properties, i)) | 1204 | if (interval_has_all_properties (properties, i)) |
| 1204 | { | 1205 | { |
| 1205 | int got = (LENGTH (i) - (s - i->position)); | 1206 | EMACS_INT got = (LENGTH (i) - (s - i->position)); |
| 1206 | if (got >= len) | 1207 | if (got >= len) |
| 1207 | RETURN_UNGCPRO (Qnil); | 1208 | RETURN_UNGCPRO (Qnil); |
| 1208 | len -= got; | 1209 | len -= got; |
| @@ -1377,7 +1378,7 @@ void | |||
| 1377 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) | 1378 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) |
| 1378 | { | 1379 | { |
| 1379 | register INTERVAL prev_changed = NULL_INTERVAL; | 1380 | register INTERVAL prev_changed = NULL_INTERVAL; |
| 1380 | register int s, len; | 1381 | register EMACS_INT s, len; |
| 1381 | INTERVAL unchanged; | 1382 | INTERVAL unchanged; |
| 1382 | 1383 | ||
| 1383 | s = XINT (start); | 1384 | s = XINT (start); |
| @@ -1466,7 +1467,8 @@ Use `set-text-properties' if you want to remove all text properties. */) | |||
| 1466 | (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) | 1467 | (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) |
| 1467 | { | 1468 | { |
| 1468 | register INTERVAL i, unchanged; | 1469 | register INTERVAL i, unchanged; |
| 1469 | register int s, len, modified = 0; | 1470 | register EMACS_INT s, len; |
| 1471 | register int modified = 0; | ||
| 1470 | 1472 | ||
| 1471 | if (NILP (object)) | 1473 | if (NILP (object)) |
| 1472 | XSETBUFFER (object, current_buffer); | 1474 | XSETBUFFER (object, current_buffer); |
| @@ -1484,7 +1486,7 @@ Use `set-text-properties' if you want to remove all text properties. */) | |||
| 1484 | it covers the entire region. */ | 1486 | it covers the entire region. */ |
| 1485 | if (! interval_has_some_properties (properties, i)) | 1487 | if (! interval_has_some_properties (properties, i)) |
| 1486 | { | 1488 | { |
| 1487 | int got = (LENGTH (i) - (s - i->position)); | 1489 | EMACS_INT got = (LENGTH (i) - (s - i->position)); |
| 1488 | if (got >= len) | 1490 | if (got >= len) |
| 1489 | return Qnil; | 1491 | return Qnil; |
| 1490 | len -= got; | 1492 | len -= got; |
| @@ -1551,7 +1553,8 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1551 | (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object) | 1553 | (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object) |
| 1552 | { | 1554 | { |
| 1553 | register INTERVAL i, unchanged; | 1555 | register INTERVAL i, unchanged; |
| 1554 | register int s, len, modified = 0; | 1556 | register EMACS_INT s, len; |
| 1557 | register int modified = 0; | ||
| 1555 | Lisp_Object properties; | 1558 | Lisp_Object properties; |
| 1556 | properties = list_of_properties; | 1559 | properties = list_of_properties; |
| 1557 | 1560 | ||
| @@ -1571,7 +1574,7 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1571 | it covers the entire region. */ | 1574 | it covers the entire region. */ |
| 1572 | if (! interval_has_some_properties_list (properties, i)) | 1575 | if (! interval_has_some_properties_list (properties, i)) |
| 1573 | { | 1576 | { |
| 1574 | int got = (LENGTH (i) - (s - i->position)); | 1577 | EMACS_INT got = (LENGTH (i) - (s - i->position)); |
| 1575 | if (got >= len) | 1578 | if (got >= len) |
| 1576 | return Qnil; | 1579 | return Qnil; |
| 1577 | len -= got; | 1580 | len -= got; |
| @@ -1658,7 +1661,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */ | |||
| 1658 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) | 1661 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) |
| 1659 | { | 1662 | { |
| 1660 | register INTERVAL i; | 1663 | register INTERVAL i; |
| 1661 | register int e, pos; | 1664 | register EMACS_INT e, pos; |
| 1662 | 1665 | ||
| 1663 | if (NILP (object)) | 1666 | if (NILP (object)) |
| 1664 | XSETBUFFER (object, current_buffer); | 1667 | XSETBUFFER (object, current_buffer); |
| @@ -1694,7 +1697,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */ | |||
| 1694 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) | 1697 | (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) |
| 1695 | { | 1698 | { |
| 1696 | register INTERVAL i; | 1699 | register INTERVAL i; |
| 1697 | register int s, e; | 1700 | register EMACS_INT s, e; |
| 1698 | 1701 | ||
| 1699 | if (NILP (object)) | 1702 | if (NILP (object)) |
| 1700 | XSETBUFFER (object, current_buffer); | 1703 | XSETBUFFER (object, current_buffer); |
| @@ -1806,7 +1809,8 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_ | |||
| 1806 | Lisp_Object res; | 1809 | Lisp_Object res; |
| 1807 | Lisp_Object stuff; | 1810 | Lisp_Object stuff; |
| 1808 | Lisp_Object plist; | 1811 | Lisp_Object plist; |
| 1809 | int s, e, e2, p, len, modified = 0; | 1812 | EMACS_INT s, e, e2, p, len; |
| 1813 | int modified = 0; | ||
| 1810 | struct gcpro gcpro1, gcpro2; | 1814 | struct gcpro gcpro1, gcpro2; |
| 1811 | 1815 | ||
| 1812 | i = validate_interval_range (src, &start, &end, soft); | 1816 | i = validate_interval_range (src, &start, &end, soft); |
| @@ -1902,12 +1906,12 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp | |||
| 1902 | i = validate_interval_range (object, &start, &end, soft); | 1906 | i = validate_interval_range (object, &start, &end, soft); |
| 1903 | if (!NULL_INTERVAL_P (i)) | 1907 | if (!NULL_INTERVAL_P (i)) |
| 1904 | { | 1908 | { |
| 1905 | int s = XINT (start); | 1909 | EMACS_INT s = XINT (start); |
| 1906 | int e = XINT (end); | 1910 | EMACS_INT e = XINT (end); |
| 1907 | 1911 | ||
| 1908 | while (s < e) | 1912 | while (s < e) |
| 1909 | { | 1913 | { |
| 1910 | int interval_end, len; | 1914 | EMACS_INT interval_end, len; |
| 1911 | Lisp_Object plist; | 1915 | Lisp_Object plist; |
| 1912 | 1916 | ||
| 1913 | interval_end = i->position + LENGTH (i); | 1917 | interval_end = i->position + LENGTH (i); |
| @@ -1985,7 +1989,7 @@ Lisp_Object | |||
| 1985 | extend_property_ranges (Lisp_Object list, Lisp_Object new_end) | 1989 | extend_property_ranges (Lisp_Object list, Lisp_Object new_end) |
| 1986 | { | 1990 | { |
| 1987 | Lisp_Object prev = Qnil, head = list; | 1991 | Lisp_Object prev = Qnil, head = list; |
| 1988 | int max = XINT (new_end); | 1992 | EMACS_INT max = XINT (new_end); |
| 1989 | 1993 | ||
| 1990 | for (; CONSP (list); prev = list, list = XCDR (list)) | 1994 | for (; CONSP (list); prev = list, list = XCDR (list)) |
| 1991 | { | 1995 | { |
| @@ -2059,7 +2063,7 @@ verify_interval_modification (struct buffer *buf, int start, int end) | |||
| 2059 | 2063 | ||
| 2060 | if (start > end) | 2064 | if (start > end) |
| 2061 | { | 2065 | { |
| 2062 | int temp = start; | 2066 | EMACS_INT temp = start; |
| 2063 | start = end; | 2067 | start = end; |
| 2064 | end = temp; | 2068 | end = temp; |
| 2065 | } | 2069 | } |
diff --git a/src/window.c b/src/window.c index 1fabe72d72d..7591401ee42 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -311,7 +311,7 @@ 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; |
| @@ -2500,7 +2500,7 @@ 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)) |
| @@ -3629,7 +3629,7 @@ selected window before each command. */) | |||
| 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) |
| @@ -4848,7 +4848,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 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, |
| @@ -4902,7 +4902,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 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), |
| @@ -4981,8 +4981,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 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. */ |
| @@ -5052,7 +5052,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 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 |
| @@ -5122,13 +5122,13 @@ 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 |
| @@ -5573,7 +5573,7 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 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 | ||
| @@ -5914,7 +5914,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 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 | ||