Mercurial > emacs
changeset 110484:7ca55779eeef
Fix some more uses of int instead of EMACS_INT.
editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
(check_translation): Use EMACS_INT for buffer positions and
length.
undo.c (record_marker_adjustment, record_delete)
(record_change, record_point, record_insert)
(record_property_change, Fprimitive_undo): Use EMACS_INT for
buffer positions.
lisp.h (record_marker_adjustment, record_delete)
(record_change, record_point, record_insert)
(record_property_change, Fprimitive_undo): Adjust prototypes.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Wed, 22 Sep 2010 15:22:06 -0400 |
parents | 2892adf3a65b |
children | 14057cf8379c |
files | src/ChangeLog src/editfns.c src/lisp.h src/undo.c |
diffstat | 4 files changed, 41 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Wed Sep 22 20:39:51 2010 +0200 +++ b/src/ChangeLog Wed Sep 22 15:22:06 2010 -0400 @@ -1,3 +1,18 @@ +2010-09-22 Eli Zaretskii <eliz@gnu.org> + + * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal) + (check_translation): Use EMACS_INT for buffer positions and + length. + + * undo.c (record_marker_adjustment, record_delete) + (record_change, record_point, record_insert) + (record_property_change, Fprimitive_undo): Use EMACS_INT for + buffer positions. + + * lisp.h (record_marker_adjustment, record_delete) + (record_change, record_point, record_insert) + (record_property_change, Fprimitive_undo): Adjust prototypes. + 2010-09-22 Juanma Barranquero <lekktu@gmail.com> Eli Zaretskii <eliz@gnu.org>
--- a/src/editfns.c Wed Sep 22 20:39:51 2010 +0200 +++ b/src/editfns.c Wed Sep 22 15:22:06 2010 -0400 @@ -2705,7 +2705,7 @@ Both characters must have the same length of multi-byte form. */) (Lisp_Object start, Lisp_Object end, Lisp_Object fromchar, Lisp_Object tochar, Lisp_Object noundo) { - register int pos, pos_byte, stop, i, len, end_byte; + register EMACS_INT pos, pos_byte, stop, i, len, end_byte; /* Keep track of the first change in the buffer: if 0 we haven't found it yet. if < 0 we've found it and we've run the before-change-function. @@ -2776,7 +2776,7 @@ stop = min (stop, GPT_BYTE); while (1) { - int pos_byte_next = pos_byte; + EMACS_INT pos_byte_next = pos_byte; if (pos_byte >= stop) { @@ -2879,7 +2879,8 @@ } -static Lisp_Object check_translation (int, int, int, Lisp_Object); +static Lisp_Object check_translation (EMACS_INT, EMACS_INT, EMACS_INT, + Lisp_Object); /* Helper function for Ftranslate_region_internal. @@ -2888,7 +2889,8 @@ element is found, return it. Otherwise return Qnil. */ static Lisp_Object -check_translation (int pos, int pos_byte, int end, Lisp_Object val) +check_translation (EMACS_INT pos, EMACS_INT pos_byte, EMACS_INT end, + Lisp_Object val) { int buf_size = 16, buf_used = 0; int *buf = alloca (sizeof (int) * buf_size); @@ -2896,7 +2898,7 @@ for (; CONSP (val); val = XCDR (val)) { Lisp_Object elt; - int len, i; + EMACS_INT len, i; elt = XCAR (val); if (! CONSP (elt)) @@ -2912,7 +2914,7 @@ if (buf_used <= i) { unsigned char *p = BYTE_POS_ADDR (pos_byte); - int len; + int len1; if (buf_used == buf_size) { @@ -2923,8 +2925,8 @@ memcpy (newbuf, buf, sizeof (int) * buf_used); buf = newbuf; } - buf[buf_used++] = STRING_CHAR_AND_LENGTH (p, len); - pos_byte += len; + buf[buf_used++] = STRING_CHAR_AND_LENGTH (p, len1); + pos_byte += len1; } if (XINT (AREF (elt, i)) != buf[i]) break; @@ -2950,7 +2952,7 @@ register int nc; /* New character. */ int cnt; /* Number of changes made. */ int size; /* Size of translate table. */ - int pos, pos_byte, end_pos; + EMACS_INT pos, pos_byte, end_pos; int multibyte = !NILP (current_buffer->enable_multibyte_characters); int string_multibyte; Lisp_Object val;
--- a/src/lisp.h Wed Sep 22 20:39:51 2010 +0200 +++ b/src/lisp.h Wed Sep 22 15:22:06 2010 -0400 @@ -3393,12 +3393,13 @@ extern Lisp_Object Qinhibit_read_only; EXFUN (Fundo_boundary, 0); extern void truncate_undo_list (struct buffer *); -extern void record_marker_adjustment (Lisp_Object, int); -extern void record_insert (int, int); -extern void record_delete (int, Lisp_Object); +extern void record_marker_adjustment (Lisp_Object, EMACS_INT); +extern void record_insert (EMACS_INT, EMACS_INT); +extern void record_delete (EMACS_INT, Lisp_Object); extern void record_first_change (void); -extern void record_change (int, int); -extern void record_property_change (int, int, Lisp_Object, Lisp_Object, +extern void record_change (EMACS_INT, EMACS_INT); +extern void record_property_change (EMACS_INT, EMACS_INT, + Lisp_Object, Lisp_Object, Lisp_Object); extern void syms_of_undo (void); extern Lisp_Object Vundo_outer_limit;
--- a/src/undo.c Wed Sep 22 20:39:51 2010 +0200 +++ b/src/undo.c Wed Sep 22 15:22:06 2010 -0400 @@ -67,7 +67,7 @@ undo record that will be added just after this command terminates. */ static void -record_point (int pt) +record_point (EMACS_INT pt) { int at_boundary; @@ -129,7 +129,7 @@ because we don't need to record the contents.) */ void -record_insert (int beg, int length) +record_insert (EMACS_INT beg, EMACS_INT length) { Lisp_Object lbeg, lend; @@ -164,7 +164,7 @@ of the characters in STRING, at location BEG. */ void -record_delete (int beg, Lisp_Object string) +record_delete (EMACS_INT beg, Lisp_Object string) { Lisp_Object sbeg; @@ -192,7 +192,7 @@ won't be inverted automatically by undoing the buffer modification. */ void -record_marker_adjustment (Lisp_Object marker, int adjustment) +record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) { if (EQ (current_buffer->undo_list, Qt)) return; @@ -215,7 +215,7 @@ The replacement must not change the number of characters. */ void -record_change (int beg, int length) +record_change (EMACS_INT beg, EMACS_INT length) { record_delete (beg, make_buffer_string (beg, beg + length, 1)); record_insert (beg, length); @@ -250,7 +250,9 @@ for LENGTH characters starting at position BEG in BUFFER. */ void -record_property_change (int beg, int length, Lisp_Object prop, Lisp_Object value, Lisp_Object buffer) +record_property_change (EMACS_INT beg, EMACS_INT length, + Lisp_Object prop, Lisp_Object value, + Lisp_Object buffer) { Lisp_Object lbeg, lend, entry; struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer); @@ -601,7 +603,7 @@ { /* Element (STRING . POS) means STRING was deleted. */ Lisp_Object membuf; - int pos = XINT (cdr); + EMACS_INT pos = XINT (cdr); membuf = car; if (pos < 0)