aboutsummaryrefslogtreecommitdiffstats
path: root/src/charset.h
diff options
context:
space:
mode:
authorPaul Eggert2012-08-26 01:41:36 -0700
committerPaul Eggert2012-08-26 01:41:36 -0700
commitd5172d4fbc2ca871d18426fb9e84ee6bb87a0e68 (patch)
treefe1dd8c01faf007f86f46cbf4a6f441ae28b104d /src/charset.h
parent6af64513413d7194cfa2d8308db2d73f6ed64bf4 (diff)
downloademacs-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/charset.h')
-rw-r--r--src/charset.h39
1 files changed, 20 insertions, 19 deletions
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. */
459extern int charset_map_loaded; 460extern 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). */
475extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; 476extern 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) \