summaryrefslogtreecommitdiff
path: root/src/region-cache.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-03-22 18:01:59 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-03-22 18:01:59 -0700
commitc9c49752e15c105ded153e9ab0a42743f57184e5 (patch)
treee395db95d87459082bace9fcf3a2cec0ea3d1aea /src/region-cache.c
parent9d0da923ebd2b78abb6e02f0b90cfe9d818eb301 (diff)
parentb9b4b7cb4c27f9f6ad644168f0e1241e5c0d6eaa (diff)
downloademacs-c9c49752e15c105ded153e9ab0a42743f57184e5.tar.gz
Fix more problems found by GCC 4.5.2's static checks.
Diffstat (limited to 'src/region-cache.c')
-rw-r--r--src/region-cache.c25
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)
}
-/* Insert a new boundary in cache C; it will have cache index INDEX,
+/* Insert a new boundary in cache C; it will have cache index I,
and have the specified POS and VALUE. */
static void
-insert_cache_boundary (struct region_cache *c, EMACS_INT index, EMACS_INT pos,
+insert_cache_boundary (struct region_cache *c, EMACS_INT i, EMACS_INT pos,
int value)
{
- /* index must be a valid cache index. */
- if (index < 0 || index > c->cache_len)
+ /* i must be a valid cache index. */
+ if (i < 0 || i > c->cache_len)
abort ();
/* We must never want to insert something before the dummy first
boundary. */
- if (index == 0)
+ if (i == 0)
abort ();
/* We must only be inserting things in order. */
- if (! (BOUNDARY_POS (c, index-1) < pos
- && (index == c->cache_len
- || pos < BOUNDARY_POS (c, index))))
+ if (! (BOUNDARY_POS (c, i - 1) < pos
+ && (i == c->cache_len
+ || pos < BOUNDARY_POS (c, i))))
abort ();
/* The value must be different from the ones around it. However, we
temporarily create boundaries that establish the same value as
the subsequent boundary, so we're not going to flag that case. */
- if (BOUNDARY_VALUE (c, index-1) == value)
+ if (BOUNDARY_VALUE (c, i - 1) == value)
abort ();
- move_cache_gap (c, index, 1);
+ move_cache_gap (c, i, 1);
- c->boundaries[index].pos = pos - c->buffer_beg;
- c->boundaries[index].value = value;
+ c->boundaries[i].pos = pos - c->buffer_beg;
+ c->boundaries[i].value = value;
c->gap_start++;
c->gap_len--;
c->cache_len++;
@@ -808,4 +808,3 @@ pp_cache (struct region_cache *c)
fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i));
}
}
-