diff options
| author | Paul Eggert | 2012-08-26 01:41:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-26 01:41:36 -0700 |
| commit | d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68 (patch) | |
| tree | fe1dd8c01faf007f86f46cbf4a6f441ae28b104d /src | |
| parent | 6af64513413d7194cfa2d8308db2d73f6ed64bf4 (diff) | |
| download | emacs-d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68.tar.gz emacs-d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68.zip | |
* character.c, charset.c, chartab.c: Use bool for booleans.
* character.c (lisp_string_width, string_count_byte8)
(string_escape_byte8):
* charset.c (charset_map_loaded, load_charset_map, read_hex):
(load_charset_map_from_file, map_charset_chars)
(Fdefine_charset_internal, define_charset_internal)
(Fdeclare_equiv_charset, find_charsets_in_text)
(Ffind_charset_region, char_charset, Fiso_charset):
* chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
(sub_char_table_set, sub_char_table_set_range)
(char_table_set_range, optimize_sub_char_table)
(map_sub_char_table):
Use bool for boolean.
* character.c (str_to_unibyte): Omit last boolean argument; it was
always 0. All callers changed.
* character.h, charset.h: Adjust to match previous changes.
* character.h (char_printable_p): Remove decl of nonexistent function.
* charset.h (struct charset): Members code_linear_p, iso_chars_96,
ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
are all boolean, so make them single-bit bitfields.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/character.c | 16 | ||||
| -rw-r--r-- | src/character.h | 3 | ||||
| -rw-r--r-- | src/charset.c | 32 | ||||
| -rw-r--r-- | src/charset.h | 39 | ||||
| -rw-r--r-- | src/chartab.c | 19 |
6 files changed, 74 insertions, 56 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 06682f4637e..c94a6d7495f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,26 @@ | |||
| 1 | 2012-08-26 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-08-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * character.c, charset.c, chartab.c: Use bool for booleans. | ||
| 4 | * character.c (lisp_string_width, string_count_byte8) | ||
| 5 | (string_escape_byte8): | ||
| 6 | * charset.c (charset_map_loaded, load_charset_map, read_hex): | ||
| 7 | (load_charset_map_from_file, map_charset_chars) | ||
| 8 | (Fdefine_charset_internal, define_charset_internal) | ||
| 9 | (Fdeclare_equiv_charset, find_charsets_in_text) | ||
| 10 | (Ffind_charset_region, char_charset, Fiso_charset): | ||
| 11 | * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) | ||
| 12 | (sub_char_table_set, sub_char_table_set_range) | ||
| 13 | (char_table_set_range, optimize_sub_char_table) | ||
| 14 | (map_sub_char_table): | ||
| 15 | Use bool for boolean. | ||
| 16 | * character.c (str_to_unibyte): Omit last boolean argument; it was | ||
| 17 | always 0. All callers changed. | ||
| 18 | * character.h, charset.h: Adjust to match previous changes. | ||
| 19 | * character.h (char_printable_p): Remove decl of nonexistent function. | ||
| 20 | * charset.h (struct charset): Members code_linear_p, iso_chars_96, | ||
| 21 | ascii_compatible_p, supplementary_p, compact_codes_p, unified_p | ||
| 22 | are all boolean, so make them single-bit bitfields. | ||
| 23 | |||
| 3 | * lisp.h (ASET): Remove attempt to detect side effects. | 24 | * lisp.h (ASET): Remove attempt to detect side effects. |
| 4 | It was meant to be temporary and it often doesn't work, | 25 | It was meant to be temporary and it often doesn't work, |
| 5 | because when IDX has side effects the behavior of IDX==IDX | 26 | because when IDX has side effects the behavior of IDX==IDX |
diff --git a/src/character.c b/src/character.c index b2acf36ec15..cfaaf8eeca9 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -427,7 +427,7 @@ lisp_string_width (Lisp_Object string, ptrdiff_t precision, | |||
| 427 | /* This set multibyte to 0 even if STRING is multibyte when it | 427 | /* This set multibyte to 0 even if STRING is multibyte when it |
| 428 | contains only ascii and eight-bit-graphic, but that's | 428 | contains only ascii and eight-bit-graphic, but that's |
| 429 | intentional. */ | 429 | intentional. */ |
| 430 | int multibyte = len < SBYTES (string); | 430 | bool multibyte = len < SBYTES (string); |
| 431 | unsigned char *str = SDATA (string); | 431 | unsigned char *str = SDATA (string); |
| 432 | ptrdiff_t i = 0, i_byte = 0; | 432 | ptrdiff_t i = 0, i_byte = 0; |
| 433 | ptrdiff_t width = 0; | 433 | ptrdiff_t width = 0; |
| @@ -765,13 +765,10 @@ str_as_unibyte (unsigned char *str, ptrdiff_t bytes) | |||
| 765 | corresponding byte and store in DST. CHARS is the number of | 765 | corresponding byte and store in DST. CHARS is the number of |
| 766 | characters in SRC. The value is the number of bytes stored in DST. | 766 | characters in SRC. The value is the number of bytes stored in DST. |
| 767 | Usually, the value is the same as CHARS, but is less than it if SRC | 767 | Usually, the value is the same as CHARS, but is less than it if SRC |
| 768 | contains a non-ASCII, non-eight-bit character. If ACCEPT_LATIN_1 | 768 | contains a non-ASCII, non-eight-bit character. */ |
| 769 | is nonzero, a Latin-1 character is accepted and converted to a byte | ||
| 770 | of that character code. | ||
| 771 | Note: Currently the arg ACCEPT_LATIN_1 is not used. */ | ||
| 772 | 769 | ||
| 773 | ptrdiff_t | 770 | ptrdiff_t |
| 774 | str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, int accept_latin_1) | 771 | str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars) |
| 775 | { | 772 | { |
| 776 | ptrdiff_t i; | 773 | ptrdiff_t i; |
| 777 | 774 | ||
| @@ -781,8 +778,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i | |||
| 781 | 778 | ||
| 782 | if (CHAR_BYTE8_P (c)) | 779 | if (CHAR_BYTE8_P (c)) |
| 783 | c = CHAR_TO_BYTE8 (c); | 780 | c = CHAR_TO_BYTE8 (c); |
| 784 | else if (! ASCII_CHAR_P (c) | 781 | else if (! ASCII_CHAR_P (c)) |
| 785 | && (! accept_latin_1 || c >= 0x100)) | ||
| 786 | return i; | 782 | return i; |
| 787 | *dst++ = c; | 783 | *dst++ = c; |
| 788 | } | 784 | } |
| @@ -793,7 +789,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i | |||
| 793 | static ptrdiff_t | 789 | static ptrdiff_t |
| 794 | string_count_byte8 (Lisp_Object string) | 790 | string_count_byte8 (Lisp_Object string) |
| 795 | { | 791 | { |
| 796 | int multibyte = STRING_MULTIBYTE (string); | 792 | bool multibyte = STRING_MULTIBYTE (string); |
| 797 | ptrdiff_t nbytes = SBYTES (string); | 793 | ptrdiff_t nbytes = SBYTES (string); |
| 798 | unsigned char *p = SDATA (string); | 794 | unsigned char *p = SDATA (string); |
| 799 | unsigned char *pend = p + nbytes; | 795 | unsigned char *pend = p + nbytes; |
| @@ -825,7 +821,7 @@ string_escape_byte8 (Lisp_Object string) | |||
| 825 | { | 821 | { |
| 826 | ptrdiff_t nchars = SCHARS (string); | 822 | ptrdiff_t nchars = SCHARS (string); |
| 827 | ptrdiff_t nbytes = SBYTES (string); | 823 | ptrdiff_t nbytes = SBYTES (string); |
| 828 | int multibyte = STRING_MULTIBYTE (string); | 824 | bool multibyte = STRING_MULTIBYTE (string); |
| 829 | ptrdiff_t byte8_count; | 825 | ptrdiff_t byte8_count; |
| 830 | const unsigned char *src, *src_end; | 826 | const unsigned char *src, *src_end; |
| 831 | unsigned char *dst; | 827 | unsigned char *dst; |
diff --git a/src/character.h b/src/character.h index 332dfee373a..70d4e67a978 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -676,7 +676,6 @@ extern int string_char (const unsigned char *, | |||
| 676 | const unsigned char **, int *); | 676 | const unsigned char **, int *); |
| 677 | 677 | ||
| 678 | extern int translate_char (Lisp_Object, int c); | 678 | extern int translate_char (Lisp_Object, int c); |
| 679 | extern int char_printable_p (int c); | ||
| 680 | extern void parse_str_as_multibyte (const unsigned char *, | 679 | extern void parse_str_as_multibyte (const unsigned char *, |
| 681 | ptrdiff_t, ptrdiff_t *, ptrdiff_t *); | 680 | ptrdiff_t, ptrdiff_t *, ptrdiff_t *); |
| 682 | extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); | 681 | extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); |
| @@ -685,7 +684,7 @@ extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t, | |||
| 685 | extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); | 684 | extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); |
| 686 | extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); | 685 | extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); |
| 687 | extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, | 686 | extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, |
| 688 | ptrdiff_t, int); | 687 | ptrdiff_t); |
| 689 | extern ptrdiff_t strwidth (const char *, ptrdiff_t); | 688 | extern ptrdiff_t strwidth (const char *, ptrdiff_t); |
| 690 | extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, | 689 | extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, |
| 691 | ptrdiff_t *, ptrdiff_t *); | 690 | ptrdiff_t *, ptrdiff_t *); |
diff --git a/src/charset.c b/src/charset.c index 3e286fa947d..0673790e91c 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -215,7 +215,7 @@ static struct | |||
| 215 | 215 | ||
| 216 | /* Set to 1 to warn that a charset map is loaded and thus a buffer | 216 | /* Set to 1 to warn that a charset map is loaded and thus a buffer |
| 217 | text and a string data may be relocated. */ | 217 | text and a string data may be relocated. */ |
| 218 | int charset_map_loaded; | 218 | bool charset_map_loaded; |
| 219 | 219 | ||
| 220 | struct charset_map_entries | 220 | struct charset_map_entries |
| 221 | { | 221 | { |
| @@ -256,7 +256,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 256 | { | 256 | { |
| 257 | Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); | 257 | Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); |
| 258 | unsigned max_code = CHARSET_MAX_CODE (charset); | 258 | unsigned max_code = CHARSET_MAX_CODE (charset); |
| 259 | int ascii_compatible_p = charset->ascii_compatible_p; | 259 | bool ascii_compatible_p = charset->ascii_compatible_p; |
| 260 | int min_char, max_char, nonascii_min_char; | 260 | int min_char, max_char, nonascii_min_char; |
| 261 | int i; | 261 | int i; |
| 262 | unsigned char *fast_map = charset->fast_map; | 262 | unsigned char *fast_map = charset->fast_map; |
| @@ -423,7 +423,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, | |||
| 423 | paying attention to comment character '#'. */ | 423 | paying attention to comment character '#'. */ |
| 424 | 424 | ||
| 425 | static inline unsigned | 425 | static inline unsigned |
| 426 | read_hex (FILE *fp, int *eof, int *overflow) | 426 | read_hex (FILE *fp, bool *eof, bool *overflow) |
| 427 | { | 427 | { |
| 428 | int c; | 428 | int c; |
| 429 | unsigned n; | 429 | unsigned n; |
| @@ -512,7 +512,7 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int co | |||
| 512 | { | 512 | { |
| 513 | unsigned from, to, c; | 513 | unsigned from, to, c; |
| 514 | int idx; | 514 | int idx; |
| 515 | int eof = 0, overflow = 0; | 515 | bool eof = 0, overflow = 0; |
| 516 | 516 | ||
| 517 | from = read_hex (fp, &eof, &overflow); | 517 | from = read_hex (fp, &eof, &overflow); |
| 518 | if (eof) | 518 | if (eof) |
| @@ -717,10 +717,8 @@ map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object fun | |||
| 717 | Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) | 717 | Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) |
| 718 | { | 718 | { |
| 719 | Lisp_Object range; | 719 | Lisp_Object range; |
| 720 | int partial; | 720 | bool partial = (from > CHARSET_MIN_CODE (charset) |
| 721 | 721 | || to < CHARSET_MAX_CODE (charset)); | |
| 722 | partial = (from > CHARSET_MIN_CODE (charset) | ||
| 723 | || to < CHARSET_MAX_CODE (charset)); | ||
| 724 | 722 | ||
| 725 | if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) | 723 | if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) |
| 726 | { | 724 | { |
| @@ -855,7 +853,7 @@ usage: (define-charset-internal ...) */) | |||
| 855 | struct charset charset; | 853 | struct charset charset; |
| 856 | int id; | 854 | int id; |
| 857 | int dimension; | 855 | int dimension; |
| 858 | int new_definition_p; | 856 | bool new_definition_p; |
| 859 | int nchars; | 857 | int nchars; |
| 860 | 858 | ||
| 861 | if (nargs != charset_arg_max) | 859 | if (nargs != charset_arg_max) |
| @@ -1250,7 +1248,7 @@ define_charset_internal (Lisp_Object name, | |||
| 1250 | const char *code_space_chars, | 1248 | const char *code_space_chars, |
| 1251 | unsigned min_code, unsigned max_code, | 1249 | unsigned min_code, unsigned max_code, |
| 1252 | int iso_final, int iso_revision, int emacs_mule_id, | 1250 | int iso_final, int iso_revision, int emacs_mule_id, |
| 1253 | int ascii_compatible, int supplementary, | 1251 | bool ascii_compatible, bool supplementary, |
| 1254 | int code_offset) | 1252 | int code_offset) |
| 1255 | { | 1253 | { |
| 1256 | const unsigned char *code_space = (const unsigned char *) code_space_chars; | 1254 | const unsigned char *code_space = (const unsigned char *) code_space_chars; |
| @@ -1448,7 +1446,7 @@ if CHARSET is designated instead. */) | |||
| 1448 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) | 1446 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) |
| 1449 | { | 1447 | { |
| 1450 | int id; | 1448 | int id; |
| 1451 | int chars_flag; | 1449 | bool chars_flag; |
| 1452 | 1450 | ||
| 1453 | CHECK_CHARSET_GET_ID (charset, id); | 1451 | CHECK_CHARSET_GET_ID (charset, id); |
| 1454 | check_iso_charset_parameter (dimension, chars, final_char); | 1452 | check_iso_charset_parameter (dimension, chars, final_char); |
| @@ -1499,7 +1497,9 @@ string_xstring_p (Lisp_Object string) | |||
| 1499 | It may lookup a translation table TABLE if supplied. */ | 1497 | It may lookup a translation table TABLE if supplied. */ |
| 1500 | 1498 | ||
| 1501 | static void | 1499 | static void |
| 1502 | find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, ptrdiff_t nbytes, Lisp_Object charsets, Lisp_Object table, int multibyte) | 1500 | find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, |
| 1501 | ptrdiff_t nbytes, Lisp_Object charsets, | ||
| 1502 | Lisp_Object table, bool multibyte) | ||
| 1503 | { | 1503 | { |
| 1504 | const unsigned char *pend = ptr + nbytes; | 1504 | const unsigned char *pend = ptr + nbytes; |
| 1505 | 1505 | ||
| @@ -1549,7 +1549,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) | |||
| 1549 | ptrdiff_t from, from_byte, to, stop, stop_byte; | 1549 | ptrdiff_t from, from_byte, to, stop, stop_byte; |
| 1550 | int i; | 1550 | int i; |
| 1551 | Lisp_Object val; | 1551 | Lisp_Object val; |
| 1552 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 1552 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 1553 | 1553 | ||
| 1554 | validate_region (&beg, &end); | 1554 | validate_region (&beg, &end); |
| 1555 | from = XFASTINT (beg); | 1555 | from = XFASTINT (beg); |
| @@ -1735,7 +1735,7 @@ decode_char (struct charset *charset, unsigned int code) | |||
| 1735 | /* Variable used temporarily by the macro ENCODE_CHAR. */ | 1735 | /* Variable used temporarily by the macro ENCODE_CHAR. */ |
| 1736 | Lisp_Object charset_work; | 1736 | Lisp_Object charset_work; |
| 1737 | 1737 | ||
| 1738 | /* Return a code-point of CHAR in CHARSET. If CHAR doesn't belong to | 1738 | /* Return a code-point of C in CHARSET. If C doesn't belong to |
| 1739 | CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, | 1739 | CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, |
| 1740 | use CHARSET's strict_max_char instead of max_char. */ | 1740 | use CHARSET's strict_max_char instead of max_char. */ |
| 1741 | 1741 | ||
| @@ -1978,7 +1978,7 @@ is specified. */) | |||
| 1978 | struct charset * | 1978 | struct charset * |
| 1979 | char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) | 1979 | char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) |
| 1980 | { | 1980 | { |
| 1981 | int maybe_null = 0; | 1981 | bool maybe_null = 0; |
| 1982 | 1982 | ||
| 1983 | if (NILP (charset_list)) | 1983 | if (NILP (charset_list)) |
| 1984 | charset_list = Vcharset_ordered_list; | 1984 | charset_list = Vcharset_ordered_list; |
| @@ -2106,7 +2106,7 @@ DIMENSION, CHARS, and FINAL-CHAR. */) | |||
| 2106 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) | 2106 | (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) |
| 2107 | { | 2107 | { |
| 2108 | int id; | 2108 | int id; |
| 2109 | int chars_flag; | 2109 | bool chars_flag; |
| 2110 | 2110 | ||
| 2111 | check_iso_charset_parameter (dimension, chars, final_char); | 2111 | check_iso_charset_parameter (dimension, chars, final_char); |
| 2112 | chars_flag = XFASTINT (chars) == 96; | 2112 | chars_flag = XFASTINT (chars) == 96; |
diff --git a/src/charset.h b/src/charset.h index 4ef8ddc2c33..6e6d0ec2701 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -173,12 +173,24 @@ struct charset | |||
| 173 | check if a code-point is in a valid range. */ | 173 | check if a code-point is in a valid range. */ |
| 174 | unsigned char *code_space_mask; | 174 | unsigned char *code_space_mask; |
| 175 | 175 | ||
| 176 | /* 1 if there's no gap in code-points. */ | 176 | /* True if there's no gap in code-points. */ |
| 177 | int code_linear_p; | 177 | unsigned code_linear_p : 1; |
| 178 | 178 | ||
| 179 | /* If the charset is treated as 94-chars in ISO-2022, the value is 0. | 179 | /* True if the charset is treated as 96 chars in ISO-2022 |
| 180 | If the charset is treated as 96-chars in ISO-2022, the value is 1. */ | 180 | as opposed to 94 chars. */ |
| 181 | int iso_chars_96; | 181 | unsigned iso_chars_96 : 1; |
| 182 | |||
| 183 | /* True if the charset is compatible with ASCII. */ | ||
| 184 | unsigned ascii_compatible_p : 1; | ||
| 185 | |||
| 186 | /* True if the charset is supplementary. */ | ||
| 187 | unsigned supplementary_p : 1; | ||
| 188 | |||
| 189 | /* True if all the code points are representable by Lisp_Int. */ | ||
| 190 | unsigned compact_codes_p : 1; | ||
| 191 | |||
| 192 | /* True if the charset is unified with Unicode. */ | ||
| 193 | unsigned unified_p : 1; | ||
| 182 | 194 | ||
| 183 | /* ISO final byte of the charset: 48..127. It may be -1 if the | 195 | /* ISO final byte of the charset: 48..127. It may be -1 if the |
| 184 | charset doesn't conform to ISO-2022. */ | 196 | charset doesn't conform to ISO-2022. */ |
| @@ -192,15 +204,6 @@ struct charset | |||
| 192 | version. Otherwise, -1. */ | 204 | version. Otherwise, -1. */ |
| 193 | int emacs_mule_id; | 205 | int emacs_mule_id; |
| 194 | 206 | ||
| 195 | /* Nonzero if the charset is compatible with ASCII. */ | ||
| 196 | int ascii_compatible_p; | ||
| 197 | |||
| 198 | /* Nonzero if the charset is supplementary. */ | ||
| 199 | int supplementary_p; | ||
| 200 | |||
| 201 | /* Nonzero if all the code points are representable by Lisp_Int. */ | ||
| 202 | int compact_codes_p; | ||
| 203 | |||
| 204 | /* The method for encoding/decoding characters of the charset. */ | 207 | /* The method for encoding/decoding characters of the charset. */ |
| 205 | enum charset_method method; | 208 | enum charset_method method; |
| 206 | 209 | ||
| @@ -239,8 +242,6 @@ struct charset | |||
| 239 | /* Offset value to calculate a character code from code-point, and | 242 | /* Offset value to calculate a character code from code-point, and |
| 240 | visa versa. */ | 243 | visa versa. */ |
| 241 | int code_offset; | 244 | int code_offset; |
| 242 | |||
| 243 | int unified_p; | ||
| 244 | }; | 245 | }; |
| 245 | 246 | ||
| 246 | /* Hash table of charset symbols vs. the corresponding attribute | 247 | /* Hash table of charset symbols vs. the corresponding attribute |
| @@ -456,7 +457,7 @@ extern Lisp_Object charset_work; | |||
| 456 | 457 | ||
| 457 | /* Set to 1 when a charset map is loaded to warn that a buffer text | 458 | /* Set to 1 when a charset map is loaded to warn that a buffer text |
| 458 | and a string data may be relocated. */ | 459 | and a string data may be relocated. */ |
| 459 | extern int charset_map_loaded; | 460 | extern bool charset_map_loaded; |
| 460 | 461 | ||
| 461 | 462 | ||
| 462 | /* Set CHARSET to the charset highest priority of C, CODE to the | 463 | /* Set CHARSET to the charset highest priority of C, CODE to the |
| @@ -474,10 +475,10 @@ extern int charset_map_loaded; | |||
| 474 | macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ | 475 | macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ |
| 475 | extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; | 476 | extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; |
| 476 | 477 | ||
| 477 | /* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL | 478 | /* A charset of type iso2022 who has DIMENSION, CHARS_96, and FINAL |
| 478 | (final character). */ | 479 | (final character). */ |
| 479 | #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ | 480 | #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ |
| 480 | iso_charset_table[(dimension) - 1][(chars_96)][(final)] | 481 | iso_charset_table[(dimension) - 1][chars_96][final] |
| 481 | 482 | ||
| 482 | /* Nonzero if the charset who has FAST_MAP may contain C. */ | 483 | /* Nonzero if the charset who has FAST_MAP may contain C. */ |
| 483 | #define CHARSET_FAST_MAP_REF(c, fast_map) \ | 484 | #define CHARSET_FAST_MAP_REF(c, fast_map) \ |
diff --git a/src/chartab.c b/src/chartab.c index 711a49ed397..c14df0ebac6 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -200,7 +200,7 @@ copy_char_table (Lisp_Object table) | |||
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | static Lisp_Object | 202 | static Lisp_Object |
| 203 | sub_char_table_ref (Lisp_Object table, int c, int is_uniprop) | 203 | sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) |
| 204 | { | 204 | { |
| 205 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 205 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 206 | int depth = XINT (tbl->depth); | 206 | int depth = XINT (tbl->depth); |
| @@ -245,7 +245,7 @@ char_table_ref (Lisp_Object table, int c) | |||
| 245 | 245 | ||
| 246 | static Lisp_Object | 246 | static Lisp_Object |
| 247 | sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, | 247 | sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, |
| 248 | Lisp_Object defalt, int is_uniprop) | 248 | Lisp_Object defalt, bool is_uniprop) |
| 249 | { | 249 | { |
| 250 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 250 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 251 | int depth = XINT (tbl->depth); | 251 | int depth = XINT (tbl->depth); |
| @@ -320,7 +320,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) | |||
| 320 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 320 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 321 | int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; | 321 | int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; |
| 322 | Lisp_Object val; | 322 | Lisp_Object val; |
| 323 | int is_uniprop = UNIPROP_TABLE_P (table); | 323 | bool is_uniprop = UNIPROP_TABLE_P (table); |
| 324 | 324 | ||
| 325 | val = tbl->contents[chartab_idx]; | 325 | val = tbl->contents[chartab_idx]; |
| 326 | if (*from < 0) | 326 | if (*from < 0) |
| @@ -382,7 +382,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to) | |||
| 382 | 382 | ||
| 383 | 383 | ||
| 384 | static void | 384 | static void |
| 385 | sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop) | 385 | sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) |
| 386 | { | 386 | { |
| 387 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 387 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 388 | int depth = XINT ((tbl)->depth); | 388 | int depth = XINT ((tbl)->depth); |
| @@ -438,7 +438,7 @@ char_table_set (Lisp_Object table, int c, Lisp_Object val) | |||
| 438 | 438 | ||
| 439 | static void | 439 | static void |
| 440 | sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, | 440 | sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, |
| 441 | int is_uniprop) | 441 | bool is_uniprop) |
| 442 | { | 442 | { |
| 443 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 443 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 444 | int depth = XINT ((tbl)->depth); | 444 | int depth = XINT ((tbl)->depth); |
| @@ -484,7 +484,7 @@ char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) | |||
| 484 | char_table_set (table, from, val); | 484 | char_table_set (table, from, val); |
| 485 | else | 485 | else |
| 486 | { | 486 | { |
| 487 | int is_uniprop = UNIPROP_TABLE_P (table); | 487 | bool is_uniprop = UNIPROP_TABLE_P (table); |
| 488 | int lim = CHARTAB_IDX (to, 0, 0); | 488 | int lim = CHARTAB_IDX (to, 0, 0); |
| 489 | int i, c; | 489 | int i, c; |
| 490 | 490 | ||
| @@ -683,7 +683,8 @@ optimize_sub_char_table (Lisp_Object table, Lisp_Object test) | |||
| 683 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 683 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 684 | int depth = XINT (tbl->depth); | 684 | int depth = XINT (tbl->depth); |
| 685 | Lisp_Object elt, this; | 685 | Lisp_Object elt, this; |
| 686 | int i, optimizable; | 686 | int i; |
| 687 | bool optimizable; | ||
| 687 | 688 | ||
| 688 | elt = XSUB_CHAR_TABLE (table)->contents[0]; | 689 | elt = XSUB_CHAR_TABLE (table)->contents[0]; |
| 689 | if (SUB_CHAR_TABLE_P (elt)) | 690 | if (SUB_CHAR_TABLE_P (elt)) |
| @@ -762,7 +763,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 762 | int chars_in_block; | 763 | int chars_in_block; |
| 763 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); | 764 | int from = XINT (XCAR (range)), to = XINT (XCDR (range)); |
| 764 | int i, c; | 765 | int i, c; |
| 765 | int is_uniprop = UNIPROP_TABLE_P (top); | 766 | bool is_uniprop = UNIPROP_TABLE_P (top); |
| 766 | uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); | 767 | uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); |
| 767 | 768 | ||
| 768 | if (SUB_CHAR_TABLE_P (table)) | 769 | if (SUB_CHAR_TABLE_P (table)) |
| @@ -811,7 +812,7 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 811 | this = XCHAR_TABLE (top)->defalt; | 812 | this = XCHAR_TABLE (top)->defalt; |
| 812 | if (!EQ (val, this)) | 813 | if (!EQ (val, this)) |
| 813 | { | 814 | { |
| 814 | int different_value = 1; | 815 | bool different_value = 1; |
| 815 | 816 | ||
| 816 | if (NILP (val)) | 817 | if (NILP (val)) |
| 817 | { | 818 | { |