(vc-cvs-after-dir-status, vc-cvs-parse-status): Detect
[bpt/emacs.git] / src / ccl.c
index 96f6b41..6fc6f29 100644 (file)
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,8 +1,8 @@
 /* CCL (Code Conversion Language) interpreter.
    Copyright (C) 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007 Free Software Foundation, Inc.
+                 2006, 2007, 2008 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-     2005, 2006, 2007
+     2005, 2006, 2007, 2008
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
    Copyright (C) 2003
@@ -13,7 +13,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -673,13 +673,13 @@ while (0)
 
 #define CCL_LookupIntConstTbl 0x13 /* Lookup multibyte character by
                                      integer key.  Afterwards R7 set
-                                     to 1 iff lookup succeeded.
+                                     to 1 if lookup succeeded.
                                      1:ExtendedCOMMNDRrrRRRXXXXXXXX
                                      2:ARGUMENT(Hash table ID) */
 
 #define CCL_LookupCharConstTbl 0x14 /* Lookup integer by multibyte
                                       character key.  Afterwards R7 set
-                                      to 1 iff lookup succeeded.
+                                      to 1 if lookup succeeded.
                                       1:ExtendedCOMMNDRrrRRRrrrXXXXX
                                       2:ARGUMENT(Hash table ID) */
 
@@ -1825,7 +1825,7 @@ resolve_symbol_ccl_program (ccl)
 
          val = Fget (XCAR (contents), XCDR (contents));
          if (NATNUMP (val))
-           AREF (result, i) = val;
+           ASET (result, i, val);
          else
            unresolved = 1;
          continue;
@@ -1840,17 +1840,17 @@ resolve_symbol_ccl_program (ccl)
 
          val = Fget (contents, Qtranslation_table_id);
          if (NATNUMP (val))
-           AREF (result, i) = val;
+           ASET (result, i, val);
          else
            {
              val = Fget (contents, Qcode_conversion_map_id);
              if (NATNUMP (val))
-               AREF (result, i) = val;
+               ASET (result, i, val);
              else
                {
                  val = Fget (contents, Qccl_program_idx);
                  if (NATNUMP (val))
-                   AREF (result, i) = val;
+                   ASET (result, i, val);
                  else
                    unresolved = 1;
                }
@@ -1900,8 +1900,8 @@ ccl_get_compiled_code (ccl_prog, idx)
       val = resolve_symbol_ccl_program (AREF (slot, 1));
       if (! VECTORP (val))
        return Qnil;
-      AREF (slot, 1) = val;
-      AREF (slot, 2) = Qt;
+      ASET (slot, 1, val);
+      ASET (slot, 2, Qt);
     }
   return AREF (slot, 1);
 }
@@ -2039,7 +2039,7 @@ programs.  */)
     error ("Error in CCL program at %dth code", ccl.ic);
 
   for (i = 0; i < 8; i++)
-    XSETINT (AREF (reg, i), ccl.reg[i]);
+    ASET (reg, i, make_number (ccl.reg[i]));
   return Qnil;
 }
 
@@ -2097,7 +2097,7 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
   for (i = 0; i < 8; i++)
     {
       if (NILP (AREF (status, i)))
-       XSETINT (AREF (status, i), 0);
+       ASET (status, i, make_number (0));
       if (INTEGERP (AREF (status, i)))
        ccl.reg[i] = XINT (AREF (status, i));
     }
@@ -2245,16 +2245,8 @@ Return index number of the registered CCL program.  */)
     }
 
   if (idx == len)
-    {
-      /* Extend the table.  */
-      Lisp_Object new_table;
-      int j;
-
-      new_table = Fmake_vector (make_number (len * 2), Qnil);
-      for (j = 0; j < len; j++)
-       ASET (new_table, j, AREF (Vccl_program_table, j));
-      Vccl_program_table = new_table;
-    }
+    /* Extend the table.  */
+    Vccl_program_table = larger_vector (Vccl_program_table, len * 2, Qnil);
 
   {
     Lisp_Object elt;
@@ -2313,20 +2305,13 @@ Return index number of the registered map.  */)
     }
 
   if (i == len)
-    {
-      Lisp_Object new_vector = Fmake_vector (make_number (len * 2), Qnil);
-      int j;
-
-      for (j = 0; j < len; j++)
-       AREF (new_vector, j)
-         = AREF (Vcode_conversion_map_vector, j);
-      Vcode_conversion_map_vector = new_vector;
-    }
+    Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
+                                                len * 2, Qnil);
 
   index = make_number (i);
   Fput (symbol, Qcode_conversion_map, map);
   Fput (symbol, Qcode_conversion_map_id, index);
-  AREF (Vcode_conversion_map_vector, i) = Fcons (symbol, map);
+  ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
   return index;
 }