(font_match_p): Fix for the case that a vector of
[bpt/emacs.git] / src / ccl.c
index dbd04d5..cdf3b1c 100644 (file)
--- a/src/ccl.c
+++ b/src/ccl.c
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+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 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,9 +22,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -1745,7 +1743,8 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
          break;
 
        case CCL_STAT_QUIT:
-         sprintf(msg, "\nCCL: Quited.");
+         if (! ccl->quit_silently)
+           sprintf(msg, "\nCCL: Quited.");
          break;
 
        default:
@@ -1825,7 +1824,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 +1839,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 +1899,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);
 }
@@ -1948,6 +1947,7 @@ setup_ccl_program (ccl, ccl_prog)
   ccl->stack_idx = 0;
   ccl->suppress_error = 0;
   ccl->eight_bit_control = 0;
+  ccl->quit_silently = 0;
   return 0;
 }
 
@@ -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));
     }
@@ -2311,7 +2311,7 @@ Return index number of the registered map.  */)
   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;
 }