This macro is used in current_column_1, Fmove_to_column, and
compute_motion. */
-#define MULTIBYTE_BYTES_WIDTH(p, dp) \
+#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
do { \
- int c; \
+ int ch; \
\
wide_column = 0; \
- c = STRING_CHAR_AND_LENGTH (p, bytes); \
+ ch = STRING_CHAR_AND_LENGTH (p, bytes); \
if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
width = bytes * 4; \
else \
{ \
- if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \
- width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \
+ if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
+ width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
else \
- width = CHAR_WIDTH (c); \
+ width = CHAR_WIDTH (ch); \
if (width > 1) \
wide_column = width; \
} \
prev_col = col;
{ /* Check display property. */
- EMACS_INT end;
- int width = check_display_width (scan, col, &end);
+ EMACS_INT endp;
+ int width = check_display_width (scan, col, &endp);
if (width >= 0)
{
col += width;
- if (end > scan) /* Avoid infinite loops with 0-width overlays. */
+ if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
{
- scan = end; scan_byte = charpos_to_bytepos (scan);
+ scan = endp; scan_byte = charpos_to_bytepos (scan);
continue;
}
}
int bytes, width, wide_column;
ptr = BYTE_POS_ADDR (scan_byte);
- MULTIBYTE_BYTES_WIDTH (ptr, dp);
+ MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
/* Subtract one to compensate for the increment
that is going to happen below. */
scan_byte += bytes - 1;
{
/* Start of multi-byte form. */
unsigned char *ptr;
- int bytes, width, wide_column;
+ int mb_bytes, mb_width, wide_column;
pos_byte--; /* rewind POS_BYTE */
ptr = BYTE_POS_ADDR (pos_byte);
- MULTIBYTE_BYTES_WIDTH (ptr, dp);
- pos_byte += bytes;
+ MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
+ pos_byte += mb_bytes;
if (wide_column)
wide_column_end_hpos = hpos + wide_column;
- hpos += width;
+ hpos += mb_width;
}
else if (VECTORP (charvec))
++hpos;