changeset 110549:f3ee3c073b92

Fix EMACS_INT/int conversion in region-cache.c.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Fri, 24 Sep 2010 17:13:43 +0200
parents f7b98576d87f
children d33e6623664c
files src/ChangeLog src/region-cache.c
diffstat 2 files changed, 19 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Sep 24 17:01:03 2010 +0200
+++ b/src/ChangeLog	Fri Sep 24 17:13:43 2010 +0200
@@ -1,5 +1,10 @@
 2010-09-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+	* region-cache.c (move_cache_gap, set_cache_region, pp_cache)
+	(region_cache_backward, region_cache_forward)
+	(revalidate_region_cache, set_cache_region): FIX EMACS_INT/int
+	conversion.
+
 	* xdisp.c (message_dolog): Fix EMACS_INT/int conversion.
 
 	* eval.c (verror): Fix EMACS_INT/int conversion.
--- a/src/region-cache.c	Fri Sep 24 17:01:03 2010 +0200
+++ b/src/region-cache.c	Fri Sep 24 17:13:43 2010 +0200
@@ -76,7 +76,7 @@
 
   /* The number of elements allocated to boundaries, not including the
      gap.  */
-  int cache_len;
+  EMACS_INT cache_len;
 
   /* The areas that haven't changed since the last time we cleaned out
      invalid entries from the cache.  These overlap when the buffer is
@@ -172,16 +172,16 @@
    This operation should be logarithmic in the number of cache
    entries.  It would be nice if it took advantage of locality of
    reference, too, by searching entries near the last entry found.  */
-static int
+static EMACS_INT
 find_cache_boundary (struct region_cache *c, EMACS_INT pos)
 {
-  int low = 0, high = c->cache_len;
+  EMACS_INT low = 0, high = c->cache_len;
 
   while (low + 1 < high)
     {
       /* mid is always a valid index, because low < high and ">> 1"
          rounds down.  */
-      int mid = (low + high) >> 1;
+      EMACS_INT mid = (low + high) >> 1;
       EMACS_INT boundary = BOUNDARY_POS (c, mid);
 
       if (pos < boundary)
@@ -207,7 +207,7 @@
 /* Move the gap of cache C to index POS, and make sure it has space
    for at least MIN_SIZE boundaries.  */
 static void
-move_cache_gap (struct region_cache *c, EMACS_INT pos, int min_size)
+move_cache_gap (struct region_cache *c, EMACS_INT pos, EMACS_INT min_size)
 {
   /* Copy these out of the cache and into registers.  */
   EMACS_INT gap_start = c->gap_start;
@@ -292,7 +292,7 @@
 /* Insert a new boundary in cache C; it will have cache index INDEX,
    and have the specified POS and VALUE.  */
 static void
-insert_cache_boundary (struct region_cache *c, int index, EMACS_INT pos,
+insert_cache_boundary (struct region_cache *c, EMACS_INT index, EMACS_INT pos,
 		       int value)
 {
   /* index must be a valid cache index.  */
@@ -406,8 +406,8 @@
        index of the earliest boundary after the last character in
        start..end.  (This tortured terminology is intended to answer
        all the "< or <=?" sort of questions.)  */
-    int start_ix = find_cache_boundary (c, start);
-    int end_ix   = find_cache_boundary (c, end - 1) + 1;
+    EMACS_INT start_ix = find_cache_boundary (c, start);
+    EMACS_INT end_ix   = find_cache_boundary (c, end - 1) + 1;
 
     /* We must remember the value established by the last boundary
        before end; if that boundary's domain stretches beyond end,
@@ -623,7 +623,7 @@
      corresponds to the modified region of the buffer.  */
   else
     {
-      int modified_ix;
+      EMACS_INT modified_ix;
 
       /* These positions are correct, relative to both the cache basis
          and the buffer basis.  */
@@ -712,9 +712,9 @@
   revalidate_region_cache (buf, c);
 
   {
-    int i = find_cache_boundary (c, pos);
+    EMACS_INT i = find_cache_boundary (c, pos);
     int i_value = BOUNDARY_VALUE (c, i);
-    int j;
+    EMACS_INT j;
 
     /* Beyond the end of the buffer is unknown, by definition.  */
     if (pos >= BUF_Z (buf))
@@ -756,9 +756,9 @@
     }
 
   {
-    int i = find_cache_boundary (c, pos - 1);
+    EMACS_INT i = find_cache_boundary (c, pos - 1);
     int i_value = BOUNDARY_VALUE (c, i);
-    int j;
+    EMACS_INT j;
 
     if (next)
       {
@@ -794,7 +794,7 @@
 
   for (i = 0; i < c->cache_len; i++)
     {
-      int pos = BOUNDARY_POS (c, i);
+      EMACS_INT pos = BOUNDARY_POS (c, i);
 
       putc (((pos < beg_u) ? 'v'
              : (pos == beg_u) ? '-'