+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>
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.
stop = min (stop, GPT_BYTE);
while (1)
{
- int pos_byte_next = pos_byte;
+ EMACS_INT pos_byte_next = pos_byte;
if (pos_byte >= stop)
{
}
-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.
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);
for (; CONSP (val); val = XCDR (val))
{
Lisp_Object elt;
- int len, i;
+ EMACS_INT len, i;
elt = XCAR (val);
if (! CONSP (elt))
if (buf_used <= i)
{
unsigned char *p = BYTE_POS_ADDR (pos_byte);
- int len;
+ int len1;
if (buf_used == buf_size)
{
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;
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;
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;
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;
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;
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;
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;
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);
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);
{
/* Element (STRING . POS) means STRING was deleted. */
Lisp_Object membuf;
- int pos = XINT (cdr);
+ EMACS_INT pos = XINT (cdr);
membuf = car;
if (pos < 0)