aboutsummaryrefslogtreecommitdiffstats
path: root/src/chartab.c
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/chartab.c
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/chartab.c')
-rw-r--r--src/chartab.c19
1 files changed, 10 insertions, 9 deletions
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
202static Lisp_Object 202static Lisp_Object
203sub_char_table_ref (Lisp_Object table, int c, int is_uniprop) 203sub_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
246static Lisp_Object 246static Lisp_Object
247sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, 247sub_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
384static void 384static void
385sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop) 385sub_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
439static void 439static void
440sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, 440sub_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 {