Commit 2452438f authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent e70153eb
2010-09-25 Eli Zaretskii <eliz@gnu.org>
* 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.
* term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT
for buffer positions.
......
......@@ -125,7 +125,7 @@ INTERVAL
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 @@ validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *en
}
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
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 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
/* 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 @@ Return t if any property value actually changed, nil otherwise. */)
(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 @@ Return t if any property value actually changed, nil otherwise. */)
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 @@ void
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 @@ Use `set-text-properties' if you want to remove all text properties. */)
(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 @@ Use `set-text-properties' if you want to remove all text properties. */)
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 @@ Return t if any property was actually removed, nil otherwise. */)
(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 @@ Return t if any property was actually removed, nil otherwise. */)
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 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
(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 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
(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 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
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 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
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 @@ Lisp_Object
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 @@ verify_interval_modification (struct buffer *buf, int start, int end)
if (start > end)
{
int temp = start;
EMACS_INT temp = start;
start = end;
end = temp;
}
......
......@@ -311,7 +311,7 @@ display row, and VPOS is the row number (0-based) containing POS. */)
(Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
{
register struct window *w;
register int posint;
register EMACS_INT posint;
register struct buffer *buf;
struct text_pos top;
Lisp_Object in_window = Qnil;
......@@ -2500,7 +2500,7 @@ window-start value is reasonable when this function is called. */)
(Lisp_Object window)
{
struct window *w;
int startpos;
EMACS_INT startpos;
int top, new_top;
if (NILP (window))
......@@ -3629,7 +3629,7 @@ selected window before each command. */)
redisplay_window has altered point after scrolling,
because it makes the change only in the window. */
{
register int new_point = marker_position (w->pointm);
register EMACS_INT new_point = marker_position (w->pointm);
if (new_point < BEGV)
SET_PT (BEGV);
else if (new_point > ZV)
......@@ -4848,7 +4848,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
/* Maybe modify window start instead of scrolling. */
if (rbot > 0 || w->vscroll < 0)
{
int spos;
EMACS_INT spos;
Fset_window_vscroll (window, make_number (0), Qt);
/* 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)
start_display (&it, w, start);
if (whole)
{
int start_pos = IT_CHARPOS (it);
EMACS_INT start_pos = IT_CHARPOS (it);
int dy = WINDOW_FRAME_LINE_HEIGHT (w);
dy = max ((window_box_height (w)
- next_screen_context_lines * dy),
......@@ -4981,8 +4981,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
if (! vscrolled)
{
int pos = IT_CHARPOS (it);
int bytepos;
EMACS_INT pos = IT_CHARPOS (it);
EMACS_INT bytepos;
/* If in the middle of a multi-glyph character move forward to
the next character. */
......@@ -5052,7 +5052,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
}
else if (n < 0)
{
int charpos, bytepos;
EMACS_INT charpos, bytepos;
int partial_p;
/* Save our position, for the
......@@ -5122,13 +5122,13 @@ static void
window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
{
register struct window *w = XWINDOW (window);
register int opoint = PT, opoint_byte = PT_BYTE;
register int pos, pos_byte;
register EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
register EMACS_INT pos, pos_byte;
register int ht = window_internal_height (w);
register Lisp_Object tem;
int lose;
Lisp_Object bolp;
int startpos;
EMACS_INT startpos;
Lisp_Object original_pos = Qnil;
/* If scrolling screen-fulls, compute the number of lines to
......@@ -5573,7 +5573,7 @@ and redisplay normally--don't erase and redraw the frame. */)
struct buffer *buf = XBUFFER (w->buffer);
struct buffer *obuf = current_buffer;
int center_p = 0;
int charpos, bytepos;
EMACS_INT charpos, bytepos;
int iarg;
int this_scroll_margin;
......@@ -5914,7 +5914,7 @@ the return value is nil. Otherwise the value is t. */)
Lisp_Object new_current_buffer;
Lisp_Object frame;
FRAME_PTR f;
int old_point = -1;
EMACS_INT old_point = -1;
CHECK_WINDOW_CONFIGURATION (configuration);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment