diff options
| author | Paul Eggert | 2011-03-17 23:25:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-17 23:25:25 -0700 |
| commit | c4fc4e301ecaeb98bd3041ca2ce7a106cafefef1 (patch) | |
| tree | 70fc2b2418840aec787fbd8f2425f04b22b77181 /src/region-cache.c | |
| parent | 918436ed33aa8c600281c36454f8519df9a4147d (diff) | |
| download | emacs-c4fc4e301ecaeb98bd3041ca2ce7a106cafefef1.tar.gz emacs-c4fc4e301ecaeb98bd3041ca2ce7a106cafefef1.zip | |
* region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
Diffstat (limited to 'src/region-cache.c')
| -rw-r--r-- | src/region-cache.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/region-cache.c b/src/region-cache.c index 1f9b62da9fa..53ce0e9d802 100644 --- a/src/region-cache.c +++ b/src/region-cache.c | |||
| @@ -290,37 +290,37 @@ move_cache_gap (struct region_cache *c, EMACS_INT pos, EMACS_INT min_size) | |||
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | 292 | ||
| 293 | /* Insert a new boundary in cache C; it will have cache index INDEX, | 293 | /* Insert a new boundary in cache C; it will have cache index I, |
| 294 | and have the specified POS and VALUE. */ | 294 | and have the specified POS and VALUE. */ |
| 295 | static void | 295 | static void |
| 296 | insert_cache_boundary (struct region_cache *c, EMACS_INT index, EMACS_INT pos, | 296 | insert_cache_boundary (struct region_cache *c, EMACS_INT i, EMACS_INT pos, |
| 297 | int value) | 297 | int value) |
| 298 | { | 298 | { |
| 299 | /* index must be a valid cache index. */ | 299 | /* i must be a valid cache index. */ |
| 300 | if (index < 0 || index > c->cache_len) | 300 | if (i < 0 || i > c->cache_len) |
| 301 | abort (); | 301 | abort (); |
| 302 | 302 | ||
| 303 | /* We must never want to insert something before the dummy first | 303 | /* We must never want to insert something before the dummy first |
| 304 | boundary. */ | 304 | boundary. */ |
| 305 | if (index == 0) | 305 | if (i == 0) |
| 306 | abort (); | 306 | abort (); |
| 307 | 307 | ||
| 308 | /* We must only be inserting things in order. */ | 308 | /* We must only be inserting things in order. */ |
| 309 | if (! (BOUNDARY_POS (c, index-1) < pos | 309 | if (! (BOUNDARY_POS (c, i - 1) < pos |
| 310 | && (index == c->cache_len | 310 | && (i == c->cache_len |
| 311 | || pos < BOUNDARY_POS (c, index)))) | 311 | || pos < BOUNDARY_POS (c, i)))) |
| 312 | abort (); | 312 | abort (); |
| 313 | 313 | ||
| 314 | /* The value must be different from the ones around it. However, we | 314 | /* The value must be different from the ones around it. However, we |
| 315 | temporarily create boundaries that establish the same value as | 315 | temporarily create boundaries that establish the same value as |
| 316 | the subsequent boundary, so we're not going to flag that case. */ | 316 | the subsequent boundary, so we're not going to flag that case. */ |
| 317 | if (BOUNDARY_VALUE (c, index-1) == value) | 317 | if (BOUNDARY_VALUE (c, i - 1) == value) |
| 318 | abort (); | 318 | abort (); |
| 319 | 319 | ||
| 320 | move_cache_gap (c, index, 1); | 320 | move_cache_gap (c, i, 1); |
| 321 | 321 | ||
| 322 | c->boundaries[index].pos = pos - c->buffer_beg; | 322 | c->boundaries[i].pos = pos - c->buffer_beg; |
| 323 | c->boundaries[index].value = value; | 323 | c->boundaries[i].value = value; |
| 324 | c->gap_start++; | 324 | c->gap_start++; |
| 325 | c->gap_len--; | 325 | c->gap_len--; |
| 326 | c->cache_len++; | 326 | c->cache_len++; |
| @@ -808,4 +808,3 @@ pp_cache (struct region_cache *c) | |||
| 808 | fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i)); | 808 | fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i)); |
| 809 | } | 809 | } |
| 810 | } | 810 | } |
| 811 | |||