aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2002-07-16 15:08:53 +0000
committerDave Love2002-07-16 15:08:53 +0000
commit16fed1fc8696eebc0d61a792691fa915e51db866 (patch)
treeb441c1415e86b58fb7746b05e90e89f553921a87 /src
parent73e92b8cc08c498c2fd9541797074ed818b5e1b7 (diff)
downloademacs-16fed1fc8696eebc0d61a792691fa915e51db866.tar.gz
emacs-16fed1fc8696eebc0d61a792691fa915e51db866.zip
(Fmap_charset_chars): Check args. Convert Lisp types.
(load_charset_map, Fdeclare_equiv_charset, Fencode_char) (Fset_charset_priority, syms_of_charset): Convert Lisp types.
Diffstat (limited to 'src')
-rw-r--r--src/charset.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/charset.c b/src/charset.c
index 9265bbdfb00..9661bedb1b6 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -300,7 +300,7 @@ load_charset_map (charset, entries, n_entries, control_flag)
300 if (c1 >= 0) 300 if (c1 >= 0)
301 { 301 {
302 CHAR_TABLE_SET (table, from_c, make_number (c1)); 302 CHAR_TABLE_SET (table, from_c, make_number (c1));
303 CHAR_TABLE_SET (Vchar_unify_table, c1, from_c); 303 CHAR_TABLE_SET (Vchar_unify_table, c1, make_number (from_c));
304 if (CHAR_TABLE_P (Vchar_unified_charset_table)) 304 if (CHAR_TABLE_P (Vchar_unified_charset_table))
305 CHAR_TABLE_SET (Vchar_unified_charset_table, c1, 305 CHAR_TABLE_SET (Vchar_unified_charset_table, c1,
306 CHARSET_NAME (charset)); 306 CHARSET_NAME (charset));
@@ -661,18 +661,23 @@ range of code points of targer characters. */)
661 Lisp_Object function, charset, arg, from_code, to_code; 661 Lisp_Object function, charset, arg, from_code, to_code;
662{ 662{
663 struct charset *cs; 663 struct charset *cs;
664 unsigned from, to;
664 665
665 CHECK_CHARSET_GET_CHARSET (charset, cs); 666 CHECK_CHARSET_GET_CHARSET (charset, cs);
666 if (NILP (from_code)) 667 if (NILP (from_code))
667 from_code = 0; 668 from_code = make_number (0);
668 if (from_code < CHARSET_MIN_CODE (cs)) 669 CHECK_NATNUM (from_code);
669 from_code = CHARSET_MIN_CODE (cs); 670 from = XINT (from_code);
671 if (from < CHARSET_MIN_CODE (cs))
672 from = CHARSET_MIN_CODE (cs);
670 if (NILP (to_code)) 673 if (NILP (to_code))
671 to_code = 0xFFFFFFFF; 674 to_code = make_number (0xFFFFFFFF);
672 if (to_code > CHARSET_MAX_CODE (cs)) 675 CHECK_NATNUM (from_code);
673 to_code = CHARSET_MAX_CODE (cs); 676 to = XINT (to_code);
677 if (to > CHARSET_MAX_CODE (cs))
678 to_code = make_number (CHARSET_MAX_CODE (cs));
674 679
675 map_charset_chars (NULL, function, arg, cs, from_code, to_code); 680 map_charset_chars (NULL, function, arg, cs, from, to);
676 return Qnil; 681 return Qnil;
677} 682}
678 683
@@ -1208,7 +1213,7 @@ CHARSET should be defined by `define-charset' in advance. */)
1208 CHECK_CHARSET_GET_ID (charset, id); 1213 CHECK_CHARSET_GET_ID (charset, id);
1209 check_iso_charset_parameter (dimension, chars, final_char); 1214 check_iso_charset_parameter (dimension, chars, final_char);
1210 1215
1211 ISO_CHARSET_TABLE (dimension, chars, final_char) = id; 1216 ISO_CHARSET_TABLE (XINT (dimension), XINT (chars), XINT (final_char)) = id;
1212 return Qnil; 1217 return Qnil;
1213} 1218}
1214 1219
@@ -1608,15 +1613,14 @@ code-point in CCS. Currently not supported and just ignored. */)
1608 (ch, charset, restriction) 1613 (ch, charset, restriction)
1609 Lisp_Object ch, charset, restriction; 1614 Lisp_Object ch, charset, restriction;
1610{ 1615{
1611 int c, id; 1616 int id;
1612 unsigned code; 1617 unsigned code;
1613 struct charset *charsetp; 1618 struct charset *charsetp;
1614 1619
1615 CHECK_CHARSET_GET_ID (charset, id); 1620 CHECK_CHARSET_GET_ID (charset, id);
1616 CHECK_NATNUM (ch); 1621 CHECK_NATNUM (ch);
1617 c = XINT (ch);
1618 charsetp = CHARSET_FROM_ID (id); 1622 charsetp = CHARSET_FROM_ID (id);
1619 code = ENCODE_CHAR (charsetp, ch); 1623 code = ENCODE_CHAR (charsetp, XINT (ch));
1620 if (code == CHARSET_INVALID_CODE (charsetp)) 1624 if (code == CHARSET_INVALID_CODE (charsetp))
1621 return Qnil; 1625 return Qnil;
1622 if (code > 0x7FFFFFF) 1626 if (code > 0x7FFFFFF)
@@ -1739,8 +1743,7 @@ char_charset (c, charset_list, code_return)
1739/* Fixme: `unknown' can't happen now? */ 1743/* Fixme: `unknown' can't happen now? */
1740DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0, 1744DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0,
1741 doc: /*Return list of charset and one to three position-codes of CHAR. 1745 doc: /*Return list of charset and one to three position-codes of CHAR.
1742If CHAR is invalid as a character code, 1746If CHAR is invalid as a character code, return a list `(unknown CHAR)'. */)
1743return a list of symbol `unknown' and CHAR. */)
1744 (ch) 1747 (ch)
1745 Lisp_Object ch; 1748 Lisp_Object ch;
1746{ 1749{
@@ -1868,11 +1871,11 @@ HIGHESTP non-nil means just return the highest priority one. */)
1868 Lisp_Object val = Qnil, list = Vcharset_ordered_list; 1871 Lisp_Object val = Qnil, list = Vcharset_ordered_list;
1869 1872
1870 if (!NILP (highestp)) 1873 if (!NILP (highestp))
1871 return CHARSET_NAME (CHARSET_FROM_ID (Fcar (list))); 1874 return CHARSET_NAME (CHARSET_FROM_ID (XINT (Fcar (list))));
1872 1875
1873 while (!NILP (list)) 1876 while (!NILP (list))
1874 { 1877 {
1875 val = Fcons (CHARSET_NAME (CHARSET_FROM_ID (XCAR (list))), val); 1878 val = Fcons (CHARSET_NAME (CHARSET_FROM_ID (XINT (XCAR (list)))), val);
1876 list = XCDR (list); 1879 list = XCDR (list);
1877 } 1880 }
1878 return Fnreverse (val); 1881 return Fnreverse (val);
@@ -1886,15 +1889,15 @@ usage: (set-charset-priority &rest charsets) */)
1886 int nargs; 1889 int nargs;
1887 Lisp_Object *args; 1890 Lisp_Object *args;
1888{ 1891{
1889 Lisp_Object new_head = Qnil, old_list, id, arglist[2]; 1892 Lisp_Object new_head = Qnil, old_list, arglist[2];
1890 int i; 1893 int i, id;
1891 1894
1892 old_list = Fcopy_sequence (Vcharset_ordered_list); 1895 old_list = Fcopy_sequence (Vcharset_ordered_list);
1893 for (i = 0; i < nargs; i++) 1896 for (i = 0; i < nargs; i++)
1894 { 1897 {
1895 CHECK_CHARSET_GET_ID (args[i], id); 1898 CHECK_CHARSET_GET_ID (args[i], id);
1896 old_list = Fdelq (id, old_list); 1899 old_list = Fdelq (make_number (id), old_list);
1897 new_head = Fcons (id, new_head); 1900 new_head = Fcons (make_number (id), new_head);
1898 } 1901 }
1899 arglist[0] = Fnreverse (new_head); 1902 arglist[0] = Fnreverse (new_head);
1900 arglist[1] = old_list; 1903 arglist[1] = old_list;
@@ -2059,7 +2062,7 @@ The default value is sub-directory "charsets" of `data-directory'. */);
2059 plist[13] = args[charset_arg_code_offset]; 2062 plist[13] = args[charset_arg_code_offset];
2060 args[charset_arg_plist] = Flist (14, plist); 2063 args[charset_arg_plist] = Flist (14, plist);
2061 Fdefine_charset_internal (charset_arg_max, args); 2064 Fdefine_charset_internal (charset_arg_max, args);
2062 charset_ascii = CHARSET_SYMBOL_ID (Qascii); 2065 charset_ascii = XINT (CHARSET_SYMBOL_ID (Qascii));
2063 2066
2064 args[charset_arg_name] = Qunicode; 2067 args[charset_arg_name] = Qunicode;
2065 args[charset_arg_dimension] = make_number (3); 2068 args[charset_arg_dimension] = make_number (3);
@@ -2091,7 +2094,7 @@ The default value is sub-directory "charsets" of `data-directory'. */);
2091 plist[13] = args[charset_arg_code_offset]; 2094 plist[13] = args[charset_arg_code_offset];
2092 args[charset_arg_plist] = Flist (14, plist); 2095 args[charset_arg_plist] = Flist (14, plist);
2093 Fdefine_charset_internal (charset_arg_max, args); 2096 Fdefine_charset_internal (charset_arg_max, args);
2094 charset_unicode = CHARSET_SYMBOL_ID (Qunicode); 2097 charset_unicode = XINT (CHARSET_SYMBOL_ID (Qunicode));
2095 } 2098 }
2096} 2099}
2097 2100