Merge branch 'master' into for-steve
[sxemacs] / src / chartab.c
index 6bf3f43..eac0663 100644 (file)
@@ -29,9 +29,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 /* Authorship:
 
    Ben Wing: wrote, for 19.13 (Mule).  Some category table stuff
-             loosely based on the original Mule.
+            loosely based on the original Mule.
    Jareth Hein: fixed a couple of bugs in the implementation, and
-            added regex support for categories with check_category_at
+            added regex support for categories with check_category_at
  */
 
 #include <config.h>
@@ -178,6 +178,7 @@ static Lisp_Object char_table_type_to_symbol(enum char_table_type type)
        switch (type) {
        default:
                abort();
+               return Qnil;
        case CHAR_TABLE_TYPE_GENERIC:
                return Qgeneric;
        case CHAR_TABLE_TYPE_SYNTAX:
@@ -293,12 +294,9 @@ print_chartab_two_byte_charset(Lisp_Object charset,
                Lisp_Object jen = cte->level2[i - 32];
 
                if (!CHAR_TABLE_ENTRYP(jen)) {
-                       char buf[100];
-
                        write_c_string(" [", printcharfun);
                        print_internal(XCHARSET_NAME(charset), printcharfun, 0);
-                       sprintf(buf, " %d] ", i);
-                       write_c_string(buf, printcharfun);
+                       write_fmt_str(printcharfun, " %d] ", i);
                        print_internal(jen, printcharfun, 0);
                } else
                        print_chartab_charset_row(charset, i,
@@ -313,12 +311,10 @@ static void
 print_char_table(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
        Lisp_Char_Table *ct = XCHAR_TABLE(obj);
-       char buf[200];
        Lisp_Object tmp_sym = char_table_type_to_symbol(ct->type);
 
-       snprintf(buf, countof(buf)-1, "#s(char-table type %s data (",
-                string_data(symbol_name(XSYMBOL(tmp_sym))));
-       write_c_string(buf, printcharfun);
+       write_fmt_string(printcharfun, "#s(char-table type %s data (",
+                        string_data(symbol_name(XSYMBOL(tmp_sym))));
 
        /* Now write out the ASCII/Control-1 stuff. */
        {
@@ -990,7 +986,9 @@ canonicalize_char_table_value(Lisp_Object value, enum char_table_type type)
                break;
 
        case CHAR_TABLE_TYPE_GENERIC:
+#ifdef MULE
        case CHAR_TABLE_TYPE_CATEGORY:
+#endif
        case CHAR_TABLE_TYPE_DISPLAY:
        default:
                break;
@@ -1712,7 +1710,7 @@ Valid values are nil or a bit vector of size 95.
 
 /* Return 1 if CATEGORY_SET contains CATEGORY, else return 0.
    The faster version of `!NILP (Faref (category_set, category))'.  */
-#define CATEGORY_MEMBER(category, category_set)                        \
+#define CATEGORY_MEMBER(category, category_set)                        \
   (bit_vector_bit(XBIT_VECTOR (category_set), category - 32))
 
 /* Return 1 if there is a word boundary between two word-constituent