aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-15 10:57:31 -0700
committerPaul Eggert2011-03-15 10:57:31 -0700
commit85f24f61597cf8f38d5913e66a87c883f6a7690d (patch)
treef177b1e1c09639ef1669cde4738f0bbdbc5ad5ae /src
parente45a141a5bab1fa5bc4c093eb2207d5d5c81e0f9 (diff)
downloademacs-85f24f61597cf8f38d5913e66a87c883f6a7690d.tar.gz
emacs-85f24f61597cf8f38d5913e66a87c883f6a7690d.zip
* indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
All uses changed. (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion): Rename locals to avoid shadowing.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/indent.c30
2 files changed, 20 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1b44f7585d6..21a588a87da 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12011-03-15 Paul Eggert <eggert@cs.ucla.edu> 12011-03-15 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
4 All uses changed.
5 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
6 Rename locals to avoid shadowing.
7
3 * casefiddle.c (casify_object, casify_region): Now static. 8 * casefiddle.c (casify_object, casify_region): Now static.
4 (casify_region): Mark local as initialized. 9 (casify_region): Mark local as initialized.
5 10
diff --git a/src/indent.c b/src/indent.c
index 37ce647556d..d5e7671fa8c 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
274 This macro is used in current_column_1, Fmove_to_column, and 274 This macro is used in current_column_1, Fmove_to_column, and
275 compute_motion. */ 275 compute_motion. */
276 276
277#define MULTIBYTE_BYTES_WIDTH(p, dp) \ 277#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
278 do { \ 278 do { \
279 int c; \ 279 int ch; \
280 \ 280 \
281 wide_column = 0; \ 281 wide_column = 0; \
282 c = STRING_CHAR_AND_LENGTH (p, bytes); \ 282 ch = STRING_CHAR_AND_LENGTH (p, bytes); \
283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \ 283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
284 width = bytes * 4; \ 284 width = bytes * 4; \
285 else \ 285 else \
286 { \ 286 { \
287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \ 287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
288 width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \ 288 width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
289 else \ 289 else \
290 width = CHAR_WIDTH (c); \ 290 width = CHAR_WIDTH (ch); \
291 if (width > 1) \ 291 if (width > 1) \
292 wide_column = width; \ 292 wide_column = width; \
293 } \ 293 } \
@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
569 prev_col = col; 569 prev_col = col;
570 570
571 { /* Check display property. */ 571 { /* Check display property. */
572 EMACS_INT end; 572 EMACS_INT endp;
573 int width = check_display_width (scan, col, &end); 573 int width = check_display_width (scan, col, &endp);
574 if (width >= 0) 574 if (width >= 0)
575 { 575 {
576 col += width; 576 col += width;
577 if (end > scan) /* Avoid infinite loops with 0-width overlays. */ 577 if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
578 { 578 {
579 scan = end; scan_byte = charpos_to_bytepos (scan); 579 scan = endp; scan_byte = charpos_to_bytepos (scan);
580 continue; 580 continue;
581 } 581 }
582 } 582 }
@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
669 int bytes, width, wide_column; 669 int bytes, width, wide_column;
670 670
671 ptr = BYTE_POS_ADDR (scan_byte); 671 ptr = BYTE_POS_ADDR (scan_byte);
672 MULTIBYTE_BYTES_WIDTH (ptr, dp); 672 MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
673 /* Subtract one to compensate for the increment 673 /* Subtract one to compensate for the increment
674 that is going to happen below. */ 674 that is going to happen below. */
675 scan_byte += bytes - 1; 675 scan_byte += bytes - 1;
@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1657 { 1657 {
1658 /* Start of multi-byte form. */ 1658 /* Start of multi-byte form. */
1659 unsigned char *ptr; 1659 unsigned char *ptr;
1660 int bytes, width, wide_column; 1660 int mb_bytes, mb_width, wide_column;
1661 1661
1662 pos_byte--; /* rewind POS_BYTE */ 1662 pos_byte--; /* rewind POS_BYTE */
1663 ptr = BYTE_POS_ADDR (pos_byte); 1663 ptr = BYTE_POS_ADDR (pos_byte);
1664 MULTIBYTE_BYTES_WIDTH (ptr, dp); 1664 MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
1665 pos_byte += bytes; 1665 pos_byte += mb_bytes;
1666 if (wide_column) 1666 if (wide_column)
1667 wide_column_end_hpos = hpos + wide_column; 1667 wide_column_end_hpos = hpos + wide_column;
1668 hpos += width; 1668 hpos += mb_width;
1669 } 1669 }
1670 else if (VECTORP (charvec)) 1670 else if (VECTORP (charvec))
1671 ++hpos; 1671 ++hpos;