]> code.delx.au - gnu-emacs/commitdiff
* casetab.c (set_identity, shuffle): Use lint_assume.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Sep 2011 20:14:57 +0000 (13:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Sep 2011 20:14:57 +0000 (13:14 -0700)
src/ChangeLog
src/casetab.c

index de618a225e3374aad6b87af88703461c03964baa..382ca0f4e2545a13ecde77119678ec21de0d7b52 100644 (file)
@@ -67,7 +67,7 @@
        Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
        (casify_object): Avoid integer overflow when overallocating buffer.
        * casetab.c (set_identity, shuffle): Prefer int to unsigned when
-       either works.
+       either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
        * category.c (Fchar_category_set): Don't assume fixnum fits in int.
        * category.h (CATEGORYP): Don't assume arg is nonnegative.
        * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
index 6b639147b7bbda4b6f02492b94c5e359694f1c2e..64e47859d9bb23330503f40b9677df7f601f5626 100644 (file)
@@ -194,8 +194,7 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
 {
   if (NATNUMP (elt))
     {
-      int from;
-      int to;
+      int from, to;
 
       if (CONSP (c))
        {
@@ -204,7 +203,10 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
        }
       else
        from = to = XINT (c);
-      for (; from <= to; from++)
+
+      to++;
+      lint_assume (to <= MAX_CHAR + 1);
+      for (; from < to; from++)
        CHAR_TABLE_SET (table, from, make_number (from));
     }
 }
@@ -229,7 +231,9 @@ shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
       else
        from = to = XINT (c);
 
-      for (; from <= to; from++)
+      to++;
+      lint_assume (to <= MAX_CHAR + 1);
+      for (; from < to; from++)
        {
          Lisp_Object tem = Faref (table, elt);
          Faset (table, elt, make_number (from));