emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101592: Fix EMACS_INT/int conversion


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101592: Fix EMACS_INT/int conversion in region-cache.c.
Date: Fri, 24 Sep 2010 17:13:43 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101592
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Fri 2010-09-24 17:13:43 +0200
message:
  Fix EMACS_INT/int conversion in region-cache.c.
modified:
  src/ChangeLog
  src/region-cache.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-09-24 15:01:03 +0000
+++ b/src/ChangeLog     2010-09-24 15:13:43 +0000
@@ -1,5 +1,10 @@
 2010-09-24  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * 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.

=== modified file 'src/region-cache.c'
--- a/src/region-cache.c        2010-09-23 18:35:11 +0000
+++ b/src/region-cache.c        2010-09-24 15:13:43 +0000
@@ -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) ? '-'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]