Commit c8a66ab8 authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent fc33e153
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>
......
......@@ -2705,7 +2705,7 @@ and don't mark the buffer as really changed.
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 @@ Both characters must have the same length of multi-byte form. */)
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 @@ Both characters must have the same length of multi-byte form. */)
}
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 @@ static Lisp_Object check_translation (int, int, int, Lisp_Object);
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 @@ check_translation (int pos, int pos_byte, int end, Lisp_Object val)
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 @@ check_translation (int pos, int pos_byte, int end, Lisp_Object val)
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 @@ check_translation (int pos, int pos_byte, int end, Lisp_Object val)
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 @@ It returns the number of characters changed. */)
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;
......
......@@ -3393,12 +3393,13 @@ extern Lisp_Object Qapply;
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;
......
......@@ -67,7 +67,7 @@ int undo_inhibit_record_point;
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 @@ record_point (int pt)
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 @@ record_insert (int beg, int length)
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 @@ record_delete (int beg, Lisp_Object string)
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 @@ record_marker_adjustment (Lisp_Object marker, int adjustment)
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 @@ record_first_change (void)
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 @@ Return what remains of the list. */)
{
/* Element (STRING . POS) means STRING was deleted. */
Lisp_Object membuf;
int pos = XINT (cdr);
EMACS_INT pos = XINT (cdr);
membuf = car;
if (pos < 0)
......
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