misc changes
[bpt/emacs.git] / src / casetab.c
index a84bc92..d5e6862 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with case tables.
-   Copyright (C) 1993-1994, 2001-201 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc.
 
 Author: Howard Gayle
 
@@ -205,7 +205,6 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
        from = to = XINT (c);
 
       to++;
-      lint_assume (to <= MAX_CHAR + 1);
       for (; from < to; from++)
        CHAR_TABLE_SET (table, from, make_number (from));
     }
@@ -232,7 +231,6 @@ shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
        from = to = XINT (c);
 
       to++;
-      lint_assume (to <= MAX_CHAR + 1);
       for (; from < to; from++)
        {
          Lisp_Object tem = Faref (table, elt);
@@ -246,16 +244,9 @@ void
 init_casetab_once (void)
 {
   register int i;
-  Lisp_Object down, up;
-  DEFSYM (Qcase_table, "case-table");
-
-  /* Intern this now in case it isn't already done.
-     Setting this variable twice is harmless.
-     But don't staticpro it here--that is done in alloc.c.  */
-  Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
+  Lisp_Object down, up, eqv;
 
-  /* Now we are ready to set up this property, so we can
-     create char tables.  */
+  DEFSYM (Qcase_table, "case-table");
   Fput (Qcase_table, Qchar_table_extra_slots, make_number (3));
 
   down = Fmake_char_table (Qcase_table, Qnil);
@@ -275,13 +266,21 @@ init_casetab_once (void)
 
   for (i = 0; i < 128; i++)
     {
+      int c = (i >= 'a' && i <= 'z') ? i + ('A' - 'a') : i;
+      CHAR_TABLE_SET (up, i, make_number (c));
+    }
+
+  eqv = Fmake_char_table (Qcase_table, Qnil);
+
+   for (i = 0; i < 128; i++)
+     {
       int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A')
               : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a')
                  : i));
-      CHAR_TABLE_SET (up, i, make_number (c));
+      CHAR_TABLE_SET (eqv, i, make_number (c));
     }
 
-  set_char_table_extras (down, 2, Fcopy_sequence (up));
+  set_char_table_extras (down, 2, eqv);
 
   /* Fill in what isn't filled in.  */
   set_case_table (down, 1);
@@ -290,16 +289,12 @@ init_casetab_once (void)
 void
 syms_of_casetab (void)
 {
+#include "casetab.x"
+
   DEFSYM (Qcase_table_p, "case-table-p");
 
   staticpro (&Vascii_canon_table);
   staticpro (&Vascii_downcase_table);
   staticpro (&Vascii_eqv_table);
   staticpro (&Vascii_upcase_table);
-
-  defsubr (&Scase_table_p);
-  defsubr (&Scurrent_case_table);
-  defsubr (&Sstandard_case_table);
-  defsubr (&Sset_case_table);
-  defsubr (&Sset_standard_case_table);
 }