aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog2
-rw-r--r--src/chartab.c26
2 files changed, 15 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 90804f01b3b..ccd0578cf38 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -74,6 +74,8 @@
74 74
75 * chartab.c (copy_sub_char_table): Now static, since it's not used 75 * chartab.c (copy_sub_char_table): Now static, since it's not used
76 elsewhere. 76 elsewhere.
77 (sub_char_table_ref_and_range, char_table_ref_and_range):
78 Rename locals to avoid shadowing.
77 79
782011-03-06 Chong Yidong <cyd@stupidchicken.com> 802011-03-06 Chong Yidong <cyd@stupidchicken.com>
79 81
diff --git a/src/chartab.c b/src/chartab.c
index 413d3f39e79..ec5b2ffab76 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -216,16 +216,16 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
216 int depth = XINT (tbl->depth); 216 int depth = XINT (tbl->depth);
217 int min_char = XINT (tbl->min_char); 217 int min_char = XINT (tbl->min_char);
218 int max_char = min_char + chartab_chars[depth - 1] - 1; 218 int max_char = min_char + chartab_chars[depth - 1] - 1;
219 int index = CHARTAB_IDX (c, depth, min_char), idx; 219 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
220 Lisp_Object val; 220 Lisp_Object val;
221 221
222 val = tbl->contents[index]; 222 val = tbl->contents[chartab_idx];
223 if (SUB_CHAR_TABLE_P (val)) 223 if (SUB_CHAR_TABLE_P (val))
224 val = sub_char_table_ref_and_range (val, c, from, to, defalt); 224 val = sub_char_table_ref_and_range (val, c, from, to, defalt);
225 else if (NILP (val)) 225 else if (NILP (val))
226 val = defalt; 226 val = defalt;
227 227
228 idx = index; 228 idx = chartab_idx;
229 while (idx > 0 && *from < min_char + idx * chartab_chars[depth]) 229 while (idx > 0 && *from < min_char + idx * chartab_chars[depth])
230 { 230 {
231 Lisp_Object this_val; 231 Lisp_Object this_val;
@@ -244,13 +244,13 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
244 break; 244 break;
245 } 245 }
246 } 246 }
247 while ((c = min_char + (index + 1) * chartab_chars[depth]) <= max_char 247 while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char
248 && *to >= c) 248 && *to >= c)
249 { 249 {
250 Lisp_Object this_val; 250 Lisp_Object this_val;
251 251
252 index++; 252 chartab_idx++;
253 this_val = tbl->contents[index]; 253 this_val = tbl->contents[chartab_idx];
254 if (SUB_CHAR_TABLE_P (this_val)) 254 if (SUB_CHAR_TABLE_P (this_val))
255 this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt); 255 this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt);
256 else if (NILP (this_val)) 256 else if (NILP (this_val))
@@ -275,10 +275,10 @@ Lisp_Object
275char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) 275char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
276{ 276{
277 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); 277 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
278 int index = CHARTAB_IDX (c, 0, 0), idx; 278 int chartab_idx = CHARTAB_IDX (c, 0, 0), idx;
279 Lisp_Object val; 279 Lisp_Object val;
280 280
281 val = tbl->contents[index]; 281 val = tbl->contents[chartab_idx];
282 if (*from < 0) 282 if (*from < 0)
283 *from = 0; 283 *from = 0;
284 if (*to < 0) 284 if (*to < 0)
@@ -288,7 +288,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
288 else if (NILP (val)) 288 else if (NILP (val))
289 val = tbl->defalt; 289 val = tbl->defalt;
290 290
291 idx = index; 291 idx = chartab_idx;
292 while (*from < idx * chartab_chars[0]) 292 while (*from < idx * chartab_chars[0])
293 { 293 {
294 Lisp_Object this_val; 294 Lisp_Object this_val;
@@ -308,13 +308,13 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
308 break; 308 break;
309 } 309 }
310 } 310 }
311 while (*to >= (index + 1) * chartab_chars[0]) 311 while (*to >= (chartab_idx + 1) * chartab_chars[0])
312 { 312 {
313 Lisp_Object this_val; 313 Lisp_Object this_val;
314 314
315 index++; 315 chartab_idx++;
316 c = index * chartab_chars[0]; 316 c = chartab_idx * chartab_chars[0];
317 this_val = tbl->contents[index]; 317 this_val = tbl->contents[chartab_idx];
318 if (SUB_CHAR_TABLE_P (this_val)) 318 if (SUB_CHAR_TABLE_P (this_val))
319 this_val = sub_char_table_ref_and_range (this_val, c, from, to, 319 this_val = sub_char_table_ref_and_range (this_val, c, from, to,
320 tbl->defalt); 320 tbl->defalt);