* indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 17:57:31 +0000 (10:57 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 17:57:31 +0000 (10:57 -0700)
All uses changed.
(MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
Rename locals to avoid shadowing.

src/ChangeLog
src/indent.c

index 1b44f75..21a588a 100644 (file)
@@ -1,5 +1,10 @@
 2011-03-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * 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.
+
        * casefiddle.c (casify_object, casify_region): Now static.
        (casify_region): Mark local as initialized.
 
index 37ce647..d5e7671 100644 (file)
@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
    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;                                          \
       }                                                                        \
@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
       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;
              }
          }
@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
              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;
@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
                {
                  /* 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;