aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-07 23:48:20 -0800
committerPaul Eggert2011-03-07 23:48:20 -0800
commitfb90da1b9b967f4dba5360615acab0e1cac37796 (patch)
tree8af64535223bacaea54008e6c42de8731d68767d /src
parent9f3b5e6926e3a127df87e7829e30d4cd59fecbcf (diff)
downloademacs-fb90da1b9b967f4dba5360615acab0e1cac37796.tar.gz
emacs-fb90da1b9b967f4dba5360615acab0e1cac37796.zip
* ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
(Fregister_code_conversion_map): Rename locals to avoid shadowing.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/ccl.c57
2 files changed, 31 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f0a12a7c5d1..2b894e9a511 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -68,6 +68,9 @@
68 * category.c (hash_get_category_set): Remove unused local var. 68 * category.c (hash_get_category_set): Remove unused local var.
69 (copy_category_table): Now static, since it's not used elsewhere. 69 (copy_category_table): Now static, since it's not used elsewhere.
70 70
71 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
72 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
73
712011-03-06 Chong Yidong <cyd@stupidchicken.com> 742011-03-06 Chong Yidong <cyd@stupidchicken.com>
72 75
73 * xdisp.c (redisplay_window): Revert incorrect logic in 2011-03-06 76 * xdisp.c (redisplay_window): Revert incorrect logic in 2011-03-06
diff --git a/src/ccl.c b/src/ccl.c
index 411c041b22a..5428e94c69a 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -758,18 +758,18 @@ while(0)
758 buffer. */ 758 buffer. */
759#define CCL_WRITE_STRING(len) \ 759#define CCL_WRITE_STRING(len) \
760 do { \ 760 do { \
761 int i; \ 761 int ccli; \
762 if (!dst) \ 762 if (!dst) \
763 CCL_INVALID_CMD; \ 763 CCL_INVALID_CMD; \
764 else if (dst + len <= dst_end) \ 764 else if (dst + len <= dst_end) \
765 { \ 765 { \
766 if (XFASTINT (ccl_prog[ic]) & 0x1000000) \ 766 if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
767 for (i = 0; i < len; i++) \ 767 for (ccli = 0; ccli < len; ccli++) \
768 *dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \ 768 *dst++ = XFASTINT (ccl_prog[ic + ccli]) & 0xFFFFFF; \
769 else \ 769 else \
770 for (i = 0; i < len; i++) \ 770 for (ccli = 0; ccli < len; ccli++) \
771 *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \ 771 *dst++ = ((XFASTINT (ccl_prog[ic + (ccli / 3)])) \
772 >> ((2 - (i % 3)) * 8)) & 0xFF; \ 772 >> ((2 - (ccli % 3)) * 8)) & 0xFF; \
773 } \ 773 } \
774 else \ 774 else \
775 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ 775 CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
@@ -806,15 +806,15 @@ while(0)
806 806
807#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \ 807#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \
808 do { \ 808 do { \
809 unsigned code; \ 809 unsigned ncode; \
810 \ 810 \
811 charset = char_charset ((c), (charset_list), &code); \ 811 charset = char_charset ((c), (charset_list), &ncode); \
812 if (! charset && ! NILP (charset_list)) \ 812 if (! charset && ! NILP (charset_list)) \
813 charset = char_charset ((c), Qnil, &code); \ 813 charset = char_charset ((c), Qnil, &ncode); \
814 if (charset) \ 814 if (charset) \
815 { \ 815 { \
816 (id) = CHARSET_ID (charset); \ 816 (id) = CHARSET_ID (charset); \
817 (encoded) = code; \ 817 (encoded) = ncode; \
818 } \ 818 } \
819 } while (0) 819 } while (0)
820 820
@@ -2092,22 +2092,22 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2092 { 2092 {
2093 const unsigned char *p = SDATA (str) + consumed_bytes; 2093 const unsigned char *p = SDATA (str) + consumed_bytes;
2094 const unsigned char *endp = SDATA (str) + str_bytes; 2094 const unsigned char *endp = SDATA (str) + str_bytes;
2095 int i = 0; 2095 int j = 0;
2096 int *src, src_size; 2096 int *src, src_size;
2097 2097
2098 if (endp - p == str_chars - consumed_chars) 2098 if (endp - p == str_chars - consumed_chars)
2099 while (i < CCL_EXECUTE_BUF_SIZE && p < endp) 2099 while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
2100 source[i++] = *p++; 2100 source[j++] = *p++;
2101 else 2101 else
2102 while (i < CCL_EXECUTE_BUF_SIZE && p < endp) 2102 while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
2103 source[i++] = STRING_CHAR_ADVANCE (p); 2103 source[j++] = STRING_CHAR_ADVANCE (p);
2104 consumed_chars += i; 2104 consumed_chars += j;
2105 consumed_bytes = p - SDATA (str); 2105 consumed_bytes = p - SDATA (str);
2106 2106
2107 if (consumed_bytes == str_bytes) 2107 if (consumed_bytes == str_bytes)
2108 ccl.last_block = NILP (contin); 2108 ccl.last_block = NILP (contin);
2109 src = source; 2109 src = source;
2110 src_size = i; 2110 src_size = j;
2111 while (1) 2111 while (1)
2112 { 2112 {
2113 ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE, 2113 ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
@@ -2123,8 +2123,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2123 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); 2123 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
2124 outp = outbuf + offset; 2124 outp = outbuf + offset;
2125 } 2125 }
2126 for (i = 0; i < ccl.produced; i++) 2126 for (j = 0; j < ccl.produced; j++)
2127 CHAR_STRING_ADVANCE (destination[i], outp); 2127 CHAR_STRING_ADVANCE (destination[j], outp);
2128 } 2128 }
2129 else 2129 else
2130 { 2130 {
@@ -2135,8 +2135,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2135 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); 2135 outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
2136 outp = outbuf + offset; 2136 outp = outbuf + offset;
2137 } 2137 }
2138 for (i = 0; i < ccl.produced; i++) 2138 for (j = 0; j < ccl.produced; j++)
2139 *outp++ = destination[i]; 2139 *outp++ = destination[j];
2140 } 2140 }
2141 src += ccl.consumed; 2141 src += ccl.consumed;
2142 src_size -= ccl.consumed; 2142 src_size -= ccl.consumed;
@@ -2253,7 +2253,7 @@ Return index number of the registered map. */)
2253{ 2253{
2254 int len = ASIZE (Vcode_conversion_map_vector); 2254 int len = ASIZE (Vcode_conversion_map_vector);
2255 int i; 2255 int i;
2256 Lisp_Object index; 2256 Lisp_Object idx;
2257 2257
2258 CHECK_SYMBOL (symbol); 2258 CHECK_SYMBOL (symbol);
2259 CHECK_VECTOR (map); 2259 CHECK_VECTOR (map);
@@ -2267,11 +2267,11 @@ Return index number of the registered map. */)
2267 2267
2268 if (EQ (symbol, XCAR (slot))) 2268 if (EQ (symbol, XCAR (slot)))
2269 { 2269 {
2270 index = make_number (i); 2270 idx = make_number (i);
2271 XSETCDR (slot, map); 2271 XSETCDR (slot, map);
2272 Fput (symbol, Qcode_conversion_map, map); 2272 Fput (symbol, Qcode_conversion_map, map);
2273 Fput (symbol, Qcode_conversion_map_id, index); 2273 Fput (symbol, Qcode_conversion_map_id, idx);
2274 return index; 2274 return idx;
2275 } 2275 }
2276 } 2276 }
2277 2277
@@ -2279,11 +2279,11 @@ Return index number of the registered map. */)
2279 Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector, 2279 Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
2280 len * 2, Qnil); 2280 len * 2, Qnil);
2281 2281
2282 index = make_number (i); 2282 idx = make_number (i);
2283 Fput (symbol, Qcode_conversion_map, map); 2283 Fput (symbol, Qcode_conversion_map, map);
2284 Fput (symbol, Qcode_conversion_map_id, index); 2284 Fput (symbol, Qcode_conversion_map_id, idx);
2285 ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map)); 2285 ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
2286 return index; 2286 return idx;
2287} 2287}
2288 2288
2289 2289
@@ -2341,4 +2341,3 @@ used by CCL. */);
2341 defsubr (&Sregister_ccl_program); 2341 defsubr (&Sregister_ccl_program);
2342 defsubr (&Sregister_code_conversion_map); 2342 defsubr (&Sregister_code_conversion_map);
2343} 2343}
2344