Mercurial > emacs
diff src/textprop.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 | 8cfee7d2955f |
| children | a5a188ddc758 |
line wrap: on
line diff
--- a/src/textprop.c Sat Sep 25 12:49:02 2010 +0000 +++ b/src/textprop.c Sat Sep 25 09:21:20 2010 -0400 @@ -125,7 +125,7 @@ validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force) { register INTERVAL i; - int searchpos; + EMACS_INT searchpos; CHECK_STRING_OR_BUFFER (object); CHECK_NUMBER_COERCE_MARKER (*begin); @@ -161,7 +161,7 @@ } else { - int len = SCHARS (object); + EMACS_INT len = SCHARS (object); if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end) && XINT (*end) <= len)) @@ -519,7 +519,7 @@ interval_of (int position, Lisp_Object object) { register INTERVAL i; - int beg, end; + EMACS_INT beg, end; if (NILP (object)) XSETBUFFER (object, current_buffer); @@ -984,7 +984,7 @@ /* Return 1 if there's a change in some property between BEG and END. */ int -property_change_between_p (int beg, int end) +property_change_between_p (EMACS_INT beg, EMACS_INT end) { register INTERVAL i, next; Lisp_Object object, pos; @@ -1173,7 +1173,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) { register INTERVAL i, unchanged; - register int s, len, modified = 0; + register EMACS_INT s, len; + register int modified = 0; struct gcpro gcpro1; properties = validate_plist (properties); @@ -1202,7 +1203,7 @@ skip it. */ if (interval_has_all_properties (properties, i)) { - int got = (LENGTH (i) - (s - i->position)); + EMACS_INT got = (LENGTH (i) - (s - i->position)); if (got >= len) RETURN_UNGCPRO (Qnil); len -= got; @@ -1377,7 +1378,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) { register INTERVAL prev_changed = NULL_INTERVAL; - register int s, len; + register EMACS_INT s, len; INTERVAL unchanged; s = XINT (start); @@ -1466,7 +1467,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) { register INTERVAL i, unchanged; - register int s, len, modified = 0; + register EMACS_INT s, len; + register int modified = 0; if (NILP (object)) XSETBUFFER (object, current_buffer); @@ -1484,7 +1486,7 @@ it covers the entire region. */ if (! interval_has_some_properties (properties, i)) { - int got = (LENGTH (i) - (s - i->position)); + EMACS_INT got = (LENGTH (i) - (s - i->position)); if (got >= len) return Qnil; len -= got; @@ -1551,7 +1553,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object) { register INTERVAL i, unchanged; - register int s, len, modified = 0; + register EMACS_INT s, len; + register int modified = 0; Lisp_Object properties; properties = list_of_properties; @@ -1571,7 +1574,7 @@ it covers the entire region. */ if (! interval_has_some_properties_list (properties, i)) { - int got = (LENGTH (i) - (s - i->position)); + EMACS_INT got = (LENGTH (i) - (s - i->position)); if (got >= len) return Qnil; len -= got; @@ -1658,7 +1661,7 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { register INTERVAL i; - register int e, pos; + register EMACS_INT e, pos; if (NILP (object)) XSETBUFFER (object, current_buffer); @@ -1694,7 +1697,7 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { register INTERVAL i; - register int s, e; + register EMACS_INT s, e; if (NILP (object)) XSETBUFFER (object, current_buffer); @@ -1806,7 +1809,8 @@ Lisp_Object res; Lisp_Object stuff; Lisp_Object plist; - int s, e, e2, p, len, modified = 0; + EMACS_INT s, e, e2, p, len; + int modified = 0; struct gcpro gcpro1, gcpro2; i = validate_interval_range (src, &start, &end, soft); @@ -1902,12 +1906,12 @@ i = validate_interval_range (object, &start, &end, soft); if (!NULL_INTERVAL_P (i)) { - int s = XINT (start); - int e = XINT (end); + EMACS_INT s = XINT (start); + EMACS_INT e = XINT (end); while (s < e) { - int interval_end, len; + EMACS_INT interval_end, len; Lisp_Object plist; interval_end = i->position + LENGTH (i); @@ -1985,7 +1989,7 @@ extend_property_ranges (Lisp_Object list, Lisp_Object new_end) { Lisp_Object prev = Qnil, head = list; - int max = XINT (new_end); + EMACS_INT max = XINT (new_end); for (; CONSP (list); prev = list, list = XCDR (list)) { @@ -2059,7 +2063,7 @@ if (start > end) { - int temp = start; + EMACS_INT temp = start; start = end; end = temp; }
