* casetab.c (set_identity, shuffle): Likewise.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 9 Apr 2011 22:31:34 +0000 (15:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 9 Apr 2011 22:31:34 +0000 (15:31 -0700)
src/ChangeLog
src/casetab.c

index 9029fff..a979af1 100644 (file)
@@ -2,6 +2,7 @@
 
        * charset.c (load_charset_map): <, not <=, for optimization.
        * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
+       * casetab.c (set_identity, shuffle): Likewise.
 
        * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
        This also lets GCC 4.6.0 generate slightly better loop code.
index 56f6b06..9a1accf 100644 (file)
@@ -191,7 +191,8 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
 {
   if (NATNUMP (elt))
     {
-      int from, to;
+      int from;
+      unsigned to;
 
       if (CONSP (c))
        {
@@ -200,7 +201,7 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
        }
       else
        from = to = XINT (c);
-      for (; from <= to; from++)
+      for (to++; from < to; from++)
        CHAR_TABLE_SET (table, from, make_number (from));
     }
 }
@@ -215,7 +216,8 @@ shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
 {
   if (NATNUMP (elt))
     {
-      int from, to;
+      int from;
+      unsigned to;
 
       if (CONSP (c))
        {
@@ -225,7 +227,7 @@ shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
       else
        from = to = XINT (c);
 
-      for (; from <= to; from++)
+      for (to++; from < to; from++)
        {
          Lisp_Object tem = Faref (table, elt);
          Faset (table, elt, make_number (from));