aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2013-12-14 13:36:44 -0800
committerPaul Eggert2013-12-14 13:36:44 -0800
commit96c0686368d8b7d481cb40239db896ff37df416a (patch)
tree84d8ee02271476dd4aaaee52c5302f2c576089ef /src
parent5ae811ddef14ea1989088c259a9ed2d14d5332b4 (diff)
downloademacs-96c0686368d8b7d481cb40239db896ff37df416a.tar.gz
emacs-96c0686368d8b7d481cb40239db896ff37df416a.zip
Use bool for boolean, focusing on headers.
* configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK): Use bool for boolean. * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE): Remove. All uses replaced with uncapitalized version. * lib-src/emacsclient.c (message): * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names): * lib-src/hexl.c (un_flag, iso_flag, endian): * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next) (pop_trash): Use bool for boolean. * lib-src/etags.c (bool): Remove. * lib-src/etags.c (globals, members, declarations, no_line_directive) (no_duplicates): Use 'int' for boolean values that getopt requires to be 'int'. Formerly, these were 'bool' and 'bool' was 'int', but we can no longer rely on this implementation. * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields. * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields. * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c: No need to include <stdbool.h>, since conf_post.h does it now. * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION) (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P) (SET_PER_BUFFER_VALUE_P): * src/ccl.c, src/ccl.h (setup_ccl_program): * src/ccl.h (CHECK_CCL_PROGRAM): * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR) (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY) (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE) (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE) (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH) (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID) (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET) (CHARSET_FAST_MAP_SET): * src/coding.c (decode_coding_ccl, encode_coding_ccl): * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC) (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2) (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE) (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8) (decode_coding_c_string): * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE): * src/conf_post.h (has_attribute): * src/dispextern.h (trace_redisplay_p): (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE) (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH) (SET_GLYPH_FROM_CHAR_GLYPH): (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P) (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P) (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p) (cursor_in_mouse_face_p): * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows) (blank_row, prepare_desired_row) (build_frame_matrix_from_leaf_window, make_current) (mirror_make_current, mirrored_line_dance, mirror_line_dance) (update_window, scrolling_window, update_frame_line): * src/disptab.h (GLYPH_FOLLOW_ALIASES): * src/editfns.c (Fformat): * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC) (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE) (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC) (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC) (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY) (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG) (FONT_DEFERRED_LOG): * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P): (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME) (FRAME_MOUSE_UPDATE): * src/fringe.c (Fdefine_fringe_bitmap): * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask) (x_create_bitmap_from_xpm_data, xpm_load_image): * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT) (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE) (MERGE_INTERVAL_CACHE): * src/keymap.h (KEYMAPP): * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE) (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP) (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER) (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER) (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT) (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE) (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp): * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX) (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD) (SETUP_BUFFER_SYNTAX_TABLE): * src/systime.h (timespec_valid_p): * src/term.c (save_and_enable_current_matrix): * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P): * src/xdisp.c (in_display_vector_p, display_tool_bar_line) (redisplay_internal, try_window_reusing_current_matrix) (sync_frame_with_window_matrix_rows, try_window_id) (display_menu_bar, display_tty_menu_item, display_mode_line) (coords_in_mouse_face_p, cursor_in_mouse_face_p): * src/xmenu.c (xmenu_show): * src/xterm.c (use_xim, x_term_init): * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET) (struct x_bitmap_record): Use bool for booleans. * src/ccl.c (struct buffer_text): * src/ccl.h (struct ccl_program): * src/charset.h (struct charset): * src/cm.h (struct cm): * src/coding.h (struct iso_2022_spec, struct coding_system): * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row) (struct glyph_string, struct face, struct face_cache) (struct bidi_string_data, struct bidi_it) (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo) (struct image): * src/editfns.c (Fformat): * src/frame.h (struct frame): * src/fringe.c (struct fringe_bitmap): * src/intervals.h (struct interval): * src/keyboard.h (struct kboard): * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker) (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free) (struct Lisp_Buffer_Local_Value, union specbinding): * src/macfont.m (struct macfont_info): * src/process.h (struct Lisp_Process): * src/termchar.h (struct tty_display_info): * src/window.h (struct window): * src/xterm.h (struct x_output): Use bool_bf for boolean bit-fields. * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0. All callers changed. * src/ccl.h (struct ccl_program): Remove unused members private_state, src_multibyte, dst_multibyte, cr_consumed, suppress_error, eight_bit_control. (struct ccl_spec): Remove unused members cr_carryover, eight_bit_carryover. * src/conf_post.h: Include <stdbool.h>. (bool_bf): New type. * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY): * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE) Surround statement macro with proper 'do { ... } while (false)' brackets. (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool. (PRODUCE_GLYPHS): Simplify use of boolean. * src/fileio.c (Fcopy_file): If I is an integer, prefer 'if (I != 0)' to 'if (I)'. * src/lisp.h (UNGCPRO): Return void, not int. (FOR_EACH_TAIL): Use void expression, not int expression. * src/region-cache.c: Reindent. * src/region-cache.h: Copy comments from region-cache.c, to fix incorrect remarks about booleans.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog130
-rw-r--r--src/atimer.h1
-rw-r--r--src/buffer.h32
-rw-r--r--src/ccl.c27
-rw-r--r--src/ccl.h30
-rw-r--r--src/character.h36
-rw-r--r--src/charset.h26
-rw-r--r--src/cm.h14
-rw-r--r--src/coding.c4
-rw-r--r--src/coding.h61
-rw-r--r--src/composite.h4
-rw-r--r--src/conf_post.h11
-rw-r--r--src/dispextern.h416
-rw-r--r--src/dispnew.c40
-rw-r--r--src/disptab.h2
-rw-r--r--src/editfns.c6
-rw-r--r--src/fileio.c4
-rw-r--r--src/font.h49
-rw-r--r--src/frame.h124
-rw-r--r--src/fringe.c4
-rw-r--r--src/gnutls.h6
-rw-r--r--src/image.c12
-rw-r--r--src/intervals.h50
-rw-r--r--src/keyboard.h2
-rw-r--r--src/keymap.h2
-rw-r--r--src/lisp.h190
-rw-r--r--src/macfont.m6
-rw-r--r--src/process.h18
-rw-r--r--src/region-cache.c5
-rw-r--r--src/region-cache.h27
-rw-r--r--src/syntax.h15
-rw-r--r--src/syssignal.h1
-rw-r--r--src/systime.h4
-rw-r--r--src/syswait.h1
-rw-r--r--src/term.c2
-rw-r--r--src/termchar.h43
-rw-r--r--src/unexelf.c1
-rw-r--r--src/window.h86
-rw-r--r--src/xdisp.c50
-rw-r--r--src/xmenu.c2
-rw-r--r--src/xterm.c10
-rw-r--r--src/xterm.h54
42 files changed, 863 insertions, 745 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1422f6b1f68..a063d2d51d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,133 @@
12013-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use bool for boolean, focusing on headers.
4 * atimer.h, lisp.h, syssignal.h, syswait.h, unexelf.c:
5 No need to include <stdbool.h>, since conf_post.h does it now.
6 * buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
7 (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
8 (SET_PER_BUFFER_VALUE_P):
9 * ccl.c, ccl.h (setup_ccl_program):
10 * ccl.h (CHECK_CCL_PROGRAM):
11 * character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
12 (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
13 (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
14 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
15 (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
16 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
17 (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
18 * charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
19 (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
20 (CHARSET_FAST_MAP_SET):
21 * coding.c (decode_coding_ccl, encode_coding_ccl):
22 * coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
23 (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
24 (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
25 (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
26 (decode_coding_c_string):
27 * composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
28 * conf_post.h (has_attribute):
29 * dispextern.h (trace_redisplay_p):
30 (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
31 (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
32 (SET_GLYPH_FROM_CHAR_GLYPH):
33 (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
34 (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
35 (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
36 (cursor_in_mouse_face_p):
37 * dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
38 (blank_row, prepare_desired_row)
39 (build_frame_matrix_from_leaf_window, make_current)
40 (mirror_make_current, mirrored_line_dance, mirror_line_dance)
41 (update_window, scrolling_window, update_frame_line):
42 * disptab.h (GLYPH_FOLLOW_ALIASES):
43 * editfns.c (Fformat):
44 * font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
45 (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
46 (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
47 (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
48 (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
49 (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
50 (FONT_DEFERRED_LOG):
51 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
52 (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
53 (FRAME_MOUSE_UPDATE):
54 * fringe.c (Fdefine_fringe_bitmap):
55 * image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
56 (x_create_bitmap_from_xpm_data, xpm_load_image):
57 * intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
58 (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
59 (MERGE_INTERVAL_CACHE):
60 * keymap.h (KEYMAPP):
61 * lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
62 (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
63 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
64 (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
65 (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
66 (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
67 (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
68 (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
69 * syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
70 (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
71 (SETUP_BUFFER_SYNTAX_TABLE):
72 * systime.h (timespec_valid_p):
73 * term.c (save_and_enable_current_matrix):
74 * window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
75 * xdisp.c (in_display_vector_p, display_tool_bar_line)
76 (redisplay_internal, try_window_reusing_current_matrix)
77 (sync_frame_with_window_matrix_rows, try_window_id)
78 (display_menu_bar, display_tty_menu_item, display_mode_line)
79 (coords_in_mouse_face_p, cursor_in_mouse_face_p):
80 * xmenu.c (xmenu_show):
81 * xterm.c (use_xim, x_term_init):
82 * xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
83 (struct x_bitmap_record):
84 Use bool for booleans.
85 * ccl.c (struct buffer_text):
86 * ccl.h (struct ccl_program):
87 * charset.h (struct charset):
88 * cm.h (struct cm):
89 * coding.h (struct iso_2022_spec, struct coding_system):
90 * dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
91 (struct glyph_string, struct face, struct face_cache)
92 (struct bidi_string_data, struct bidi_it)
93 (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
94 (struct image):
95 * editfns.c (Fformat):
96 * frame.h (struct frame):
97 * fringe.c (struct fringe_bitmap):
98 * intervals.h (struct interval):
99 * keyboard.h (struct kboard):
100 * lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
101 (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
102 (struct Lisp_Buffer_Local_Value, union specbinding):
103 * macfont.m (struct macfont_info):
104 * process.h (struct Lisp_Process):
105 * termchar.h (struct tty_display_info):
106 * window.h (struct window):
107 * xterm.h (struct x_output):
108 Use bool_bf for boolean bit-fields.
109 * ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
110 All callers changed.
111 * ccl.h (struct ccl_program): Remove unused members private_state,
112 src_multibyte, dst_multibyte, cr_consumed, suppress_error,
113 eight_bit_control.
114 (struct ccl_spec): Remove unused members cr_carryover,
115 eight_bit_carryover.
116 * conf_post.h: Include <stdbool.h>.
117 (bool_bf): New type.
118 * dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
119 * interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
120 Surround statement macro with proper 'do { ... } while (false)' brackets.
121 (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
122 (PRODUCE_GLYPHS): Simplify use of boolean.
123 * fileio.c (Fcopy_file):
124 If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
125 * lisp.h (UNGCPRO): Return void, not int.
126 (FOR_EACH_TAIL): Use void expression, not int expression.
127 * region-cache.c: Reindent.
128 * region-cache.h: Copy comments from region-cache.c, to fix
129 incorrect remarks about booleans.
130
12013-12-14 Eli Zaretskii <eliz@gnu.org> 1312013-12-14 Eli Zaretskii <eliz@gnu.org>
2 132
3 * xdisp.c (Fmove_point_visually): Expect overshoot in move_it_to 133 * xdisp.c (Fmove_point_visually): Expect overshoot in move_it_to
diff --git a/src/atimer.h b/src/atimer.h
index 8c4d732aa4e..b1017c8ec28 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#ifndef EMACS_ATIMER_H 19#ifndef EMACS_ATIMER_H
20#define EMACS_ATIMER_H 20#define EMACS_ATIMER_H
21 21
22#include <stdbool.h>
23#include <time.h> 22#include <time.h>
24 23
25/* Forward declaration. */ 24/* Forward declaration. */
diff --git a/src/buffer.h b/src/buffer.h
index 10d5fdc23e0..60f522514c3 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -226,7 +226,7 @@ INLINE_HEADER_BEGIN
226 BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ 226 BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \
227 } \ 227 } \
228 } \ 228 } \
229 while (0) 229 while (false)
230 230
231 231
232/* Macros to set PT in the current buffer, or another buffer. */ 232/* Macros to set PT in the current buffer, or another buffer. */
@@ -302,7 +302,7 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t);
302 else \ 302 else \
303 wrong_type_argument (Qinteger_or_marker_p, __pos); \ 303 wrong_type_argument (Qinteger_or_marker_p, __pos); \
304 } \ 304 } \
305 while (0) 305 while (false)
306 306
307/* Maximum number of bytes in a buffer. 307/* Maximum number of bytes in a buffer.
308 A buffer cannot contain more bytes than a 1-origin fixnum can represent, 308 A buffer cannot contain more bytes than a 1-origin fixnum can represent,
@@ -472,13 +472,13 @@ struct buffer_text
472 to move a marker within a buffer. */ 472 to move a marker within a buffer. */
473 struct Lisp_Marker *markers; 473 struct Lisp_Marker *markers;
474 474
475 /* Usually 0. Temporarily set to 1 in decode_coding_gap to 475 /* Usually false. Temporarily true in decode_coding_gap to
476 prevent Fgarbage_collect from shrinking the gap and losing 476 prevent Fgarbage_collect from shrinking the gap and losing
477 not-yet-decoded bytes. */ 477 not-yet-decoded bytes. */
478 unsigned inhibit_shrinking : 1; 478 bool_bf inhibit_shrinking : 1;
479 479
480 /* True if it needs to be redisplayed. */ 480 /* True if it needs to be redisplayed. */
481 unsigned redisplay : 1; 481 bool_bf redisplay : 1;
482 }; 482 };
483 483
484/* Most code should use this macro to access Lisp fields in struct buffer. */ 484/* Most code should use this macro to access Lisp fields in struct buffer. */
@@ -849,10 +849,10 @@ struct buffer
849 849
850 /* Non-zero means don't use redisplay optimizations for 850 /* Non-zero means don't use redisplay optimizations for
851 displaying this buffer. */ 851 displaying this buffer. */
852 unsigned prevent_redisplay_optimizations_p : 1; 852 bool_bf prevent_redisplay_optimizations_p : 1;
853 853
854 /* Non-zero whenever the narrowing is changed in this buffer. */ 854 /* Non-zero whenever the narrowing is changed in this buffer. */
855 unsigned clip_changed : 1; 855 bool_bf clip_changed : 1;
856 856
857 /* List of overlays that end at or before the current center, 857 /* List of overlays that end at or before the current center,
858 in order of end-position. */ 858 in order of end-position. */
@@ -1021,7 +1021,7 @@ bset_width_table (struct buffer *b, Lisp_Object val)
1021 else \ 1021 else \
1022 eassert (b->indirections >= 0); \ 1022 eassert (b->indirections >= 0); \
1023 } \ 1023 } \
1024 } while (0) 1024 } while (false)
1025 1025
1026/* Chain of all buffers, including killed ones. */ 1026/* Chain of all buffers, including killed ones. */
1027 1027
@@ -1119,16 +1119,16 @@ record_unwind_current_buffer (void)
1119 do { \ 1119 do { \
1120 ptrdiff_t maxlen = 40; \ 1120 ptrdiff_t maxlen = 40; \
1121 overlays = alloca (maxlen * sizeof *overlays); \ 1121 overlays = alloca (maxlen * sizeof *overlays); \
1122 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ 1122 noverlays = overlays_at (posn, false, &overlays, &maxlen, \
1123 nextp, NULL, chrq); \ 1123 nextp, NULL, chrq); \
1124 if (noverlays > maxlen) \ 1124 if (noverlays > maxlen) \
1125 { \ 1125 { \
1126 maxlen = noverlays; \ 1126 maxlen = noverlays; \
1127 overlays = alloca (maxlen * sizeof *overlays); \ 1127 overlays = alloca (maxlen * sizeof *overlays); \
1128 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ 1128 noverlays = overlays_at (posn, false, &overlays, &maxlen, \
1129 nextp, NULL, chrq); \ 1129 nextp, NULL, chrq); \
1130 } \ 1130 } \
1131 } while (0) 1131 } while (false)
1132 1132
1133extern Lisp_Object Vbuffer_alist; 1133extern Lisp_Object Vbuffer_alist;
1134extern Lisp_Object Qbefore_change_functions; 1134extern Lisp_Object Qbefore_change_functions;
@@ -1267,12 +1267,12 @@ extern int last_per_buffer_idx;
1267#define PER_BUFFER_VAR_IDX(VAR) \ 1267#define PER_BUFFER_VAR_IDX(VAR) \
1268 PER_BUFFER_IDX (PER_BUFFER_VAR_OFFSET (VAR)) 1268 PER_BUFFER_IDX (PER_BUFFER_VAR_OFFSET (VAR))
1269 1269
1270/* Value is non-zero if the variable with index IDX has a local value 1270/* Value is true if the variable with index IDX has a local value
1271 in buffer B. */ 1271 in buffer B. */
1272 1272
1273#define PER_BUFFER_VALUE_P(B, IDX) \ 1273#define PER_BUFFER_VALUE_P(B, IDX) \
1274 (((IDX) < 0 || IDX >= last_per_buffer_idx) \ 1274 (((IDX) < 0 || IDX >= last_per_buffer_idx) \
1275 ? (emacs_abort (), 0) \ 1275 ? (emacs_abort (), false) \
1276 : ((B)->local_flags[IDX] != 0)) 1276 : ((B)->local_flags[IDX] != 0))
1277 1277
1278/* Set whether per-buffer variable with index IDX has a buffer-local 1278/* Set whether per-buffer variable with index IDX has a buffer-local
@@ -1283,7 +1283,7 @@ extern int last_per_buffer_idx;
1283 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \ 1283 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \
1284 emacs_abort (); \ 1284 emacs_abort (); \
1285 (B)->local_flags[IDX] = (VAL); \ 1285 (B)->local_flags[IDX] = (VAL); \
1286 } while (0) 1286 } while (false)
1287 1287
1288/* Return the index value of the per-buffer variable at offset OFFSET 1288/* Return the index value of the per-buffer variable at offset OFFSET
1289 in the buffer structure. 1289 in the buffer structure.
@@ -1348,7 +1348,7 @@ downcase (int c)
1348 return NATNUMP (down) ? XFASTINT (down) : c; 1348 return NATNUMP (down) ? XFASTINT (down) : c;
1349} 1349}
1350 1350
1351/* 1 if C is upper case. */ 1351/* True if C is upper case. */
1352INLINE bool uppercasep (int c) { return downcase (c) != c; } 1352INLINE bool uppercasep (int c) { return downcase (c) != c; }
1353 1353
1354/* Upcase a character C known to be not upper case. */ 1354/* Upcase a character C known to be not upper case. */
@@ -1360,7 +1360,7 @@ upcase1 (int c)
1360 return NATNUMP (up) ? XFASTINT (up) : c; 1360 return NATNUMP (up) ? XFASTINT (up) : c;
1361} 1361}
1362 1362
1363/* 1 if C is lower case. */ 1363/* True if C is lower case. */
1364INLINE bool 1364INLINE bool
1365lowercasep (int c) 1365lowercasep (int c)
1366{ 1366{
diff --git a/src/ccl.c b/src/ccl.c
index 8fec18296a6..84bdb9b97c3 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -628,7 +628,7 @@ do \
628 { \ 628 { \
629 struct ccl_program called_ccl; \ 629 struct ccl_program called_ccl; \
630 if (stack_idx >= 256 \ 630 if (stack_idx >= 256 \
631 || (setup_ccl_program (&called_ccl, (symbol)) != 0)) \ 631 || ! setup_ccl_program (&called_ccl, (symbol))) \
632 { \ 632 { \
633 if (stack_idx > 0) \ 633 if (stack_idx > 0) \
634 { \ 634 { \
@@ -1712,9 +1712,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1712 } 1712 }
1713 1713
1714 ccl_error_handler: 1714 ccl_error_handler:
1715 /* The suppress_error member is set when e.g. a CCL-based coding 1715 if (destination)
1716 system is used for terminal output. */
1717 if (!ccl->suppress_error && destination)
1718 { 1716 {
1719 /* We can insert an error message only if DESTINATION is 1717 /* We can insert an error message only if DESTINATION is
1720 specified and we still have a room to store the message 1718 specified and we still have a room to store the message
@@ -1919,10 +1917,10 @@ ccl_get_compiled_code (Lisp_Object ccl_prog, ptrdiff_t *idx)
1919/* Setup fields of the structure pointed by CCL appropriately for the 1917/* Setup fields of the structure pointed by CCL appropriately for the
1920 execution of CCL program CCL_PROG. CCL_PROG is the name (symbol) 1918 execution of CCL program CCL_PROG. CCL_PROG is the name (symbol)
1921 of the CCL program or the already compiled code (vector). 1919 of the CCL program or the already compiled code (vector).
1922 Return 0 if we succeed this setup, else return -1. 1920 Return true iff successful.
1923 1921
1924 If CCL_PROG is nil, we just reset the structure pointed by CCL. */ 1922 If CCL_PROG is nil, just reset the structure pointed by CCL. */
1925int 1923bool
1926setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog) 1924setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1927{ 1925{
1928 int i; 1926 int i;
@@ -1933,7 +1931,7 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1933 1931
1934 ccl_prog = ccl_get_compiled_code (ccl_prog, &ccl->idx); 1932 ccl_prog = ccl_get_compiled_code (ccl_prog, &ccl->idx);
1935 if (! VECTORP (ccl_prog)) 1933 if (! VECTORP (ccl_prog))
1936 return -1; 1934 return false;
1937 vp = XVECTOR (ccl_prog); 1935 vp = XVECTOR (ccl_prog);
1938 ccl->size = vp->header.size; 1936 ccl->size = vp->header.size;
1939 ccl->prog = vp->contents; 1937 ccl->prog = vp->contents;
@@ -1950,14 +1948,11 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1950 ccl->ic = CCL_HEADER_MAIN; 1948 ccl->ic = CCL_HEADER_MAIN;
1951 for (i = 0; i < 8; i++) 1949 for (i = 0; i < 8; i++)
1952 ccl->reg[i] = 0; 1950 ccl->reg[i] = 0;
1953 ccl->last_block = 0; 1951 ccl->last_block = false;
1954 ccl->private_state = 0;
1955 ccl->status = 0; 1952 ccl->status = 0;
1956 ccl->stack_idx = 0; 1953 ccl->stack_idx = 0;
1957 ccl->suppress_error = 0; 1954 ccl->quit_silently = false;
1958 ccl->eight_bit_control = 0; 1955 return true;
1959 ccl->quit_silently = 0;
1960 return 0;
1961} 1956}
1962 1957
1963 1958
@@ -2003,7 +1998,7 @@ programs. */)
2003 struct ccl_program ccl; 1998 struct ccl_program ccl;
2004 int i; 1999 int i;
2005 2000
2006 if (setup_ccl_program (&ccl, ccl_prog) < 0) 2001 if (! setup_ccl_program (&ccl, ccl_prog))
2007 error ("Invalid CCL program"); 2002 error ("Invalid CCL program");
2008 2003
2009 CHECK_VECTOR (reg); 2004 CHECK_VECTOR (reg);
@@ -2065,7 +2060,7 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
2065 ptrdiff_t consumed_chars, consumed_bytes, produced_chars; 2060 ptrdiff_t consumed_chars, consumed_bytes, produced_chars;
2066 int buf_magnification; 2061 int buf_magnification;
2067 2062
2068 if (setup_ccl_program (&ccl, ccl_prog) < 0) 2063 if (! setup_ccl_program (&ccl, ccl_prog))
2069 error ("Invalid CCL program"); 2064 error ("Invalid CCL program");
2070 2065
2071 CHECK_VECTOR (status); 2066 CHECK_VECTOR (status);
diff --git a/src/ccl.h b/src/ccl.h
index cc5daf11e1c..b01a73f3a2d 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -51,34 +51,16 @@ struct ccl_program {
51 int reg[8]; /* CCL registers, reg[7] is used for 51 int reg[8]; /* CCL registers, reg[7] is used for
52 condition flag of relational 52 condition flag of relational
53 operations. */ 53 operations. */
54 int private_state; /* CCL instruction may use this
55 for private use, mainly for saving
56 internal states on suspending.
57 This variable is set to 0 when ccl is
58 set up. */
59 int last_block; /* Set to 1 while processing the last
60 block. */
61 int status; /* Exit status of the CCL program. */ 54 int status; /* Exit status of the CCL program. */
62 int buf_magnification; /* Output buffer magnification. How 55 int buf_magnification; /* Output buffer magnification. How
63 many times bigger the output buffer 56 many times bigger the output buffer
64 should be than the input buffer. */ 57 should be than the input buffer. */
65 int stack_idx; /* How deep the call of CCL_Call is nested. */ 58 int stack_idx; /* How deep the call of CCL_Call is nested. */
66 int src_multibyte; /* 1 if the input buffer is multibyte. */
67 int dst_multibyte; /* 1 if the output buffer is multibyte. */
68 int cr_consumed; /* Flag for encoding DOS-like EOL
69 format when the CCL program is used
70 for encoding by a coding
71 system. */
72 int consumed; 59 int consumed;
73 int produced; 60 int produced;
74 int suppress_error; /* If nonzero, don't insert error 61 bool_bf last_block : 1; /* Set to true while processing the last
75 message in the output. */ 62 block. */
76 int eight_bit_control; /* If nonzero, ccl_driver counts all 63 bool_bf quit_silently : 1; /* If true, don't append "CCL:
77 eight-bit-control bytes written by
78 CCL_WRITE_CHAR. After execution,
79 if no such byte is written, set
80 this value to zero. */
81 int quit_silently; /* If nonzero, don't append "CCL:
82 Quitted" to the generated text when 64 Quitted" to the generated text when
83 CCL program is quitted. */ 65 CCL program is quitted. */
84}; 66};
@@ -88,15 +70,13 @@ struct ccl_program {
88 70
89struct ccl_spec { 71struct ccl_spec {
90 struct ccl_program ccl; 72 struct ccl_program ccl;
91 int cr_carryover; /* CR carryover flag. */
92 unsigned char eight_bit_carryover[MAX_MULTIBYTE_LENGTH];
93}; 73};
94 74
95#define CODING_SPEC_CCL_PROGRAM(coding) ((coding)->spec.ccl.ccl) 75#define CODING_SPEC_CCL_PROGRAM(coding) ((coding)->spec.ccl.ccl)
96 76
97/* Setup fields of the structure pointed by CCL appropriately for the 77/* Setup fields of the structure pointed by CCL appropriately for the
98 execution of ccl program CCL_PROG (symbol or vector). */ 78 execution of ccl program CCL_PROG (symbol or vector). */
99extern int setup_ccl_program (struct ccl_program *, Lisp_Object); 79extern bool setup_ccl_program (struct ccl_program *, Lisp_Object);
100 80
101extern void ccl_driver (struct ccl_program *, int *, int *, int, int, 81extern void ccl_driver (struct ccl_program *, int *, int *, int, int,
102 Lisp_Object); 82 Lisp_Object);
@@ -107,6 +87,6 @@ extern Lisp_Object Qccl, Qcclp;
107 do { \ 87 do { \
108 if (NILP (Fccl_program_p (x))) \ 88 if (NILP (Fccl_program_p (x))) \
109 wrong_type_argument (Qcclp, (x)); \ 89 wrong_type_argument (Qcclp, (x)); \
110 } while (0); 90 } while (false);
111 91
112#endif /* EMACS_CCL_H */ 92#endif /* EMACS_CCL_H */
diff --git a/src/character.h b/src/character.h
index e944b5775ed..748a9c3ea39 100644
--- a/src/character.h
+++ b/src/character.h
@@ -91,7 +91,7 @@ INLINE_HEADER_BEGIN
91 do { \ 91 do { \
92 if (! ASCII_CHAR_P (c)) \ 92 if (! ASCII_CHAR_P (c)) \
93 c = CHAR_TO_BYTE8 (c); \ 93 c = CHAR_TO_BYTE8 (c); \
94 } while (0) 94 } while (false)
95 95
96 96
97/* If C is not ASCII, make it multibyte. Assumes C < 256. */ 97/* If C is not ASCII, make it multibyte. Assumes C < 256. */
@@ -123,14 +123,14 @@ INLINE_HEADER_BEGIN
123 Lisp_Object tmp = XCAR (x); \ 123 Lisp_Object tmp = XCAR (x); \
124 CHECK_CHARACTER (tmp); \ 124 CHECK_CHARACTER (tmp); \
125 XSETCAR ((x), tmp); \ 125 XSETCAR ((x), tmp); \
126 } while (0) 126 } while (false)
127 127
128#define CHECK_CHARACTER_CDR(x) \ 128#define CHECK_CHARACTER_CDR(x) \
129 do { \ 129 do { \
130 Lisp_Object tmp = XCDR (x); \ 130 Lisp_Object tmp = XCDR (x); \
131 CHECK_CHARACTER (tmp); \ 131 CHECK_CHARACTER (tmp); \
132 XSETCDR ((x), tmp); \ 132 XSETCDR ((x), tmp); \
133 } while (0) 133 } while (false)
134 134
135/* Nonzero iff C is a character of code less than 0x100. */ 135/* Nonzero iff C is a character of code less than 0x100. */
136#define SINGLE_BYTE_CHAR_P(c) UNSIGNED_CMP (c, <, 0x100) 136#define SINGLE_BYTE_CHAR_P(c) UNSIGNED_CMP (c, <, 0x100)
@@ -209,7 +209,7 @@ INLINE_HEADER_BEGIN
209 verify (sizeof (c) <= sizeof (unsigned)); \ 209 verify (sizeof (c) <= sizeof (unsigned)); \
210 (p) += char_string (c, p); \ 210 (p) += char_string (c, p); \
211 } \ 211 } \
212 } while (0) 212 } while (false)
213 213
214 214
215/* Nonzero iff BYTE starts a non-ASCII character in a multibyte 215/* Nonzero iff BYTE starts a non-ASCII character in a multibyte
@@ -274,7 +274,7 @@ INLINE_HEADER_BEGIN
274 do { \ 274 do { \
275 if ((p) < (limit)) \ 275 if ((p) < (limit)) \
276 (p) += BYTES_BY_CHAR_HEAD (*(p)); \ 276 (p) += BYTES_BY_CHAR_HEAD (*(p)); \
277 } while (0) 277 } while (false)
278 278
279 279
280/* If P is after LIMIT, advance P to the previous character boundary. 280/* If P is after LIMIT, advance P to the previous character boundary.
@@ -291,7 +291,7 @@ INLINE_HEADER_BEGIN
291 } while (chp >= limit && ! CHAR_HEAD_P (*chp)); \ 291 } while (chp >= limit && ! CHAR_HEAD_P (*chp)); \
292 (p) = (BYTES_BY_CHAR_HEAD (*chp) == (p) - chp) ? chp : (p) - 1; \ 292 (p) = (BYTES_BY_CHAR_HEAD (*chp) == (p) - chp) ? chp : (p) - 1; \
293 } \ 293 } \
294 } while (0) 294 } while (false)
295 295
296/* Return the character code of character whose multibyte form is at 296/* Return the character code of character whose multibyte form is at
297 P. Note that this macro unifies CJK characters whose codepoints 297 P. Note that this macro unifies CJK characters whose codepoints
@@ -382,7 +382,7 @@ INLINE_HEADER_BEGIN
382 BYTEIDX++; \ 382 BYTEIDX++; \
383 } \ 383 } \
384 } \ 384 } \
385 while (0) 385 while (false)
386 386
387/* Like FETCH_STRING_CHAR_ADVANCE, but return a multibyte character 387/* Like FETCH_STRING_CHAR_ADVANCE, but return a multibyte character
388 even if STRING is unibyte. */ 388 even if STRING is unibyte. */
@@ -406,7 +406,7 @@ INLINE_HEADER_BEGIN
406 MAKE_CHAR_MULTIBYTE (OUTPUT); \ 406 MAKE_CHAR_MULTIBYTE (OUTPUT); \
407 } \ 407 } \
408 } \ 408 } \
409 while (0) 409 while (false)
410 410
411 411
412/* Like FETCH_STRING_CHAR_ADVANCE, but assumes STRING is multibyte. */ 412/* Like FETCH_STRING_CHAR_ADVANCE, but assumes STRING is multibyte. */
@@ -421,7 +421,7 @@ INLINE_HEADER_BEGIN
421 BYTEIDX += fetch_len; \ 421 BYTEIDX += fetch_len; \
422 CHARIDX++; \ 422 CHARIDX++; \
423 } \ 423 } \
424 while (0) 424 while (false)
425 425
426 426
427/* Like FETCH_STRING_CHAR_ADVANCE, but fetch character from the current 427/* Like FETCH_STRING_CHAR_ADVANCE, but fetch character from the current
@@ -445,7 +445,7 @@ INLINE_HEADER_BEGIN
445 BYTEIDX++; \ 445 BYTEIDX++; \
446 } \ 446 } \
447 } \ 447 } \
448 while (0) 448 while (false)
449 449
450 450
451/* Like FETCH_CHAR_ADVANCE, but assumes the current buffer is multibyte. */ 451/* Like FETCH_CHAR_ADVANCE, but assumes the current buffer is multibyte. */
@@ -460,7 +460,7 @@ INLINE_HEADER_BEGIN
460 BYTEIDX += chlen; \ 460 BYTEIDX += chlen; \
461 CHARIDX++; \ 461 CHARIDX++; \
462 } \ 462 } \
463 while (0) 463 while (false)
464 464
465 465
466/* Increment the buffer byte position POS_BYTE of the current buffer to 466/* Increment the buffer byte position POS_BYTE of the current buffer to
@@ -470,7 +470,7 @@ INLINE_HEADER_BEGIN
470 do { \ 470 do { \
471 unsigned char *chp = BYTE_POS_ADDR (pos_byte); \ 471 unsigned char *chp = BYTE_POS_ADDR (pos_byte); \
472 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \ 472 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
473 } while (0) 473 } while (false)
474 474
475 475
476/* Decrement the buffer byte position POS_BYTE of the current buffer to 476/* Decrement the buffer byte position POS_BYTE of the current buffer to
@@ -490,7 +490,7 @@ INLINE_HEADER_BEGIN
490 chp--; \ 490 chp--; \
491 pos_byte--; \ 491 pos_byte--; \
492 } \ 492 } \
493 } while (0) 493 } while (false)
494 494
495/* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */ 495/* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */
496 496
@@ -503,7 +503,7 @@ INLINE_HEADER_BEGIN
503 else \ 503 else \
504 INC_POS ((bytepos)); \ 504 INC_POS ((bytepos)); \
505 } \ 505 } \
506 while (0) 506 while (false)
507 507
508 508
509/* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */ 509/* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */
@@ -517,7 +517,7 @@ INLINE_HEADER_BEGIN
517 else \ 517 else \
518 DEC_POS ((bytepos)); \ 518 DEC_POS ((bytepos)); \
519 } \ 519 } \
520 while (0) 520 while (false)
521 521
522 522
523/* Increment the buffer byte position POS_BYTE of the current buffer to 523/* Increment the buffer byte position POS_BYTE of the current buffer to
@@ -529,7 +529,7 @@ INLINE_HEADER_BEGIN
529 do { \ 529 do { \
530 unsigned char *chp = BUF_BYTE_ADDRESS (buf, pos_byte); \ 530 unsigned char *chp = BUF_BYTE_ADDRESS (buf, pos_byte); \
531 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \ 531 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
532 } while (0) 532 } while (false)
533 533
534 534
535/* Decrement the buffer byte position POS_BYTE of the current buffer to 535/* Decrement the buffer byte position POS_BYTE of the current buffer to
@@ -548,7 +548,7 @@ INLINE_HEADER_BEGIN
548 chp--; \ 548 chp--; \
549 pos_byte--; \ 549 pos_byte--; \
550 } \ 550 } \
551 } while (0) 551 } while (false)
552 552
553 553
554/* Return a non-outlandish value for the tab width. */ 554/* Return a non-outlandish value for the tab width. */
@@ -602,7 +602,7 @@ sanitize_char_width (EMACS_INT width)
602 : 0) 602 : 0)
603 603
604/* If C is a high surrogate, return 1. If C is a low surrogate, 604/* If C is a high surrogate, return 1. If C is a low surrogate,
605 return 0. Otherwise, return 0. */ 605 return 2. Otherwise, return 0. */
606 606
607#define CHAR_SURROGATE_PAIR_P(c) \ 607#define CHAR_SURROGATE_PAIR_P(c) \
608 ((c) < 0xD800 ? 0 \ 608 ((c) < 0xD800 ? 0 \
diff --git a/src/charset.h b/src/charset.h
index d5c41ec6f49..7453192bb9c 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -171,23 +171,23 @@ struct charset
171 unsigned char *code_space_mask; 171 unsigned char *code_space_mask;
172 172
173 /* True if there's no gap in code-points. */ 173 /* True if there's no gap in code-points. */
174 unsigned code_linear_p : 1; 174 bool_bf code_linear_p : 1;
175 175
176 /* True if the charset is treated as 96 chars in ISO-2022 176 /* True if the charset is treated as 96 chars in ISO-2022
177 as opposed to 94 chars. */ 177 as opposed to 94 chars. */
178 unsigned iso_chars_96 : 1; 178 bool_bf iso_chars_96 : 1;
179 179
180 /* True if the charset is compatible with ASCII. */ 180 /* True if the charset is compatible with ASCII. */
181 unsigned ascii_compatible_p : 1; 181 bool_bf ascii_compatible_p : 1;
182 182
183 /* True if the charset is supplementary. */ 183 /* True if the charset is supplementary. */
184 unsigned supplementary_p : 1; 184 bool_bf supplementary_p : 1;
185 185
186 /* True if all the code points are representable by Lisp_Int. */ 186 /* True if all the code points are representable by Lisp_Int. */
187 unsigned compact_codes_p : 1; 187 bool_bf compact_codes_p : 1;
188 188
189 /* True if the charset is unified with Unicode. */ 189 /* True if the charset is unified with Unicode. */
190 unsigned unified_p : 1; 190 bool_bf unified_p : 1;
191 191
192 /* ISO final byte of the charset: 48..127. It may be -1 if the 192 /* ISO final byte of the charset: 48..127. It may be -1 if the
193 charset doesn't conform to ISO-2022. */ 193 charset doesn't conform to ISO-2022. */
@@ -344,7 +344,7 @@ set_charset_attr (struct charset *charset, enum charset_attr_index idx,
344 do { \ 344 do { \
345 if (! SYMBOLP (x) || CHARSET_SYMBOL_HASH_INDEX (x) < 0) \ 345 if (! SYMBOLP (x) || CHARSET_SYMBOL_HASH_INDEX (x) < 0) \
346 wrong_type_argument (Qcharsetp, (x)); \ 346 wrong_type_argument (Qcharsetp, (x)); \
347 } while (0) 347 } while (false)
348 348
349 349
350/* Check if X is a valid charset symbol. If valid, set ID to the id 350/* Check if X is a valid charset symbol. If valid, set ID to the id
@@ -357,7 +357,7 @@ set_charset_attr (struct charset *charset, enum charset_attr_index idx,
357 wrong_type_argument (Qcharsetp, (x)); \ 357 wrong_type_argument (Qcharsetp, (x)); \
358 id = XINT (AREF (HASH_VALUE (XHASH_TABLE (Vcharset_hash_table), idx), \ 358 id = XINT (AREF (HASH_VALUE (XHASH_TABLE (Vcharset_hash_table), idx), \
359 charset_id)); \ 359 charset_id)); \
360 } while (0) 360 } while (false)
361 361
362 362
363/* Check if X is a valid charset symbol. If valid, set ATTR to the 363/* Check if X is a valid charset symbol. If valid, set ATTR to the
@@ -366,7 +366,7 @@ set_charset_attr (struct charset *charset, enum charset_attr_index idx,
366 do { \ 366 do { \
367 if (!SYMBOLP (x) || NILP (attr = CHARSET_SYMBOL_ATTRIBUTES (x))) \ 367 if (!SYMBOLP (x) || NILP (attr = CHARSET_SYMBOL_ATTRIBUTES (x))) \
368 wrong_type_argument (Qcharsetp, (x)); \ 368 wrong_type_argument (Qcharsetp, (x)); \
369 } while (0) 369 } while (false)
370 370
371 371
372#define CHECK_CHARSET_GET_CHARSET(x, charset) \ 372#define CHECK_CHARSET_GET_CHARSET(x, charset) \
@@ -374,7 +374,7 @@ set_charset_attr (struct charset *charset, enum charset_attr_index idx,
374 int csid; \ 374 int csid; \
375 CHECK_CHARSET_GET_ID (x, csid); \ 375 CHECK_CHARSET_GET_ID (x, csid); \
376 charset = CHARSET_FROM_ID (csid); \ 376 charset = CHARSET_FROM_ID (csid); \
377 } while (0) 377 } while (false)
378 378
379 379
380/* Lookup Vcharset_ordered_list and return the first charset that 380/* Lookup Vcharset_ordered_list and return the first charset that
@@ -383,7 +383,7 @@ set_charset_attr (struct charset *charset, enum charset_attr_index idx,
383 ((c) < 0x80 ? CHARSET_FROM_ID (charset_ascii) \ 383 ((c) < 0x80 ? CHARSET_FROM_ID (charset_ascii) \
384 : char_charset ((c), Qnil, NULL)) 384 : char_charset ((c), Qnil, NULL))
385 385
386#if 0 386#if false
387/* Char-table of charset-sets. Each element is a bool vector indexed 387/* Char-table of charset-sets. Each element is a bool vector indexed
388 by a charset ID. */ 388 by a charset ID. */
389extern Lisp_Object Vchar_charset_set; 389extern Lisp_Object Vchar_charset_set;
@@ -452,7 +452,7 @@ extern Lisp_Object charset_work;
452 : encode_char (charset, c)))) 452 : encode_char (charset, c))))
453 453
454 454
455/* Set to 1 when a charset map is loaded to warn that a buffer text 455/* Set to true when a charset map is loaded to warn that a buffer text
456 and a string data may be relocated. */ 456 and a string data may be relocated. */
457extern bool charset_map_loaded; 457extern bool charset_map_loaded;
458 458
@@ -489,7 +489,7 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
489 (fast_map)[(c) >> 10] |= 1 << (((c) >> 7) & 7); \ 489 (fast_map)[(c) >> 10] |= 1 << (((c) >> 7) & 7); \
490 else \ 490 else \
491 (fast_map)[((c) >> 15) + 62] |= 1 << (((c) >> 12) & 7); \ 491 (fast_map)[((c) >> 15) + 62] |= 1 << (((c) >> 12) & 7); \
492 } while (0) 492 } while (false)
493 493
494 494
495 495
diff --git a/src/cm.h b/src/cm.h
index f3455b79569..5a1b1010a22 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -47,7 +47,7 @@ struct cm
47 char *cm_abs; /* absolute (cm) */ 47 char *cm_abs; /* absolute (cm) */
48 const char *cm_habs; /* horizontal absolute (ch) */ 48 const char *cm_habs; /* horizontal absolute (ch) */
49 const char *cm_vabs; /* vertical absolute (cv) */ 49 const char *cm_vabs; /* vertical absolute (cv) */
50#if 0 50#if false
51 const char *cm_ds; /* "don't send" string (ds) */ 51 const char *cm_ds; /* "don't send" string (ds) */
52#endif 52#endif
53 const char *cm_multiup; /* multiple up (UP) */ 53 const char *cm_multiup; /* multiple up (UP) */
@@ -57,19 +57,19 @@ struct cm
57 int cm_cols; /* number of cols on screen (co) */ 57 int cm_cols; /* number of cols on screen (co) */
58 int cm_rows; /* number of rows on screen (li) */ 58 int cm_rows; /* number of rows on screen (li) */
59 int cm_tabwidth; /* tab width (it) */ 59 int cm_tabwidth; /* tab width (it) */
60 unsigned int cm_autowrap:1; /* autowrap flag (am) */ 60 bool_bf cm_autowrap : 1; /* autowrap flag (am) */
61 unsigned int cm_magicwrap:1; /* VT-100: cursor stays in last col but 61 bool_bf cm_magicwrap : 1; /* VT-100: cursor stays in last col but
62 will cm_wrap if next char is 62 will cm_wrap if next char is
63 printing (xn) */ 63 printing (xn) */
64 unsigned int cm_usetabs:1; /* if set, use tabs */ 64 bool_bf cm_usetabs : 1; /* if set, use tabs */
65 unsigned int cm_losewrap:1; /* if reach right margin, forget cursor 65 bool_bf cm_losewrap : 1; /* if reach right margin, forget cursor
66 location */ 66 location */
67 unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */ 67 bool_bf cm_autolf : 1; /* \r performs a \r\n (rn) */
68 68
69 /* Parameterized capabilities. This needs to be a struct since 69 /* Parameterized capabilities. This needs to be a struct since
70 the costs are accessed through pointers. */ 70 the costs are accessed through pointers. */
71 71
72#if 0 72#if false
73 struct parmcap cc_abs; /* absolute (cm) */ 73 struct parmcap cc_abs; /* absolute (cm) */
74 struct parmcap cc_habs; /* horizontal absolute (ch) */ 74 struct parmcap cc_habs; /* horizontal absolute (ch) */
75 struct parmcap cc_vabs; /* vertical absolute (cv) */ 75 struct parmcap cc_vabs; /* vertical absolute (cv) */
diff --git a/src/coding.c b/src/coding.c
index 4ee55f7c8e6..03ce4828040 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5199,7 +5199,7 @@ decode_coding_ccl (struct coding_system *coding)
5199 source_charbuf[i++] = *p++; 5199 source_charbuf[i++] = *p++;
5200 5200
5201 if (p == src_end && coding->mode & CODING_MODE_LAST_BLOCK) 5201 if (p == src_end && coding->mode & CODING_MODE_LAST_BLOCK)
5202 ccl->last_block = 1; 5202 ccl->last_block = true;
5203 /* As ccl_driver calls DECODE_CHAR, buffer may be relocated. */ 5203 /* As ccl_driver calls DECODE_CHAR, buffer may be relocated. */
5204 charset_map_loaded = 0; 5204 charset_map_loaded = 0;
5205 ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf, 5205 ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf,
@@ -5259,7 +5259,7 @@ encode_coding_ccl (struct coding_system *coding)
5259 CODING_GET_INFO (coding, attrs, charset_list); 5259 CODING_GET_INFO (coding, attrs, charset_list);
5260 if (coding->consumed_char == coding->src_chars 5260 if (coding->consumed_char == coding->src_chars
5261 && coding->mode & CODING_MODE_LAST_BLOCK) 5261 && coding->mode & CODING_MODE_LAST_BLOCK)
5262 ccl->last_block = 1; 5262 ccl->last_block = true;
5263 5263
5264 do 5264 do
5265 { 5265 {
diff --git a/src/coding.h b/src/coding.h
index 39f9d62462b..299c20d0a51 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -226,7 +226,7 @@ enum coding_attr_index
226 hash_lookup (XHASH_TABLE (Vcoding_system_hash_table), \ 226 hash_lookup (XHASH_TABLE (Vcoding_system_hash_table), \
227 coding_system_symbol, NULL) 227 coding_system_symbol, NULL)
228 228
229/* Return 1 if CODING_SYSTEM_SYMBOL is a coding system. */ 229/* Return true if CODING_SYSTEM_SYMBOL is a coding system. */
230 230
231#define CODING_SYSTEM_P(coding_system_symbol) \ 231#define CODING_SYSTEM_P(coding_system_symbol) \
232 (CODING_SYSTEM_ID (coding_system_symbol) >= 0 \ 232 (CODING_SYSTEM_ID (coding_system_symbol) >= 0 \
@@ -240,7 +240,7 @@ enum coding_attr_index
240 if (CODING_SYSTEM_ID (x) < 0 \ 240 if (CODING_SYSTEM_ID (x) < 0 \
241 && NILP (Fcheck_coding_system (x))) \ 241 && NILP (Fcheck_coding_system (x))) \
242 wrong_type_argument (Qcoding_system_p, (x)); \ 242 wrong_type_argument (Qcoding_system_p, (x)); \
243 } while (0) 243 } while (false)
244 244
245 245
246/* Check if X is a coding system or not. If it is, set SEPC to the 246/* Check if X is a coding system or not. If it is, set SEPC to the
@@ -256,7 +256,7 @@ enum coding_attr_index
256 } \ 256 } \
257 if (NILP (spec)) \ 257 if (NILP (spec)) \
258 wrong_type_argument (Qcoding_system_p, (x)); \ 258 wrong_type_argument (Qcoding_system_p, (x)); \
259 } while (0) 259 } while (false)
260 260
261 261
262/* Check if X is a coding system or not. If it is, set ID to the 262/* Check if X is a coding system or not. If it is, set ID to the
@@ -273,7 +273,7 @@ enum coding_attr_index
273 } \ 273 } \
274 if (id < 0) \ 274 if (id < 0) \
275 wrong_type_argument (Qcoding_system_p, (x)); \ 275 wrong_type_argument (Qcoding_system_p, (x)); \
276 } while (0) 276 } while (false)
277 277
278 278
279/*** GENERAL section ***/ 279/*** GENERAL section ***/
@@ -361,13 +361,13 @@ struct iso_2022_spec
361 361
362 /* True temporarily only when graphic register 2 or 3 is invoked by 362 /* True temporarily only when graphic register 2 or 3 is invoked by
363 single-shift while encoding. */ 363 single-shift while encoding. */
364 unsigned single_shifting : 1; 364 bool_bf single_shifting : 1;
365 365
366 /* True temporarily only when processing at beginning of line. */ 366 /* True temporarily only when processing at beginning of line. */
367 unsigned bol : 1; 367 bool_bf bol : 1;
368 368
369 /* If true, we are now scanning embedded UTF-8 sequence. */ 369 /* If true, we are now scanning embedded UTF-8 sequence. */
370 unsigned embedded_utf_8 : 1; 370 bool_bf embedded_utf_8 : 1;
371 371
372 /* The current composition. */ 372 /* The current composition. */
373 struct composition_status cmp_status; 373 struct composition_status cmp_status;
@@ -455,11 +455,11 @@ struct coding_system
455 unsigned char *safe_charsets; 455 unsigned char *safe_charsets;
456 456
457 /* The following two members specify how binary 8-bit code 128..255 457 /* The following two members specify how binary 8-bit code 128..255
458 are represented in source and destination text respectively. 1 458 are represented in source and destination text respectively. True
459 means they are represented by 2-byte sequence, 0 means they are 459 means they are represented by 2-byte sequence, false means they are
460 represented by 1-byte as is (see the comment in character.h). */ 460 represented by 1-byte as is (see the comment in character.h). */
461 unsigned src_multibyte : 1; 461 bool_bf src_multibyte : 1;
462 unsigned dst_multibyte : 1; 462 bool_bf dst_multibyte : 1;
463 463
464 /* How may heading bytes we can skip for decoding. This is set to 464 /* How may heading bytes we can skip for decoding. This is set to
465 -1 in setup_coding_system, and updated by detect_coding. So, 465 -1 in setup_coding_system, and updated by detect_coding. So,
@@ -510,14 +510,14 @@ struct coding_system
510 510
511 /* True if the source of conversion is not in the member 511 /* True if the source of conversion is not in the member
512 `charbuf', but at `src_object'. */ 512 `charbuf', but at `src_object'. */
513 unsigned chars_at_source : 1; 513 bool_bf chars_at_source : 1;
514 514
515 /* Nonzero if the result of conversion is in `destination' 515 /* Nonzero if the result of conversion is in `destination'
516 buffer rather than in `dst_object'. */ 516 buffer rather than in `dst_object'. */
517 unsigned raw_destination : 1; 517 bool_bf raw_destination : 1;
518 518
519 /* Set to 1 if charbuf contains an annotation. */ 519 /* Set to true if charbuf contains an annotation. */
520 unsigned annotated : 1; 520 bool_bf annotated : 1;
521 521
522 unsigned char carryover[64]; 522 unsigned char carryover[64];
523 int carryover_bytes; 523 int carryover_bytes;
@@ -543,28 +543,29 @@ struct coding_system
543#define CODING_REQUIRE_DETECTION_MASK 0x1000 543#define CODING_REQUIRE_DETECTION_MASK 0x1000
544#define CODING_RESET_AT_BOL_MASK 0x2000 544#define CODING_RESET_AT_BOL_MASK 0x2000
545 545
546/* Return 1 if the coding context CODING requires annotation 546/* Return nonzero if the coding context CODING requires annotation
547 handling. */ 547 handling. */
548#define CODING_REQUIRE_ANNOTATION(coding) \ 548#define CODING_REQUIRE_ANNOTATION(coding) \
549 ((coding)->common_flags & CODING_ANNOTATION_MASK) 549 ((coding)->common_flags & CODING_ANNOTATION_MASK)
550 550
551/* Return 1 if the coding context CODING prefers decoding into unibyte. */ 551/* Return nonzero if the coding context CODING prefers decoding into
552 unibyte. */
552#define CODING_FOR_UNIBYTE(coding) \ 553#define CODING_FOR_UNIBYTE(coding) \
553 ((coding)->common_flags & CODING_FOR_UNIBYTE_MASK) 554 ((coding)->common_flags & CODING_FOR_UNIBYTE_MASK)
554 555
555/* Return 1 if the coding context CODING requires specific code to be 556/* Return nonzero if the coding context CODING requires specific code to be
556 attached at the tail of converted text. */ 557 attached at the tail of converted text. */
557#define CODING_REQUIRE_FLUSHING(coding) \ 558#define CODING_REQUIRE_FLUSHING(coding) \
558 ((coding)->common_flags & CODING_REQUIRE_FLUSHING_MASK) 559 ((coding)->common_flags & CODING_REQUIRE_FLUSHING_MASK)
559 560
560/* Return 1 if the coding context CODING requires code conversion on 561/* Return nonzero if the coding context CODING requires code conversion on
561 decoding. */ 562 decoding. */
562#define CODING_REQUIRE_DECODING(coding) \ 563#define CODING_REQUIRE_DECODING(coding) \
563 ((coding)->dst_multibyte \ 564 ((coding)->dst_multibyte \
564 || (coding)->common_flags & CODING_REQUIRE_DECODING_MASK) 565 || (coding)->common_flags & CODING_REQUIRE_DECODING_MASK)
565 566
566 567
567/* Return 1 if the coding context CODING requires code conversion on 568/* Return nonzero if the coding context CODING requires code conversion on
568 encoding. 569 encoding.
569 The non-multibyte part of the condition is to support encoding of 570 The non-multibyte part of the condition is to support encoding of
570 unibyte strings/buffers generated by string-as-unibyte or 571 unibyte strings/buffers generated by string-as-unibyte or
@@ -575,12 +576,12 @@ struct coding_system
575 || (coding)->mode & CODING_MODE_SELECTIVE_DISPLAY) 576 || (coding)->mode & CODING_MODE_SELECTIVE_DISPLAY)
576 577
577 578
578/* Return 1 if the coding context CODING requires some kind of code 579/* Return nonzero if the coding context CODING requires some kind of code
579 detection. */ 580 detection. */
580#define CODING_REQUIRE_DETECTION(coding) \ 581#define CODING_REQUIRE_DETECTION(coding) \
581 ((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK) 582 ((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK)
582 583
583/* Return 1 if the coding context CODING requires code conversion on 584/* Return nonzero if the coding context CODING requires code conversion on
584 decoding or some kind of code detection. */ 585 decoding or some kind of code detection. */
585#define CODING_MAY_REQUIRE_DECODING(coding) \ 586#define CODING_MAY_REQUIRE_DECODING(coding) \
586 (CODING_REQUIRE_DECODING (coding) \ 587 (CODING_REQUIRE_DECODING (coding) \
@@ -604,7 +605,7 @@ struct coding_system
604 (j1 = s1 * 2 - ((s1 >= 0xE0) ? 0x161 : 0xE1), \ 605 (j1 = s1 * 2 - ((s1 >= 0xE0) ? 0x161 : 0xE1), \
605 j2 = s2 - ((s2 >= 0x7F) ? 0x20 : 0x1F)); \ 606 j2 = s2 - ((s2 >= 0x7F) ? 0x20 : 0x1F)); \
606 (code) = (j1 << 8) | j2; \ 607 (code) = (j1 << 8) | j2; \
607 } while (0) 608 } while (false)
608 609
609#define SJIS_TO_JIS2(code) \ 610#define SJIS_TO_JIS2(code) \
610 do { \ 611 do { \
@@ -629,7 +630,7 @@ struct coding_system
629 j2 = s2 - ((s2 >= 0x7F ? 0x20 : 0x1F)); \ 630 j2 = s2 - ((s2 >= 0x7F ? 0x20 : 0x1F)); \
630 } \ 631 } \
631 (code) = (j1 << 8) | j2; \ 632 (code) = (j1 << 8) | j2; \
632 } while (0) 633 } while (false)
633 634
634 635
635#define JIS_TO_SJIS(code) \ 636#define JIS_TO_SJIS(code) \
@@ -644,7 +645,7 @@ struct coding_system
644 (s1 = j1 / 2 + ((j1 < 0x5F) ? 0x70 : 0xB0), \ 645 (s1 = j1 / 2 + ((j1 < 0x5F) ? 0x70 : 0xB0), \
645 s2 = j2 + 0x7E); \ 646 s2 = j2 + 0x7E); \
646 (code) = (s1 << 8) | s2; \ 647 (code) = (s1 << 8) | s2; \
647 } while (0) 648 } while (false)
648 649
649#define JIS_TO_SJIS2(code) \ 650#define JIS_TO_SJIS2(code) \
650 do { \ 651 do { \
@@ -668,7 +669,7 @@ struct coding_system
668 s2 = j2 + 0x7E; \ 669 s2 = j2 + 0x7E; \
669 } \ 670 } \
670 (code) = (s1 << 8) | s2; \ 671 (code) = (s1 << 8) | s2; \
671 } while (0) 672 } while (false)
672 673
673/* Encode the file name NAME using the specified coding system 674/* Encode the file name NAME using the specified coding system
674 for file names, if any. */ 675 for file names, if any. */
@@ -682,18 +683,18 @@ struct coding_system
682 for system functions, if any. */ 683 for system functions, if any. */
683#define ENCODE_SYSTEM(str) \ 684#define ENCODE_SYSTEM(str) \
684 (! NILP (Vlocale_coding_system) \ 685 (! NILP (Vlocale_coding_system) \
685 ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ 686 ? code_convert_string_norecord (str, Vlocale_coding_system, true) \
686 : str) 687 : str)
687 688
688/* Decode the string STR using the specified coding system 689/* Decode the string STR using the specified coding system
689 for system functions, if any. */ 690 for system functions, if any. */
690#define DECODE_SYSTEM(str) \ 691#define DECODE_SYSTEM(str) \
691 (! NILP (Vlocale_coding_system) \ 692 (! NILP (Vlocale_coding_system) \
692 ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ 693 ? code_convert_string_norecord (str, Vlocale_coding_system, false) \
693 : str) 694 : str)
694 695
695/* Note that this encodes utf-8, not utf-8-emacs, so it's not a no-op. */ 696/* Note that this encodes utf-8, not utf-8-emacs, so it's not a no-op. */
696#define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1) 697#define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, true)
697 698
698/* Extern declarations. */ 699/* Extern declarations. */
699extern Lisp_Object code_conversion_save (bool, bool); 700extern Lisp_Object code_conversion_save (bool, bool);
@@ -759,7 +760,7 @@ extern Lisp_Object from_unicode_buffer (const wchar_t* wstr);
759 (coding)->src_chars = (coding)->src_bytes = (bytes); \ 760 (coding)->src_chars = (coding)->src_bytes = (bytes); \
760 decode_coding_object ((coding), Qnil, 0, 0, (bytes), (bytes), \ 761 decode_coding_object ((coding), Qnil, 0, 0, (bytes), (bytes), \
761 (dst_object)); \ 762 (dst_object)); \
762 } while (0) 763 } while (false)
763 764
764 765
765extern Lisp_Object preferred_coding_system (void); 766extern Lisp_Object preferred_coding_system (void);
diff --git a/src/composite.h b/src/composite.h
index 9026d03f7b6..ff48d15eb0c 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -112,7 +112,7 @@ composition_registered_p (Lisp_Object prop)
112 gref = (rule_code) / 12; \ 112 gref = (rule_code) / 12; \
113 if (gref > 12) gref = 11; \ 113 if (gref > 12) gref = 11; \
114 nref = (rule_code) % 12; \ 114 nref = (rule_code) % 12; \
115 } while (0) 115 } while (false)
116 116
117/* Like COMPOSITION_DECODE_REFS (RULE_CODE, GREF, NREF), but also 117/* Like COMPOSITION_DECODE_REFS (RULE_CODE, GREF, NREF), but also
118 decode RULE_CODE into XOFF and YOFF (vertical offset). */ 118 decode RULE_CODE into XOFF and YOFF (vertical offset). */
@@ -122,7 +122,7 @@ composition_registered_p (Lisp_Object prop)
122 xoff = (rule_code) >> 16; \ 122 xoff = (rule_code) >> 16; \
123 yoff = ((rule_code) >> 8) & 0xFF; \ 123 yoff = ((rule_code) >> 8) & 0xFF; \
124 COMPOSITION_DECODE_REFS (rule_code, gref, nref); \ 124 COMPOSITION_DECODE_REFS (rule_code, gref, nref); \
125 } while (0) 125 } while (false)
126 126
127/* Nonzero if the global reference point GREF and new reference point NREF are 127/* Nonzero if the global reference point GREF and new reference point NREF are
128 valid. */ 128 valid. */
diff --git a/src/conf_post.h b/src/conf_post.h
index 2d967c0fefc..5e738e4d6b0 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -32,6 +32,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32# include config_opsysfile 32# include config_opsysfile
33#endif 33#endif
34 34
35#include <stdbool.h>
36
37/* The pre-C99 <stdbool.h> emulation doesn't work for bool bitfields. */
38#if __STDC_VERSION__ < 199901
39typedef unsigned int bool_bf;
40#else
41typedef bool bool_bf;
42#endif
43
35#ifndef WINDOWSNT 44#ifndef WINDOWSNT
36/* On AIX 3 this must be included before any other include file. */ 45/* On AIX 3 this must be included before any other include file. */
37#include <alloca.h> 46#include <alloca.h>
@@ -41,7 +50,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41#endif 50#endif
42 51
43#ifndef __has_attribute 52#ifndef __has_attribute
44# define __has_attribute(a) 0 /* non-clang */ 53# define __has_attribute(a) false /* non-clang */
45#endif 54#endif
46 55
47#ifdef DARWIN_OS 56#ifdef DARWIN_OS
diff --git a/src/dispextern.h b/src/dispextern.h
index 97847e04686..ded11e58dfb 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -139,9 +139,9 @@ enum window_part
139/* Macros to include code only if GLYPH_DEBUG is defined. */ 139/* Macros to include code only if GLYPH_DEBUG is defined. */
140 140
141#ifdef GLYPH_DEBUG 141#ifdef GLYPH_DEBUG
142#define IF_DEBUG(X) X 142#define IF_DEBUG(X) (X)
143#else 143#else
144#define IF_DEBUG(X) (void) 0 144#define IF_DEBUG(X) ((void) 0)
145#endif 145#endif
146 146
147/* Macro for displaying traces of redisplay. If Emacs was compiled 147/* Macro for displaying traces of redisplay. If Emacs was compiled
@@ -150,18 +150,18 @@ enum window_part
150 150
151#ifdef GLYPH_DEBUG 151#ifdef GLYPH_DEBUG
152 152
153extern int trace_redisplay_p EXTERNALLY_VISIBLE; 153extern bool trace_redisplay_p EXTERNALLY_VISIBLE;
154#include <stdio.h> 154#include <stdio.h>
155 155
156#define TRACE(X) \ 156#define TRACE(X) \
157 do { \
157 if (trace_redisplay_p) \ 158 if (trace_redisplay_p) \
158 fprintf X; \ 159 fprintf X; \
159 else \ 160 } while (false)
160 (void) 0
161 161
162#else /* not GLYPH_DEBUG */ 162#else /* not GLYPH_DEBUG */
163 163
164#define TRACE(X) (void) 0 164#define TRACE(X) ((void) 0)
165 165
166#endif /* GLYPH_DEBUG */ 166#endif /* GLYPH_DEBUG */
167 167
@@ -205,7 +205,7 @@ struct text_pos
205 else \ 205 else \
206 ++(POS).bytepos; \ 206 ++(POS).bytepos; \
207 } \ 207 } \
208 while (0) 208 while (false)
209 209
210/* Decrement text position POS. */ 210/* Decrement text position POS. */
211 211
@@ -218,7 +218,7 @@ struct text_pos
218 else \ 218 else \
219 --(POS).bytepos; \ 219 --(POS).bytepos; \
220 } \ 220 } \
221 while (0) 221 while (false)
222 222
223/* Set text position POS from marker MARKER. */ 223/* Set text position POS from marker MARKER. */
224 224
@@ -323,7 +323,7 @@ GLYPH_CODE_FACE (Lisp_Object gc)
323 SET_GLYPH (glyph, (XINT (gc) & ((1 << CHARACTERBITS)-1)), \ 323 SET_GLYPH (glyph, (XINT (gc) & ((1 << CHARACTERBITS)-1)), \
324 (XINT (gc) >> CHARACTERBITS)); \ 324 (XINT (gc) >> CHARACTERBITS)); \
325 } \ 325 } \
326 while (0) 326 while (false)
327 327
328/* The ID of the mode line highlighting face. */ 328/* The ID of the mode line highlighting face. */
329enum { GLYPH_MODE_LINE_FACE = 1 }; 329enum { GLYPH_MODE_LINE_FACE = 1 };
@@ -408,41 +408,41 @@ struct glyph
408 should be an enumerator of type enum glyph_type. */ 408 should be an enumerator of type enum glyph_type. */
409 unsigned type : 3; 409 unsigned type : 3;
410 410
411 /* 1 means this glyph was produced from multibyte text. Zero 411 /* True means this glyph was produced from multibyte text. False
412 means it was produced from unibyte text, i.e. charsets aren't 412 means it was produced from unibyte text, i.e. charsets aren't
413 applicable, and encoding is not performed. */ 413 applicable, and encoding is not performed. */
414 unsigned multibyte_p : 1; 414 bool_bf multibyte_p : 1;
415 415
416 /* Non-zero means draw a box line at the left or right side of this 416 /* True means draw a box line at the left or right side of this
417 glyph. This is part of the implementation of the face attribute 417 glyph. This is part of the implementation of the face attribute
418 `:box'. */ 418 `:box'. */
419 unsigned left_box_line_p : 1; 419 bool_bf left_box_line_p : 1;
420 unsigned right_box_line_p : 1; 420 bool_bf right_box_line_p : 1;
421 421
422 /* Non-zero means this glyph's physical ascent or descent is greater 422 /* True means this glyph's physical ascent or descent is greater
423 than its logical ascent/descent, i.e. it may potentially overlap 423 than its logical ascent/descent, i.e. it may potentially overlap
424 glyphs above or below it. */ 424 glyphs above or below it. */
425 unsigned overlaps_vertically_p : 1; 425 bool_bf overlaps_vertically_p : 1;
426 426
427 /* For terminal frames, 1 means glyph is a padding glyph. Padding 427 /* For terminal frames, true means glyph is a padding glyph. Padding
428 glyphs are used for characters whose visual shape consists of 428 glyphs are used for characters whose visual shape consists of
429 more than one glyph (e.g. Asian characters). All but the first 429 more than one glyph (e.g. Asian characters). All but the first
430 glyph of such a glyph sequence have the padding_p flag set. This 430 glyph of such a glyph sequence have the padding_p flag set. This
431 flag is used only to minimize code changes. A better way would 431 flag is used only to minimize code changes. A better way would
432 probably be to use the width field of glyphs to express padding. 432 probably be to use the width field of glyphs to express padding.
433 433
434 For graphic frames, 1 means the pixel width of the glyph in a 434 For graphic frames, true means the pixel width of the glyph in a
435 font is 0, but 1-pixel is padded on displaying for correct cursor 435 font is 0, but 1-pixel is padded on displaying for correct cursor
436 displaying. The member `pixel_width' above is set to 1. */ 436 displaying. The member `pixel_width' above is set to 1. */
437 unsigned padding_p : 1; 437 bool_bf padding_p : 1;
438 438
439 /* 1 means the actual glyph is not available, draw using `struct 439 /* True means the actual glyph is not available, draw using `struct
440 glyphless' below instead. This can happen when a font couldn't 440 glyphless' below instead. This can happen when a font couldn't
441 be loaded, or a character doesn't have a glyph in a font. */ 441 be loaded, or a character doesn't have a glyph in a font. */
442 unsigned glyph_not_available_p : 1; 442 bool_bf glyph_not_available_p : 1;
443 443
444 /* Non-zero means don't display cursor here. */ 444 /* True means don't display cursor here. */
445 unsigned avoid_cursor_p : 1; 445 bool_bf avoid_cursor_p : 1;
446 446
447 /* Resolved bidirectional level of this character [0..63]. */ 447 /* Resolved bidirectional level of this character [0..63]. */
448 unsigned resolved_level : 5; 448 unsigned resolved_level : 5;
@@ -491,7 +491,7 @@ struct glyph
491 struct 491 struct
492 { 492 {
493 /* Flag to tell if the composition is automatic or not. */ 493 /* Flag to tell if the composition is automatic or not. */
494 unsigned automatic : 1; 494 bool_bf automatic : 1;
495 /* ID of the composition. */ 495 /* ID of the composition. */
496 unsigned id : 31; 496 unsigned id : 31;
497 } cmp; 497 } cmp;
@@ -515,8 +515,8 @@ struct glyph
515 { 515 {
516 /* Value is an enum of the type glyphless_display_method. */ 516 /* Value is an enum of the type glyphless_display_method. */
517 unsigned method : 2; 517 unsigned method : 2;
518 /* 1 iff this glyph is for a character of no font. */ 518 /* True iff this glyph is for a character of no font. */
519 unsigned for_no_font : 1; 519 bool_bf for_no_font : 1;
520 /* Length of acronym or hexadecimal code string (at most 8). */ 520 /* Length of acronym or hexadecimal code string (at most 8). */
521 unsigned len : 4; 521 unsigned len : 4;
522 /* Character to display. Actually we need only 22 bits. */ 522 /* Character to display. Actually we need only 22 bits. */
@@ -584,7 +584,7 @@ struct glyph
584 (GLYPH).face_id = (FACE_ID); \ 584 (GLYPH).face_id = (FACE_ID); \
585 (GLYPH).padding_p = (PADDING_P); \ 585 (GLYPH).padding_p = (PADDING_P); \
586 } \ 586 } \
587 while (0) 587 while (false)
588 588
589/* Fill a character type glyph GLYPH from a glyph typedef FROM as 589/* Fill a character type glyph GLYPH from a glyph typedef FROM as
590 defined in lisp.h. */ 590 defined in lisp.h. */
@@ -593,7 +593,7 @@ struct glyph
593 SET_CHAR_GLYPH ((GLYPH), \ 593 SET_CHAR_GLYPH ((GLYPH), \
594 GLYPH_CHAR ((FROM)), \ 594 GLYPH_CHAR ((FROM)), \
595 GLYPH_FACE ((FROM)), \ 595 GLYPH_FACE ((FROM)), \
596 0) 596 false)
597 597
598/* Construct a glyph code from a character glyph GLYPH. If the 598/* Construct a glyph code from a character glyph GLYPH. If the
599 character is multibyte, return -1 as we can't use glyph table for a 599 character is multibyte, return -1 as we can't use glyph table for a
@@ -607,7 +607,7 @@ struct glyph
607 else \ 607 else \
608 SET_GLYPH ((G), -1, 0); \ 608 SET_GLYPH ((G), -1, 0); \
609 } \ 609 } \
610 while (0) 610 while (false)
611 611
612#define GLYPH_INVALID_P(GLYPH) (GLYPH_CHAR (GLYPH) < 0) 612#define GLYPH_INVALID_P(GLYPH) (GLYPH_CHAR (GLYPH) < 0)
613 613
@@ -722,11 +722,11 @@ struct glyph_matrix
722 /* Flag indicating that scrolling should not be tried in 722 /* Flag indicating that scrolling should not be tried in
723 update_window. This flag is set by functions like try_window_id 723 update_window. This flag is set by functions like try_window_id
724 which do their own scrolling. */ 724 which do their own scrolling. */
725 unsigned no_scrolling_p : 1; 725 bool_bf no_scrolling_p : 1;
726 726
727 /* Non-zero means window displayed in this matrix has a header 727 /* True means window displayed in this matrix has a header
728 line. */ 728 line. */
729 unsigned header_line_p : 1; 729 bool_bf header_line_p : 1;
730 730
731#ifdef GLYPH_DEBUG 731#ifdef GLYPH_DEBUG
732 /* A string identifying the method used to display the matrix. */ 732 /* A string identifying the method used to display the matrix. */
@@ -750,7 +750,7 @@ struct glyph_matrix
750void check_matrix_pointer_lossage (struct glyph_matrix *); 750void check_matrix_pointer_lossage (struct glyph_matrix *);
751#define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX)) 751#define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX))
752#else 752#else
753#define CHECK_MATRIX(MATRIX) (void) 0 753#define CHECK_MATRIX(MATRIX) ((void) 0)
754#endif 754#endif
755 755
756 756
@@ -916,107 +916,107 @@ struct glyph_row
916 /* Vertical offset of the right fringe bitmap. */ 916 /* Vertical offset of the right fringe bitmap. */
917 signed right_fringe_offset : FRINGE_HEIGHT_BITS; 917 signed right_fringe_offset : FRINGE_HEIGHT_BITS;
918 918
919 /* 1 means that at least one of the left and right fringe bitmaps is 919 /* True means that at least one of the left and right fringe bitmaps is
920 periodic and thus depends on the y-position of the row. */ 920 periodic and thus depends on the y-position of the row. */
921 unsigned fringe_bitmap_periodic_p : 1; 921 bool_bf fringe_bitmap_periodic_p : 1;
922 922
923 /* 1 means that we must draw the bitmaps of this row. */ 923 /* True means that we must draw the bitmaps of this row. */
924 unsigned redraw_fringe_bitmaps_p : 1; 924 bool_bf redraw_fringe_bitmaps_p : 1;
925 925
926 /* In a desired matrix, 1 means that this row must be updated. In a 926 /* In a desired matrix, true means that this row must be updated. In a
927 current matrix, 0 means that the row has been invalidated, i.e. 927 current matrix, false means that the row has been invalidated, i.e.
928 the row's contents do not agree with what is visible on the 928 the row's contents do not agree with what is visible on the
929 screen. */ 929 screen. */
930 unsigned enabled_p : 1; 930 bool_bf enabled_p : 1;
931 931
932 /* 1 means row displays a text line that is truncated on the left or 932 /* True means row displays a text line that is truncated on the left or
933 right side. */ 933 right side. */
934 unsigned truncated_on_left_p : 1; 934 bool_bf truncated_on_left_p : 1;
935 unsigned truncated_on_right_p : 1; 935 bool_bf truncated_on_right_p : 1;
936 936
937 /* 1 means that this row displays a continued line, i.e. it has a 937 /* True means that this row displays a continued line, i.e. it has a
938 continuation mark at the right side. */ 938 continuation mark at the right side. */
939 unsigned continued_p : 1; 939 bool_bf continued_p : 1;
940 940
941 /* 0 means that this row does not contain any text, i.e. it is 941 /* False means that this row does not contain any text, i.e., it is
942 a blank line at the window and buffer end. */ 942 a blank line at the window and buffer end. */
943 unsigned displays_text_p : 1; 943 bool_bf displays_text_p : 1;
944 944
945 /* 1 means that this line ends at ZV. */ 945 /* True means that this line ends at ZV. */
946 unsigned ends_at_zv_p : 1; 946 bool_bf ends_at_zv_p : 1;
947 947
948 /* 1 means the face of the last glyph in the text area is drawn to 948 /* True means the face of the last glyph in the text area is drawn to
949 the right end of the window. This flag is used in 949 the right end of the window. This flag is used in
950 update_text_area to optimize clearing to the end of the area. */ 950 update_text_area to optimize clearing to the end of the area. */
951 unsigned fill_line_p : 1; 951 bool_bf fill_line_p : 1;
952 952
953 /* Non-zero means display a bitmap on X frames indicating that this 953 /* True means display a bitmap on X frames indicating that this
954 line contains no text and ends in ZV. */ 954 line contains no text and ends in ZV. */
955 unsigned indicate_empty_line_p : 1; 955 bool_bf indicate_empty_line_p : 1;
956 956
957 /* 1 means this row contains glyphs that overlap each other because 957 /* True means this row contains glyphs that overlap each other because
958 of lbearing or rbearing. */ 958 of lbearing or rbearing. */
959 unsigned contains_overlapping_glyphs_p : 1; 959 bool_bf contains_overlapping_glyphs_p : 1;
960 960
961 /* 1 means this row is as wide as the window it is displayed in, including 961 /* True means this row is as wide as the window it is displayed in, including
962 scroll bars, fringes, and internal borders. This also 962 scroll bars, fringes, and internal borders. This also
963 implies that the row doesn't have marginal areas. */ 963 implies that the row doesn't have marginal areas. */
964 unsigned full_width_p : 1; 964 bool_bf full_width_p : 1;
965 965
966 /* Non-zero means row is a mode or header-line. */ 966 /* True means row is a mode or header-line. */
967 unsigned mode_line_p : 1; 967 bool_bf mode_line_p : 1;
968 968
969 /* 1 in a current row means this row is overlapped by another row. */ 969 /* True in a current row means this row is overlapped by another row. */
970 unsigned overlapped_p : 1; 970 bool_bf overlapped_p : 1;
971 971
972 /* 1 means this line ends in the middle of a character consisting 972 /* True means this line ends in the middle of a character consisting
973 of more than one glyph. Some glyphs have been put in this row, 973 of more than one glyph. Some glyphs have been put in this row,
974 the rest are put in rows below this one. */ 974 the rest are put in rows below this one. */
975 unsigned ends_in_middle_of_char_p : 1; 975 bool_bf ends_in_middle_of_char_p : 1;
976 976
977 /* 1 means this line starts in the middle of a character consisting 977 /* True means this line starts in the middle of a character consisting
978 of more than one glyph. Some glyphs have been put in the 978 of more than one glyph. Some glyphs have been put in the
979 previous row, the rest are put in this row. */ 979 previous row, the rest are put in this row. */
980 unsigned starts_in_middle_of_char_p : 1; 980 bool_bf starts_in_middle_of_char_p : 1;
981 981
982 /* 1 in a current row means this row overlaps others. */ 982 /* True in a current row means this row overlaps others. */
983 unsigned overlapping_p : 1; 983 bool_bf overlapping_p : 1;
984 984
985 /* 1 means some glyphs in this row are displayed in mouse-face. */ 985 /* True means some glyphs in this row are displayed in mouse-face. */
986 unsigned mouse_face_p : 1; 986 bool_bf mouse_face_p : 1;
987 987
988 /* 1 means this row was ended by a newline from a string. */ 988 /* True means this row was ended by a newline from a string. */
989 unsigned ends_in_newline_from_string_p : 1; 989 bool_bf ends_in_newline_from_string_p : 1;
990 990
991 /* 1 means this row width is exactly the width of the window, and the 991 /* True means this row width is exactly the width of the window, and the
992 final newline character is hidden in the right fringe. */ 992 final newline character is hidden in the right fringe. */
993 unsigned exact_window_width_line_p : 1; 993 bool_bf exact_window_width_line_p : 1;
994 994
995 /* 1 means this row currently shows the cursor in the right fringe. */ 995 /* True means this row currently shows the cursor in the right fringe. */
996 unsigned cursor_in_fringe_p : 1; 996 bool_bf cursor_in_fringe_p : 1;
997 997
998 /* 1 means the last glyph in the row is part of an ellipsis. */ 998 /* True means the last glyph in the row is part of an ellipsis. */
999 unsigned ends_in_ellipsis_p : 1; 999 bool_bf ends_in_ellipsis_p : 1;
1000 1000
1001 /* Non-zero means display a bitmap on X frames indicating that this 1001 /* True means display a bitmap on X frames indicating that this
1002 the first line of the buffer. */ 1002 the first line of the buffer. */
1003 unsigned indicate_bob_p : 1; 1003 bool_bf indicate_bob_p : 1;
1004 1004
1005 /* Non-zero means display a bitmap on X frames indicating that this 1005 /* True means display a bitmap on X frames indicating that this
1006 the top line of the window, but not start of the buffer. */ 1006 the top line of the window, but not start of the buffer. */
1007 unsigned indicate_top_line_p : 1; 1007 bool_bf indicate_top_line_p : 1;
1008 1008
1009 /* Non-zero means display a bitmap on X frames indicating that this 1009 /* True means display a bitmap on X frames indicating that this
1010 the last line of the buffer. */ 1010 the last line of the buffer. */
1011 unsigned indicate_eob_p : 1; 1011 bool_bf indicate_eob_p : 1;
1012 1012
1013 /* Non-zero means display a bitmap on X frames indicating that this 1013 /* True means display a bitmap on X frames indicating that this
1014 the bottom line of the window, but not end of the buffer. */ 1014 the bottom line of the window, but not end of the buffer. */
1015 unsigned indicate_bottom_line_p : 1; 1015 bool_bf indicate_bottom_line_p : 1;
1016 1016
1017 /* Non-zero means the row was reversed to display text in a 1017 /* True means the row was reversed to display text in a
1018 right-to-left paragraph. */ 1018 right-to-left paragraph. */
1019 unsigned reversed_p : 1; 1019 bool_bf reversed_p : 1;
1020 1020
1021 /* Continuation lines width at the start of the row. */ 1021 /* Continuation lines width at the start of the row. */
1022 int continuation_lines_width; 1022 int continuation_lines_width;
@@ -1107,10 +1107,10 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int);
1107/* Set and query the enabled_p flag of glyph row ROW in MATRIX. */ 1107/* Set and query the enabled_p flag of glyph row ROW in MATRIX. */
1108 1108
1109#define SET_MATRIX_ROW_ENABLED_P(MATRIX, ROW, VALUE) \ 1109#define SET_MATRIX_ROW_ENABLED_P(MATRIX, ROW, VALUE) \
1110 (MATRIX_ROW ((MATRIX), (ROW))->enabled_p = (VALUE) != 0) 1110 (MATRIX_ROW (MATRIX, ROW)->enabled_p = (VALUE))
1111 1111
1112#define MATRIX_ROW_ENABLED_P(MATRIX, ROW) \ 1112#define MATRIX_ROW_ENABLED_P(MATRIX, ROW) \
1113 (MATRIX_ROW ((MATRIX), (ROW))->enabled_p) 1113 (MATRIX_ROW (MATRIX, ROW)->enabled_p)
1114 1114
1115/* Non-zero if ROW displays text. Value is non-zero if the row is 1115/* Non-zero if ROW displays text. Value is non-zero if the row is
1116 blank but displays a line end. */ 1116 blank but displays a line end. */
@@ -1188,12 +1188,12 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int);
1188 || ((ROW)->start.overlay_string_index >= 0 \ 1188 || ((ROW)->start.overlay_string_index >= 0 \
1189 && (ROW)->start.string_pos.charpos > 0)) 1189 && (ROW)->start.string_pos.charpos > 0))
1190 1190
1191/* Non-zero means ROW overlaps its predecessor. */ 1191/* True means ROW overlaps its predecessor. */
1192 1192
1193#define MATRIX_ROW_OVERLAPS_PRED_P(ROW) \ 1193#define MATRIX_ROW_OVERLAPS_PRED_P(ROW) \
1194 ((ROW)->phys_ascent > (ROW)->ascent) 1194 ((ROW)->phys_ascent > (ROW)->ascent)
1195 1195
1196/* Non-zero means ROW overlaps its successor. */ 1196/* True means ROW overlaps its successor. */
1197 1197
1198#define MATRIX_ROW_OVERLAPS_SUCC_P(ROW) \ 1198#define MATRIX_ROW_OVERLAPS_SUCC_P(ROW) \
1199 ((ROW)->phys_height - (ROW)->phys_ascent \ 1199 ((ROW)->phys_height - (ROW)->phys_ascent \
@@ -1203,8 +1203,7 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int);
1203 1203
1204extern struct glyph space_glyph; 1204extern struct glyph space_glyph;
1205 1205
1206/* Non-zero means last display completed. Zero means it was 1206/* True means last display completed. False means it was preempted. */
1207 preempted. */
1208 1207
1209extern bool display_completed; 1208extern bool display_completed;
1210 1209
@@ -1300,24 +1299,24 @@ struct glyph_string
1300 /* Start and end glyph indices in a glyph-string. */ 1299 /* Start and end glyph indices in a glyph-string. */
1301 int cmp_from, cmp_to; 1300 int cmp_from, cmp_to;
1302 1301
1303 /* 1 means this glyph strings face has to be drawn to the right end 1302 /* True means this glyph strings face has to be drawn to the right end
1304 of the window's drawing area. */ 1303 of the window's drawing area. */
1305 unsigned extends_to_end_of_line_p : 1; 1304 bool_bf extends_to_end_of_line_p : 1;
1306 1305
1307 /* 1 means the background of this string has been drawn. */ 1306 /* True means the background of this string has been drawn. */
1308 unsigned background_filled_p : 1; 1307 bool_bf background_filled_p : 1;
1309 1308
1310 /* 1 means glyph string must be drawn with 16-bit functions. */ 1309 /* True means glyph string must be drawn with 16-bit functions. */
1311 unsigned two_byte_p : 1; 1310 bool_bf two_byte_p : 1;
1312 1311
1313 /* 1 means that the original font determined for drawing this glyph 1312 /* True means that the original font determined for drawing this glyph
1314 string could not be loaded. The member `font' has been set to 1313 string could not be loaded. The member `font' has been set to
1315 the frame's default font in this case. */ 1314 the frame's default font in this case. */
1316 unsigned font_not_found_p : 1; 1315 bool_bf font_not_found_p : 1;
1317 1316
1318 /* 1 means that the face in which this glyph string is drawn has a 1317 /* True means that the face in which this glyph string is drawn has a
1319 stipple pattern. */ 1318 stipple pattern. */
1320 unsigned stippled_p : 1; 1319 bool_bf stippled_p : 1;
1321 1320
1322#define OVERLAPS_PRED (1 << 0) 1321#define OVERLAPS_PRED (1 << 0)
1323#define OVERLAPS_SUCC (1 << 1) 1322#define OVERLAPS_SUCC (1 << 1)
@@ -1332,10 +1331,10 @@ struct glyph_string
1332 respectively. */ 1331 respectively. */
1333 unsigned for_overlaps : 3; 1332 unsigned for_overlaps : 3;
1334 1333
1335 /* 1 means that all glyphs in this glyph string has the flag 1334 /* True means that all glyphs in this glyph string has the flag
1336 padding_p set, and thus must be drawn one by one to have 1-pixel 1335 padding_p set, and thus must be drawn one by one to have 1-pixel
1337 width even though the logical width in the font is zero. */ 1336 width even though the logical width in the font is zero. */
1338 unsigned padding_p : 1; 1337 bool_bf padding_p : 1;
1339 1338
1340 /* The GC to use for drawing this glyph string. */ 1339 /* The GC to use for drawing this glyph string. */
1341#if defined (HAVE_X_WINDOWS) 1340#if defined (HAVE_X_WINDOWS)
@@ -1348,7 +1347,7 @@ struct glyph_string
1348 1347
1349 /* A pointer to the first glyph in the string. This glyph 1348 /* A pointer to the first glyph in the string. This glyph
1350 corresponds to char2b[0]. Needed to draw rectangles if 1349 corresponds to char2b[0]. Needed to draw rectangles if
1351 font_not_found_p is 1. */ 1350 font_not_found_p is true. */
1352 struct glyph *first_glyph; 1351 struct glyph *first_glyph;
1353 1352
1354 /* Image, if any. */ 1353 /* Image, if any. */
@@ -1480,7 +1479,7 @@ struct glyph_string
1480 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \ 1479 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
1481 && !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)) \ 1480 && !NILP (BVAR (XBUFFER ((W)->contents), mode_line_format)) \
1482 && WINDOW_PIXEL_HEIGHT (W) > WINDOW_FRAME_LINE_HEIGHT (W)) \ 1481 && WINDOW_PIXEL_HEIGHT (W) > WINDOW_FRAME_LINE_HEIGHT (W)) \
1483 : 0) 1482 : false)
1484 1483
1485/* Value is true if window W wants a header line and is large enough 1484/* Value is true if window W wants a header line and is large enough
1486 to accommodate it. */ 1485 to accommodate it. */
@@ -1494,7 +1493,7 @@ struct glyph_string
1494 > (WINDOW_WANTS_MODELINE_P (W) \ 1493 > (WINDOW_WANTS_MODELINE_P (W) \
1495 ? (2 * WINDOW_FRAME_LINE_HEIGHT (W)) \ 1494 ? (2 * WINDOW_FRAME_LINE_HEIGHT (W)) \
1496 : WINDOW_FRAME_LINE_HEIGHT (W)))) \ 1495 : WINDOW_FRAME_LINE_HEIGHT (W)))) \
1497 : 0) 1496 : false)
1498 1497
1499/* Return proper value to be used as baseline offset of font that has 1498/* Return proper value to be used as baseline offset of font that has
1500 ASCENT and DESCENT to draw characters by the font at the vertical 1499 ASCENT and DESCENT to draw characters by the font at the vertical
@@ -1656,54 +1655,54 @@ struct face
1656 /* Style of underlining. */ 1655 /* Style of underlining. */
1657 ENUM_BF (face_underline_type) underline_type : 1; 1656 ENUM_BF (face_underline_type) underline_type : 1;
1658 1657
1659 /* If `box' above specifies a 3D type, 1 means use box_color for 1658 /* If `box' above specifies a 3D type, true means use box_color for
1660 drawing shadows. */ 1659 drawing shadows. */
1661 unsigned use_box_color_for_shadows_p : 1; 1660 bool_bf use_box_color_for_shadows_p : 1;
1662 1661
1663 /* Non-zero if text in this face should be underlined, overlined, 1662 /* Non-zero if text in this face should be underlined, overlined,
1664 strike-through or have a box drawn around it. */ 1663 strike-through or have a box drawn around it. */
1665 unsigned underline_p : 1; 1664 bool_bf underline_p : 1;
1666 unsigned overline_p : 1; 1665 bool_bf overline_p : 1;
1667 unsigned strike_through_p : 1; 1666 bool_bf strike_through_p : 1;
1668 1667
1669 /* 1 means that the colors specified for this face could not be 1668 /* True means that the colors specified for this face could not be
1670 loaded, and were replaced by default colors, so they shouldn't be 1669 loaded, and were replaced by default colors, so they shouldn't be
1671 freed. */ 1670 freed. */
1672 unsigned foreground_defaulted_p : 1; 1671 bool_bf foreground_defaulted_p : 1;
1673 unsigned background_defaulted_p : 1; 1672 bool_bf background_defaulted_p : 1;
1674 1673
1675 /* 1 means that either no color is specified for underlining or that 1674 /* True means that either no color is specified for underlining or that
1676 the specified color couldn't be loaded. Use the foreground 1675 the specified color couldn't be loaded. Use the foreground
1677 color when drawing in that case. */ 1676 color when drawing in that case. */
1678 unsigned underline_defaulted_p : 1; 1677 bool_bf underline_defaulted_p : 1;
1679 1678
1680 /* 1 means that either no color is specified for the corresponding 1679 /* True means that either no color is specified for the corresponding
1681 attribute or that the specified color couldn't be loaded. 1680 attribute or that the specified color couldn't be loaded.
1682 Use the foreground color when drawing in that case. */ 1681 Use the foreground color when drawing in that case. */
1683 unsigned overline_color_defaulted_p : 1; 1682 bool_bf overline_color_defaulted_p : 1;
1684 unsigned strike_through_color_defaulted_p : 1; 1683 bool_bf strike_through_color_defaulted_p : 1;
1685 unsigned box_color_defaulted_p : 1; 1684 bool_bf box_color_defaulted_p : 1;
1686 1685
1687 /* TTY appearances. Colors are found in `lface' with empty color 1686 /* TTY appearances. Colors are found in `lface' with empty color
1688 string meaning the default color of the TTY. */ 1687 string meaning the default color of the TTY. */
1689 unsigned tty_bold_p : 1; 1688 bool_bf tty_bold_p : 1;
1690 unsigned tty_italic_p : 1; 1689 bool_bf tty_italic_p : 1;
1691 unsigned tty_underline_p : 1; 1690 bool_bf tty_underline_p : 1;
1692 unsigned tty_reverse_p : 1; 1691 bool_bf tty_reverse_p : 1;
1693 1692
1694 /* 1 means that colors of this face may not be freed because they 1693 /* True means that colors of this face may not be freed because they
1695 have been copied bitwise from a base face (see 1694 have been copied bitwise from a base face (see
1696 realize_x_face). */ 1695 realize_x_face). */
1697 unsigned colors_copied_bitwise_p : 1; 1696 bool_bf colors_copied_bitwise_p : 1;
1698 1697
1699 /* If non-zero, use overstrike (to simulate bold-face). */ 1698 /* If non-zero, use overstrike (to simulate bold-face). */
1700 unsigned overstrike : 1; 1699 bool_bf overstrike : 1;
1701 1700
1702/* NOTE: this is not used yet, but eventually this impl should be done 1701/* NOTE: this is not used yet, but eventually this impl should be done
1703 similarly to overstrike */ 1702 similarly to overstrike */
1704#ifdef HAVE_NS 1703#ifdef HAVE_NS
1705 /* If non-zero, use geometric rotation (to simulate italic). */ 1704 /* If non-zero, use geometric rotation (to simulate italic). */
1706 unsigned synth_ital : 1; 1705 bool_bf synth_ital : 1;
1707#endif 1706#endif
1708 1707
1709 /* The hash value of this face. */ 1708 /* The hash value of this face. */
@@ -1791,7 +1790,7 @@ struct face_cache
1791 1790
1792 /* Flag indicating that attributes of the `menu' face have been 1791 /* Flag indicating that attributes of the `menu' face have been
1793 changed. */ 1792 changed. */
1794 unsigned menu_face_changed_p : 1; 1793 bool_bf menu_face_changed_p : 1;
1795}; 1794};
1796 1795
1797 1796
@@ -1799,10 +1798,10 @@ struct face_cache
1799 using X resources of FACE. */ 1798 using X resources of FACE. */
1800 1799
1801#define PREPARE_FACE_FOR_DISPLAY(F, FACE) \ 1800#define PREPARE_FACE_FOR_DISPLAY(F, FACE) \
1801 do { \
1802 if ((FACE)->gc == 0) \ 1802 if ((FACE)->gc == 0) \
1803 prepare_face_for_display ((F), (FACE)); \ 1803 prepare_face_for_display ((F), (FACE)); \
1804 else \ 1804 } while (false)
1805 (void) 0
1806 1805
1807/* Return a pointer to the face with ID on frame F, or null if such a 1806/* Return a pointer to the face with ID on frame F, or null if such a
1808 face doesn't exist. */ 1807 face doesn't exist. */
@@ -1828,7 +1827,7 @@ struct face_cache
1828 1827
1829#else /* not HAVE_WINDOW_SYSTEM */ 1828#else /* not HAVE_WINDOW_SYSTEM */
1830 1829
1831#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) 1 1830#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) true
1832#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) ((FACE)->id) 1831#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) ((FACE)->id)
1833 1832
1834#endif /* not HAVE_WINDOW_SYSTEM */ 1833#endif /* not HAVE_WINDOW_SYSTEM */
@@ -1926,9 +1925,9 @@ struct bidi_string_data {
1926 ptrdiff_t schars; /* the number of characters in the string, 1925 ptrdiff_t schars; /* the number of characters in the string,
1927 excluding the terminating null */ 1926 excluding the terminating null */
1928 ptrdiff_t bufpos; /* buffer position of lstring, or 0 if N/A */ 1927 ptrdiff_t bufpos; /* buffer position of lstring, or 0 if N/A */
1929 unsigned from_disp_str : 1; /* 1 means the string comes from a 1928 bool_bf from_disp_str : 1; /* True means the string comes from a
1930 display property */ 1929 display property */
1931 unsigned unibyte : 1; /* 1 means the string is unibyte */ 1930 bool_bf unibyte : 1; /* True means the string is unibyte */
1932}; 1931};
1933 1932
1934/* Data type for reordering bidirectional text. */ 1933/* Data type for reordering bidirectional text. */
@@ -1971,10 +1970,10 @@ struct bidi_it {
1971 struct window *w; /* the window being displayed */ 1970 struct window *w; /* the window being displayed */
1972 bidi_dir_t paragraph_dir; /* current paragraph direction */ 1971 bidi_dir_t paragraph_dir; /* current paragraph direction */
1973 ptrdiff_t separator_limit; /* where paragraph separator should end */ 1972 ptrdiff_t separator_limit; /* where paragraph separator should end */
1974 unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */ 1973 bool_bf prev_was_pdf : 1; /* if true, previous char was PDF */
1975 unsigned first_elt : 1; /* if non-zero, examine current char first */ 1974 bool_bf first_elt : 1; /* if true, examine current char first */
1976 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ 1975 bool_bf new_paragraph : 1; /* if true, we expect a new paragraph */
1977 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ 1976 bool_bf frame_window_p : 1; /* true if displaying on a GUI frame */
1978}; 1977};
1979 1978
1980/* Value is non-zero when the bidi iterator is at base paragraph 1979/* Value is non-zero when the bidi iterator is at base paragraph
@@ -2002,8 +2001,8 @@ struct draw_fringe_bitmap_params
2002 int wd, h, dh; 2001 int wd, h, dh;
2003 int x, y; 2002 int x, y;
2004 int bx, nx, by, ny; 2003 int bx, nx, by, ny;
2005 unsigned cursor_p : 1; 2004 bool_bf cursor_p : 1;
2006 unsigned overlay_p : 1; 2005 bool_bf overlay_p : 1;
2007 struct face *face; 2006 struct face *face;
2008}; 2007};
2009 2008
@@ -2238,30 +2237,30 @@ struct it
2238 /* Position at which redisplay end trigger functions should be run. */ 2237 /* Position at which redisplay end trigger functions should be run. */
2239 ptrdiff_t redisplay_end_trigger_charpos; 2238 ptrdiff_t redisplay_end_trigger_charpos;
2240 2239
2241 /* 1 means multibyte characters are enabled. */ 2240 /* True means multibyte characters are enabled. */
2242 unsigned multibyte_p : 1; 2241 bool_bf multibyte_p : 1;
2243 2242
2244 /* 1 means window has a mode line at its top. */ 2243 /* True means window has a mode line at its top. */
2245 unsigned header_line_p : 1; 2244 bool_bf header_line_p : 1;
2246 2245
2247 /* 1 means `string' is the value of a `display' property. 2246 /* True means `string' is the value of a `display' property.
2248 Don't handle some `display' properties in these strings. */ 2247 Don't handle some `display' properties in these strings. */
2249 unsigned string_from_display_prop_p : 1; 2248 bool_bf string_from_display_prop_p : 1;
2250 2249
2251 /* 1 means `string' comes from a `line-prefix' or `wrap-prefix' 2250 /* True means `string' comes from a `line-prefix' or `wrap-prefix'
2252 property. */ 2251 property. */
2253 unsigned string_from_prefix_prop_p : 1; 2252 bool_bf string_from_prefix_prop_p : 1;
2254 2253
2255 /* 1 means we are iterating an object that came from a value of a 2254 /* True means we are iterating an object that came from a value of a
2256 `display' property. */ 2255 `display' property. */
2257 unsigned from_disp_prop_p : 1; 2256 bool_bf from_disp_prop_p : 1;
2258 2257
2259 /* When METHOD == next_element_from_display_vector, 2258 /* When METHOD == next_element_from_display_vector,
2260 this is 1 if we're doing an ellipsis. Otherwise meaningless. */ 2259 this is true if we're doing an ellipsis. Otherwise meaningless. */
2261 unsigned ellipsis_p : 1; 2260 bool_bf ellipsis_p : 1;
2262 2261
2263 /* True means cursor shouldn't be displayed here. */ 2262 /* True means cursor shouldn't be displayed here. */
2264 unsigned avoid_cursor_p : 1; 2263 bool_bf avoid_cursor_p : 1;
2265 2264
2266 /* Display table in effect or null for none. */ 2265 /* Display table in effect or null for none. */
2267 struct Lisp_Char_Table *dp; 2266 struct Lisp_Char_Table *dp;
@@ -2375,13 +2374,13 @@ struct it
2375 enum glyph_row_area area; 2374 enum glyph_row_area area;
2376 enum it_method method; 2375 enum it_method method;
2377 bidi_dir_t paragraph_embedding; 2376 bidi_dir_t paragraph_embedding;
2378 unsigned multibyte_p : 1; 2377 bool_bf multibyte_p : 1;
2379 unsigned string_from_display_prop_p : 1; 2378 bool_bf string_from_display_prop_p : 1;
2380 unsigned string_from_prefix_prop_p : 1; 2379 bool_bf string_from_prefix_prop_p : 1;
2381 unsigned display_ellipsis_p : 1; 2380 bool_bf display_ellipsis_p : 1;
2382 unsigned avoid_cursor_p : 1; 2381 bool_bf avoid_cursor_p : 1;
2383 unsigned bidi_p : 1; 2382 bool_bf bidi_p : 1;
2384 unsigned from_disp_prop_p : 1; 2383 bool_bf from_disp_prop_p : 1;
2385 enum line_wrap_method line_wrap; 2384 enum line_wrap_method line_wrap;
2386 2385
2387 /* Properties from display property that are reset by another display 2386 /* Properties from display property that are reset by another display
@@ -2407,46 +2406,46 @@ struct it
2407 int face_id; 2406 int face_id;
2408 2407
2409 /* Setting of buffer-local variable selective-display-ellipsis. */ 2408 /* Setting of buffer-local variable selective-display-ellipsis. */
2410 unsigned selective_display_ellipsis_p : 1; 2409 bool_bf selective_display_ellipsis_p : 1;
2411 2410
2412 /* 1 means control characters are translated into the form `^C' 2411 /* True means control characters are translated into the form `^C'
2413 where the `^' can be replaced by a display table entry. */ 2412 where the `^' can be replaced by a display table entry. */
2414 unsigned ctl_arrow_p : 1; 2413 bool_bf ctl_arrow_p : 1;
2415 2414
2416 /* Non-zero means that the current face has a box. */ 2415 /* True means that the current face has a box. */
2417 unsigned face_box_p : 1; 2416 bool_bf face_box_p : 1;
2418 2417
2419 /* Non-null means that the current character is the first in a run 2418 /* Non-null means that the current character is the first in a run
2420 of characters with box face. */ 2419 of characters with box face. */
2421 unsigned start_of_box_run_p : 1; 2420 bool_bf start_of_box_run_p : 1;
2422 2421
2423 /* Non-zero means that the current character is the last in a run 2422 /* True means that the current character is the last in a run
2424 of characters with box face. */ 2423 of characters with box face. */
2425 unsigned end_of_box_run_p : 1; 2424 bool_bf end_of_box_run_p : 1;
2426 2425
2427 /* 1 means overlay strings at end_charpos have been processed. */ 2426 /* True means overlay strings at end_charpos have been processed. */
2428 unsigned overlay_strings_at_end_processed_p : 1; 2427 bool_bf overlay_strings_at_end_processed_p : 1;
2429 2428
2430 /* 1 means to ignore overlay strings at current pos, as they have 2429 /* True means to ignore overlay strings at current pos, as they have
2431 already been processed. */ 2430 already been processed. */
2432 unsigned ignore_overlay_strings_at_pos_p : 1; 2431 bool_bf ignore_overlay_strings_at_pos_p : 1;
2433 2432
2434 /* 1 means the actual glyph is not available in the current 2433 /* True means the actual glyph is not available in the current
2435 system. */ 2434 system. */
2436 unsigned glyph_not_available_p : 1; 2435 bool_bf glyph_not_available_p : 1;
2437 2436
2438 /* 1 means the next line in display_line continues a character 2437 /* True means the next line in display_line continues a character
2439 consisting of more than one glyph, and some glyphs of this 2438 consisting of more than one glyph, and some glyphs of this
2440 character have been put on the previous line. */ 2439 character have been put on the previous line. */
2441 unsigned starts_in_middle_of_char_p : 1; 2440 bool_bf starts_in_middle_of_char_p : 1;
2442 2441
2443 /* If 1, saved_face_id contains the id of the face in front of text 2442 /* If true, saved_face_id contains the id of the face in front of text
2444 skipped due to selective display. */ 2443 skipped due to selective display. */
2445 unsigned face_before_selective_p : 1; 2444 bool_bf face_before_selective_p : 1;
2446 2445
2447 /* If 1, adjust current glyph so it does not increase current row 2446 /* If true, adjust current glyph so it does not increase current row
2448 descent/ascent (line-height property). Reset after this glyph. */ 2447 descent/ascent (line-height property). Reset after this glyph. */
2449 unsigned constrain_row_ascent_descent_p : 1; 2448 bool_bf constrain_row_ascent_descent_p : 1;
2450 2449
2451 enum line_wrap_method line_wrap; 2450 enum line_wrap_method line_wrap;
2452 2451
@@ -2614,9 +2613,9 @@ struct it
2614 /* Face of the right fringe glyph. */ 2613 /* Face of the right fringe glyph. */
2615 unsigned right_user_fringe_face_id : FACE_ID_BITS; 2614 unsigned right_user_fringe_face_id : FACE_ID_BITS;
2616 2615
2617 /* Non-zero means we need to reorder bidirectional text for display 2616 /* True means we need to reorder bidirectional text for display
2618 in the visual order. */ 2617 in the visual order. */
2619 unsigned bidi_p : 1; 2618 bool_bf bidi_p : 1;
2620 2619
2621 /* For iterating over bidirectional text. */ 2620 /* For iterating over bidirectional text. */
2622 struct bidi_it bidi_it; 2621 struct bidi_it bidi_it;
@@ -2636,7 +2635,7 @@ struct it
2636 2635
2637#define ITERATOR_AT_END_P(IT) ((IT)->what == IT_EOB) 2636#define ITERATOR_AT_END_P(IT) ((IT)->what == IT_EOB)
2638 2637
2639/* Non-zero means IT is at the end of a line. This is the case if it 2638/* True means IT is at the end of a line. This is the case if it
2640 is either on a newline or on a carriage return and selective 2639 is either on a newline or on a carriage return and selective
2641 display hides the rest of the line. */ 2640 display hides the rest of the line. */
2642 2641
@@ -2651,19 +2650,14 @@ struct it
2651#define PRODUCE_GLYPHS(IT) \ 2650#define PRODUCE_GLYPHS(IT) \
2652 do { \ 2651 do { \
2653 if ((IT)->glyph_row != NULL && (IT)->bidi_p) \ 2652 if ((IT)->glyph_row != NULL && (IT)->bidi_p) \
2654 { \ 2653 (IT)->glyph_row->reversed_p = (IT)->bidi_it.paragraph_dir == R2L; \
2655 if ((IT)->bidi_it.paragraph_dir == R2L) \
2656 (IT)->glyph_row->reversed_p = 1; \
2657 else \
2658 (IT)->glyph_row->reversed_p = 0; \
2659 } \
2660 if (FRAME_RIF ((IT)->f) != NULL) \ 2654 if (FRAME_RIF ((IT)->f) != NULL) \
2661 FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \ 2655 FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \
2662 else \ 2656 else \
2663 produce_glyphs ((IT)); \ 2657 produce_glyphs ((IT)); \
2664 if ((IT)->glyph_row != NULL) \ 2658 if ((IT)->glyph_row != NULL) \
2665 inhibit_free_realized_faces = 1; \ 2659 inhibit_free_realized_faces = true; \
2666 } while (0) 2660 } while (false)
2667 2661
2668/* Bit-flags indicating what operation move_it_to should perform. */ 2662/* Bit-flags indicating what operation move_it_to should perform. */
2669 2663
@@ -2707,13 +2701,13 @@ typedef struct {
2707 2701
2708 /* Nonzero if part of the text currently shown in 2702 /* Nonzero if part of the text currently shown in
2709 its mouse-face is beyond the window end. */ 2703 its mouse-face is beyond the window end. */
2710 unsigned mouse_face_past_end : 1; 2704 bool_bf mouse_face_past_end : 1;
2711 2705
2712 /* Nonzero means defer mouse-motion highlighting. */ 2706 /* True means defer mouse-motion highlighting. */
2713 unsigned mouse_face_defer : 1; 2707 bool_bf mouse_face_defer : 1;
2714 2708
2715 /* Nonzero means that the mouse highlight should not be shown. */ 2709 /* True means that the mouse highlight should not be shown. */
2716 unsigned mouse_face_hidden : 1; 2710 bool_bf mouse_face_hidden : 1;
2717} Mouse_HLInfo; 2711} Mouse_HLInfo;
2718 2712
2719INLINE void 2713INLINE void
@@ -2728,9 +2722,9 @@ reset_mouse_highlight (Mouse_HLInfo *hlinfo)
2728 hlinfo->mouse_face_mouse_frame = NULL; 2722 hlinfo->mouse_face_mouse_frame = NULL;
2729 hlinfo->mouse_face_window = Qnil; 2723 hlinfo->mouse_face_window = Qnil;
2730 hlinfo->mouse_face_overlay = Qnil; 2724 hlinfo->mouse_face_overlay = Qnil;
2731 hlinfo->mouse_face_past_end = 0; 2725 hlinfo->mouse_face_past_end = false;
2732 hlinfo->mouse_face_hidden = 0; 2726 hlinfo->mouse_face_hidden = false;
2733 hlinfo->mouse_face_defer = 0; 2727 hlinfo->mouse_face_defer = false;
2734} 2728}
2735 2729
2736/*********************************************************************** 2730/***********************************************************************
@@ -2798,8 +2792,8 @@ struct redisplay_interface
2798 void (*update_window_begin_hook) (struct window *w); 2792 void (*update_window_begin_hook) (struct window *w);
2799 2793
2800 /* Function to call after window W has been updated in window-based 2794 /* Function to call after window W has been updated in window-based
2801 redisplay. CURSOR_ON_P non-zero means switch cursor on. 2795 redisplay. CURSOR_ON_P true means switch cursor on.
2802 MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W 2796 MOUSE_FACE_OVERWRITTEN_P true means that some lines in W
2803 that contained glyphs in mouse-face were overwritten, so we 2797 that contained glyphs in mouse-face were overwritten, so we
2804 have to update the mouse highlight. */ 2798 have to update the mouse highlight. */
2805 void (*update_window_end_hook) (struct window *w, bool cursor_on_p, 2799 void (*update_window_end_hook) (struct window *w, bool cursor_on_p,
@@ -2848,8 +2842,8 @@ struct redisplay_interface
2848 int width, int height); 2842 int width, int height);
2849 2843
2850/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH 2844/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
2851 at row GLYPH_ROW on window W if ON_P is 1. If ON_P is 2845 at row GLYPH_ROW on window W if ON_P is true. If ON_P is
2852 0, don't draw cursor. If ACTIVE_P is 1, system caret 2846 false, don't draw cursor. If ACTIVE_P is true, system caret
2853 should track this cursor (when applicable). */ 2847 should track this cursor (when applicable). */
2854 void (*draw_window_cursor) (struct window *w, 2848 void (*draw_window_cursor) (struct window *w,
2855 struct glyph_row *glyph_row, 2849 struct glyph_row *glyph_row,
@@ -2949,11 +2943,11 @@ struct image
2949 /* True if this image has a `transparent' background -- that is, is 2943 /* True if this image has a `transparent' background -- that is, is
2950 uses an image mask. The accessor macro for this is 2944 uses an image mask. The accessor macro for this is
2951 `IMAGE_BACKGROUND_TRANSPARENT'. */ 2945 `IMAGE_BACKGROUND_TRANSPARENT'. */
2952 unsigned background_transparent : 1; 2946 bool_bf background_transparent : 1;
2953 2947
2954 /* True if the `background' and `background_transparent' fields are 2948 /* True if the `background' and `background_transparent' fields are
2955 valid, respectively. */ 2949 valid, respectively. */
2956 unsigned background_valid : 1, background_transparent_valid : 1; 2950 bool_bf background_valid : 1, background_transparent_valid : 1;
2957 2951
2958 /* Width and height of the image. */ 2952 /* Width and height of the image. */
2959 int width, height; 2953 int width, height;
@@ -2996,8 +2990,8 @@ struct image
2996 /* Reference to the type of the image. */ 2990 /* Reference to the type of the image. */
2997 struct image_type *type; 2991 struct image_type *type;
2998 2992
2999 /* 1 means that loading the image failed. Don't try again. */ 2993 /* True means that loading the image failed. Don't try again. */
3000 unsigned load_failed_p; 2994 bool load_failed_p;
3001 2995
3002 /* A place for image types to store additional data. It is marked 2996 /* A place for image types to store additional data. It is marked
3003 during GC. */ 2997 during GC. */
@@ -3201,7 +3195,7 @@ void move_it_past_eol (struct it *);
3201void move_it_in_display_line (struct it *it, 3195void move_it_in_display_line (struct it *it,
3202 ptrdiff_t to_charpos, int to_x, 3196 ptrdiff_t to_charpos, int to_x,
3203 enum move_operation_enum op); 3197 enum move_operation_enum op);
3204int in_display_vector_p (struct it *); 3198bool in_display_vector_p (struct it *);
3205int frame_mode_line_height (struct frame *); 3199int frame_mode_line_height (struct frame *);
3206extern Lisp_Object Qtool_bar; 3200extern Lisp_Object Qtool_bar;
3207extern bool redisplaying_p; 3201extern bool redisplaying_p;
@@ -3270,7 +3264,7 @@ extern void note_mouse_highlight (struct frame *, int, int);
3270extern void x_clear_window_mouse_face (struct window *); 3264extern void x_clear_window_mouse_face (struct window *);
3271extern void cancel_mouse_face (struct frame *); 3265extern void cancel_mouse_face (struct frame *);
3272extern int clear_mouse_face (Mouse_HLInfo *); 3266extern int clear_mouse_face (Mouse_HLInfo *);
3273extern int cursor_in_mouse_face_p (struct window *w); 3267extern bool cursor_in_mouse_face_p (struct window *w);
3274extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *, 3268extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *,
3275 int, int, enum draw_glyphs_face); 3269 int, int, enum draw_glyphs_face);
3276extern void display_tty_menu_item (const char *, int, int, int, int, int); 3270extern void display_tty_menu_item (const char *, int, int, int, int, int);
diff --git a/src/dispnew.c b/src/dispnew.c
index 94929600286..967fffe469b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -561,12 +561,12 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
561 w->window_end_valid = 0; 561 w->window_end_valid = 0;
562 562
563 while (i < matrix->nrows) 563 while (i < matrix->nrows)
564 matrix->rows[i++].enabled_p = 0; 564 matrix->rows[i++].enabled_p = false;
565 } 565 }
566 else 566 else
567 { 567 {
568 for (i = 0; i < matrix->nrows; ++i) 568 for (i = 0; i < matrix->nrows; ++i)
569 matrix->rows[i].enabled_p = 0; 569 matrix->rows[i].enabled_p = false;
570 } 570 }
571 } 571 }
572 else if (matrix == w->desired_matrix) 572 else if (matrix == w->desired_matrix)
@@ -576,7 +576,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
576 had better be the case when we adjust matrices between 576 had better be the case when we adjust matrices between
577 redisplays. */ 577 redisplays. */
578 for (i = 0; i < matrix->nrows; ++i) 578 for (i = 0; i < matrix->nrows; ++i)
579 matrix->rows[i].enabled_p = 0; 579 matrix->rows[i].enabled_p = false;
580 } 580 }
581 } 581 }
582 582
@@ -684,7 +684,7 @@ clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
684 eassert (end >= 0 && end <= matrix->nrows); 684 eassert (end >= 0 && end <= matrix->nrows);
685 685
686 for (; start < end; ++start) 686 for (; start < end; ++start)
687 matrix->rows[start].enabled_p = 0; 687 matrix->rows[start].enabled_p = false;
688} 688}
689 689
690 690
@@ -864,7 +864,7 @@ blank_row (struct window *w, struct glyph_row *row, int y)
864 if (row->y + row->height > max_y) 864 if (row->y + row->height > max_y)
865 row->visible_height -= row->y + row->height - max_y; 865 row->visible_height -= row->y + row->height - max_y;
866 866
867 row->enabled_p = 1; 867 row->enabled_p = true;
868} 868}
869 869
870 870
@@ -1062,7 +1062,7 @@ prepare_desired_row (struct glyph_row *row)
1062 bool rp = row->reversed_p; 1062 bool rp = row->reversed_p;
1063 1063
1064 clear_glyph_row (row); 1064 clear_glyph_row (row);
1065 row->enabled_p = 1; 1065 row->enabled_p = true;
1066 row->reversed_p = rp; 1066 row->reversed_p = rp;
1067 } 1067 }
1068} 1068}
@@ -2416,7 +2416,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w
2416 2416
2417 /* Only when a desired row has been displayed, we want 2417 /* Only when a desired row has been displayed, we want
2418 the corresponding frame row to be updated. */ 2418 the corresponding frame row to be updated. */
2419 frame_row->enabled_p = 1; 2419 frame_row->enabled_p = true;
2420 2420
2421 /* Maybe insert a vertical border between horizontally adjacent 2421 /* Maybe insert a vertical border between horizontally adjacent
2422 windows. */ 2422 windows. */
@@ -2564,7 +2564,7 @@ make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_
2564 assign_row (current_row, desired_row); 2564 assign_row (current_row, desired_row);
2565 2565
2566 /* Enable current_row to mark it as valid. */ 2566 /* Enable current_row to mark it as valid. */
2567 current_row->enabled_p = 1; 2567 current_row->enabled_p = true;
2568 current_row->mouse_face_p = mouse_face_p; 2568 current_row->mouse_face_p = mouse_face_p;
2569 2569
2570 /* If we are called on frame matrices, perform analogous operations 2570 /* If we are called on frame matrices, perform analogous operations
@@ -2606,7 +2606,7 @@ mirror_make_current (struct window *w, int frame_row)
2606 assign_row (current_row, desired_row); 2606 assign_row (current_row, desired_row);
2607 else 2607 else
2608 swap_glyph_pointers (desired_row, current_row); 2608 swap_glyph_pointers (desired_row, current_row);
2609 current_row->enabled_p = 1; 2609 current_row->enabled_p = true;
2610 2610
2611 /* Set the Y coordinate of the mode/header line's row. 2611 /* Set the Y coordinate of the mode/header line's row.
2612 It is needed in draw_row_with_mouse_face to find the 2612 It is needed in draw_row_with_mouse_face to find the
@@ -2661,7 +2661,7 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
2661 2661
2662 /* RETAINED_P is zero for empty lines. */ 2662 /* RETAINED_P is zero for empty lines. */
2663 if (!retained_p[copy_from[i]]) 2663 if (!retained_p[copy_from[i]])
2664 new_rows[i].enabled_p = 0; 2664 new_rows[i].enabled_p = false;
2665 } 2665 }
2666 2666
2667 /* Do the same for window matrices, if MATRIX is a frame matrix. */ 2667 /* Do the same for window matrices, if MATRIX is a frame matrix. */
@@ -2796,7 +2796,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2796 2796
2797 /* If frame line is empty, window line is empty, too. */ 2797 /* If frame line is empty, window line is empty, too. */
2798 if (!retained_p[copy_from[i]]) 2798 if (!retained_p[copy_from[i]])
2799 m->rows[window_to].enabled_p = 0; 2799 m->rows[window_to].enabled_p = false;
2800 } 2800 }
2801 else if (to_inside_window_p) 2801 else if (to_inside_window_p)
2802 { 2802 {
@@ -2821,7 +2821,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2821 2821
2822 /* If frame line is empty, window line is empty, too. */ 2822 /* If frame line is empty, window line is empty, too. */
2823 if (!retained_p[copy_from[i]]) 2823 if (!retained_p[copy_from[i]])
2824 m->rows[window_to].enabled_p = 0; 2824 m->rows[window_to].enabled_p = false;
2825 } 2825 }
2826 sync_p = 1; 2826 sync_p = 1;
2827 } 2827 }
@@ -3432,7 +3432,7 @@ update_window (struct window *w, bool force_p)
3432 in the first redisplay. */ 3432 in the first redisplay. */
3433 if (MATRIX_ROW_BOTTOM_Y (row) >= yb) 3433 if (MATRIX_ROW_BOTTOM_Y (row) >= yb)
3434 for (i = vpos + 1; i < w->current_matrix->nrows - 1; ++i) 3434 for (i = vpos + 1; i < w->current_matrix->nrows - 1; ++i)
3435 MATRIX_ROW (w->current_matrix, i)->enabled_p = 0; 3435 SET_MATRIX_ROW_ENABLED_P (w->current_matrix, i, false);
3436 } 3436 }
3437 3437
3438 /* Was display preempted? */ 3438 /* Was display preempted? */
@@ -4069,14 +4069,14 @@ scrolling_window (struct window *w, bool header_line_p)
4069 && row_equal_p (c, d, 1)) 4069 && row_equal_p (c, d, 1))
4070 { 4070 {
4071 assign_row (c, d); 4071 assign_row (c, d);
4072 d->enabled_p = 0; 4072 d->enabled_p = false;
4073 } 4073 }
4074 else 4074 else
4075 break; 4075 break;
4076 } 4076 }
4077 4077
4078 /* Give up if some rows in the desired matrix are not enabled. */ 4078 /* Give up if some rows in the desired matrix are not enabled. */
4079 if (!MATRIX_ROW (desired_matrix, i)->enabled_p) 4079 if (! MATRIX_ROW_ENABLED_P (desired_matrix, i))
4080 return -1; 4080 return -1;
4081 4081
4082 first_old = first_new = i; 4082 first_old = first_new = i;
@@ -4089,7 +4089,7 @@ scrolling_window (struct window *w, bool header_line_p)
4089 { 4089 {
4090 int bottom; 4090 int bottom;
4091 4091
4092 if (!MATRIX_ROW (desired_matrix, i)->enabled_p) 4092 if (! MATRIX_ROW_ENABLED_P (desired_matrix, i))
4093 return 0; 4093 return 0;
4094 bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)); 4094 bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i));
4095 if (bottom <= yb) 4095 if (bottom <= yb)
@@ -4121,7 +4121,7 @@ scrolling_window (struct window *w, bool header_line_p)
4121 j = last_old; 4121 j = last_old;
4122 while (i - 1 > first_new 4122 while (i - 1 > first_new
4123 && j - 1 > first_old 4123 && j - 1 > first_old
4124 && MATRIX_ROW (current_matrix, j - 1)->enabled_p 4124 && MATRIX_ROW_ENABLED_P (current_matrix, j - 1)
4125 && (MATRIX_ROW (current_matrix, j - 1)->y 4125 && (MATRIX_ROW (current_matrix, j - 1)->y
4126 == MATRIX_ROW (desired_matrix, i - 1)->y) 4126 == MATRIX_ROW (desired_matrix, i - 1)->y)
4127 && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p 4127 && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p
@@ -4198,7 +4198,7 @@ scrolling_window (struct window *w, bool header_line_p)
4198 4198
4199 for (i = first_old; i < last_old; ++i) 4199 for (i = first_old; i < last_old; ++i)
4200 { 4200 {
4201 if (MATRIX_ROW (current_matrix, i)->enabled_p) 4201 if (MATRIX_ROW_ENABLED_P (current_matrix, i))
4202 { 4202 {
4203 entry = add_row_entry (MATRIX_ROW (current_matrix, i)); 4203 entry = add_row_entry (MATRIX_ROW (current_matrix, i));
4204 old_lines[i] = entry; 4204 old_lines[i] = entry;
@@ -4391,7 +4391,7 @@ scrolling_window (struct window *w, bool header_line_p)
4391 preceding for-loop, we no longer have such an overlap, 4391 preceding for-loop, we no longer have such an overlap,
4392 and thus the assigned row should always be enabled. */ 4392 and thus the assigned row should always be enabled. */
4393 eassert (to->enabled_p); 4393 eassert (to->enabled_p);
4394 from->enabled_p = 0; 4394 from->enabled_p = false;
4395 to->overlapped_p = to_overlapped_p; 4395 to->overlapped_p = to_overlapped_p;
4396 } 4396 }
4397 } 4397 }
@@ -4761,7 +4761,7 @@ update_frame_line (struct frame *f, int vpos)
4761 olen--; 4761 olen--;
4762 } 4762 }
4763 4763
4764 current_row->enabled_p = 1; 4764 current_row->enabled_p = true;
4765 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA]; 4765 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA];
4766 4766
4767 /* If desired line is empty, just clear the line. */ 4767 /* If desired line is empty, just clear the line. */
diff --git a/src/disptab.h b/src/disptab.h
index e02bab04bbc..e2e30b08d45 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -80,7 +80,7 @@ extern Lisp_Object Qdisplay_table;
80 SET_GLYPH_CHAR ((g), XINT ((base)[GLYPH_CHAR (g)])); \ 80 SET_GLYPH_CHAR ((g), XINT ((base)[GLYPH_CHAR (g)])); \
81 if (!GLYPH_CHAR_VALID_P (g)) \ 81 if (!GLYPH_CHAR_VALID_P (g)) \
82 SET_GLYPH_CHAR (g, ' '); \ 82 SET_GLYPH_CHAR (g, ' '); \
83 } while (0) 83 } while (false)
84 84
85/* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, 85/* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0,
86 return the length and the address of the character-sequence 86 return the length and the address of the character-sequence
diff --git a/src/editfns.c b/src/editfns.c
index f67b95a8e81..8568a61c13f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3636,8 +3636,8 @@ usage: (format STRING &rest OBJECTS) */)
3636 struct info 3636 struct info
3637 { 3637 {
3638 ptrdiff_t start, end; 3638 ptrdiff_t start, end;
3639 unsigned converted_to_string : 1; 3639 bool_bf converted_to_string : 1;
3640 unsigned intervals : 1; 3640 bool_bf intervals : 1;
3641 } *info = 0; 3641 } *info = 0;
3642 3642
3643 /* It should not be necessary to GCPRO ARGS, because 3643 /* It should not be necessary to GCPRO ARGS, because
@@ -4214,7 +4214,7 @@ usage: (format STRING &rest OBJECTS) */)
4214 if (buf == initial_buffer) 4214 if (buf == initial_buffer)
4215 { 4215 {
4216 buf = xmalloc (bufsize); 4216 buf = xmalloc (bufsize);
4217 sa_must_free = 1; 4217 sa_must_free = true;
4218 buf_save_value_index = SPECPDL_INDEX (); 4218 buf_save_value_index = SPECPDL_INDEX ();
4219 record_unwind_protect_ptr (xfree, buf); 4219 record_unwind_protect_ptr (xfree, buf);
4220 memcpy (buf, initial_buffer, used); 4220 memcpy (buf, initial_buffer, used);
diff --git a/src/fileio.c b/src/fileio.c
index dba4dfdac98..02bde865644 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2114,7 +2114,7 @@ entries (depending on how Emacs was built). */)
2114 { 2114 {
2115 struct timespec atime = get_stat_atime (&st); 2115 struct timespec atime = get_stat_atime (&st);
2116 struct timespec mtime = get_stat_mtime (&st); 2116 struct timespec mtime = get_stat_mtime (&st);
2117 if (set_file_times (ofd, SSDATA (encoded_newname), atime, mtime)) 2117 if (set_file_times (ofd, SSDATA (encoded_newname), atime, mtime) != 0)
2118 xsignal2 (Qfile_date_error, 2118 xsignal2 (Qfile_date_error,
2119 build_string ("Cannot set file date"), newname); 2119 build_string ("Cannot set file date"), newname);
2120 } 2120 }
@@ -3184,7 +3184,7 @@ Use the current time if TIMESTAMP is nil. TIMESTAMP is in the format of
3184 encoded_absname = ENCODE_FILE (absname); 3184 encoded_absname = ENCODE_FILE (absname);
3185 3185
3186 { 3186 {
3187 if (set_file_times (-1, SSDATA (encoded_absname), t, t)) 3187 if (set_file_times (-1, SSDATA (encoded_absname), t, t) != 0)
3188 { 3188 {
3189#ifdef MSDOS 3189#ifdef MSDOS
3190 /* Setting times on a directory always fails. */ 3190 /* Setting times on a directory always fails. */
diff --git a/src/font.h b/src/font.h
index 539ebeba52a..2c7456a2f29 100644
--- a/src/font.h
+++ b/src/font.h
@@ -117,7 +117,7 @@ enum font_property_index
117 font. */ 117 font. */
118 FONT_AVGWIDTH_INDEX, 118 FONT_AVGWIDTH_INDEX,
119 119
120#if 0 120#if false
121 /* The following two members are to substitute for the above 6 121 /* The following two members are to substitute for the above 6
122 members (FONT_WEIGHT_INDEX to FONT_AVGWIDTH_INDEX excluding 122 members (FONT_WEIGHT_INDEX to FONT_AVGWIDTH_INDEX excluding
123 FONT_SIZE_INDEX) if it is found that font-entities consumes too 123 FONT_SIZE_INDEX) if it is found that font-entities consumes too
@@ -201,38 +201,38 @@ enum font_property_index
201 ? (XINT (AREF ((font), FONT_WIDTH_INDEX)) >> 8) : -1) 201 ? (XINT (AREF ((font), FONT_WIDTH_INDEX)) >> 8) : -1)
202/* Return the symbolic weight value of FONT. */ 202/* Return the symbolic weight value of FONT. */
203#define FONT_WEIGHT_SYMBOLIC(font) \ 203#define FONT_WEIGHT_SYMBOLIC(font) \
204 font_style_symbolic (font, FONT_WEIGHT_INDEX, 0) 204 font_style_symbolic (font, FONT_WEIGHT_INDEX, false)
205/* Return the symbolic slant value of FONT. */ 205/* Return the symbolic slant value of FONT. */
206#define FONT_SLANT_SYMBOLIC(font) \ 206#define FONT_SLANT_SYMBOLIC(font) \
207 font_style_symbolic (font, FONT_SLANT_INDEX, 0) 207 font_style_symbolic (font, FONT_SLANT_INDEX, false)
208/* Return the symbolic width value of FONT. */ 208/* Return the symbolic width value of FONT. */
209#define FONT_WIDTH_SYMBOLIC(font) \ 209#define FONT_WIDTH_SYMBOLIC(font) \
210 font_style_symbolic (font, FONT_WIDTH_INDEX, 0) 210 font_style_symbolic (font, FONT_WIDTH_INDEX, false)
211/* Return the face-weight corresponding to the weight of FONT. */ 211/* Return the face-weight corresponding to the weight of FONT. */
212#define FONT_WEIGHT_FOR_FACE(font) \ 212#define FONT_WEIGHT_FOR_FACE(font) \
213 font_style_symbolic (font, FONT_WEIGHT_INDEX, 1) 213 font_style_symbolic (font, FONT_WEIGHT_INDEX, true)
214/* Return the face-slant corresponding to the slant of FONT. */ 214/* Return the face-slant corresponding to the slant of FONT. */
215#define FONT_SLANT_FOR_FACE(font) \ 215#define FONT_SLANT_FOR_FACE(font) \
216 font_style_symbolic (font, FONT_SLANT_INDEX, 1) 216 font_style_symbolic (font, FONT_SLANT_INDEX, true)
217/* Return the face-swidth corresponding to the slant of FONT. */ 217/* Return the face-swidth corresponding to the slant of FONT. */
218#define FONT_WIDTH_FOR_FACE(font) \ 218#define FONT_WIDTH_FOR_FACE(font) \
219 font_style_symbolic (font, FONT_WIDTH_INDEX, 1) 219 font_style_symbolic (font, FONT_WIDTH_INDEX, true)
220 220
221/* Return the numeric weight value corresponding ot the symbol NAME. */ 221/* Return the numeric weight value corresponding ot the symbol NAME. */
222#define FONT_WEIGHT_NAME_NUMERIC(name) \ 222#define FONT_WEIGHT_NAME_NUMERIC(name) \
223 (font_style_to_value (FONT_WEIGHT_INDEX, (name), 0) >> 8) 223 (font_style_to_value (FONT_WEIGHT_INDEX, (name), false) >> 8)
224/* Return the numeric slant value corresponding ot the symbol NAME. */ 224/* Return the numeric slant value corresponding ot the symbol NAME. */
225#define FONT_SLANT_NAME_NUMERIC(name) \ 225#define FONT_SLANT_NAME_NUMERIC(name) \
226 (font_style_to_value (FONT_SLANT_INDEX, (name), 0) >> 8) 226 (font_style_to_value (FONT_SLANT_INDEX, (name), false) >> 8)
227/* Return the numeric width value corresponding ot the symbol NAME. */ 227/* Return the numeric width value corresponding ot the symbol NAME. */
228#define FONT_WIDTH_NAME_NUMERIC(name) \ 228#define FONT_WIDTH_NAME_NUMERIC(name) \
229 (font_style_to_value (FONT_WIDTH_INDEX, (name), 0) >> 8) 229 (font_style_to_value (FONT_WIDTH_INDEX, (name), false) >> 8)
230 230
231/* Set the font property PROP of FONT to VAL. PROP is one of 231/* Set the font property PROP of FONT to VAL. PROP is one of
232 style-related font property index (FONT_WEIGHT/SLANT/WIDTH_INDEX). 232 style-related font property index (FONT_WEIGHT/SLANT/WIDTH_INDEX).
233 VAL (integer or symbol) is the numeric or symbolic style value. */ 233 VAL (integer or symbol) is the numeric or symbolic style value. */
234#define FONT_SET_STYLE(font, prop, val) \ 234#define FONT_SET_STYLE(font, prop, val) \
235 ASET ((font), prop, make_number (font_style_to_value (prop, val, 1))) 235 ASET ((font), prop, make_number (font_style_to_value (prop, val, true)))
236 236
237#define FONT_WIDTH(f) ((f)->max_width) 237#define FONT_WIDTH(f) ((f)->max_width)
238#define FONT_HEIGHT(f) ((f)->height) 238#define FONT_HEIGHT(f) ((f)->height)
@@ -424,19 +424,19 @@ struct font_bitmap
424 424
425/* Predicates to check various font-related objects. */ 425/* Predicates to check various font-related objects. */
426 426
427/* 1 iff X is one of font-spec, font-entity, and font-object. */ 427/* True iff X is one of font-spec, font-entity, and font-object. */
428#define FONTP(x) PSEUDOVECTORP (x, PVEC_FONT) 428#define FONTP(x) PSEUDOVECTORP (x, PVEC_FONT)
429/* 1 iff X is font-spec. */ 429/* True iff X is font-spec. */
430#define FONT_SPEC_P(x) \ 430#define FONT_SPEC_P(x) \
431 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_SPEC_MAX) 431 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_SPEC_MAX)
432/* 1 iff X is font-entity. */ 432/* True iff X is font-entity. */
433#define FONT_ENTITY_P(x) \ 433#define FONT_ENTITY_P(x) \
434 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_ENTITY_MAX) 434 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_ENTITY_MAX)
435/* 1 iff X is font-object. */ 435/* True iff X is font-object. */
436#define FONT_OBJECT_P(x) \ 436#define FONT_OBJECT_P(x) \
437 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX) 437 (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)
438 438
439/* 1 iff ENTITY can't be loaded. */ 439/* True iff ENTITY can't be loaded. */
440#define FONT_ENTITY_NOT_LOADABLE(entity) \ 440#define FONT_ENTITY_NOT_LOADABLE(entity) \
441 EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt) 441 EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt)
442 442
@@ -448,19 +448,22 @@ struct font_bitmap
448/* Check macros for various font-related objects. */ 448/* Check macros for various font-related objects. */
449 449
450#define CHECK_FONT(x) \ 450#define CHECK_FONT(x) \
451 do { if (! FONTP (x)) wrong_type_argument (Qfont, x); } while (0) 451 do { if (! FONTP (x)) wrong_type_argument (Qfont, x); } while (false)
452#define CHECK_FONT_SPEC(x) \ 452#define CHECK_FONT_SPEC(x) \
453 do { if (! FONT_SPEC_P (x)) wrong_type_argument (Qfont_spec, x); } while (0) 453 do { if (! FONT_SPEC_P (x)) wrong_type_argument (Qfont_spec, x); } \
454 while (false)
454#define CHECK_FONT_ENTITY(x) \ 455#define CHECK_FONT_ENTITY(x) \
455 do { if (! FONT_ENTITY_P (x)) wrong_type_argument (Qfont_entity, x); } while (0) 456 do { if (! FONT_ENTITY_P (x)) wrong_type_argument (Qfont_entity, x); } \
457 while (false)
456#define CHECK_FONT_OBJECT(x) \ 458#define CHECK_FONT_OBJECT(x) \
457 do { if (! FONT_OBJECT_P (x)) wrong_type_argument (Qfont_object, x); } while (0) 459 do { if (! FONT_OBJECT_P (x)) wrong_type_argument (Qfont_object, x); } \
460 while (false)
458 461
459#define CHECK_FONT_GET_OBJECT(x, font) \ 462#define CHECK_FONT_GET_OBJECT(x, font) \
460 do { \ 463 do { \
461 CHECK_FONT_OBJECT (x); \ 464 CHECK_FONT_OBJECT (x); \
462 font = XFONT_OBJECT (x); \ 465 font = XFONT_OBJECT (x); \
463 } while (0) 466 } while (false)
464 467
465#define XFONT_SPEC(p) \ 468#define XFONT_SPEC(p) \
466 (eassert (FONT_SPEC_P (p)), (struct font_spec *) XUNTAG (p, Lisp_Vectorlike)) 469 (eassert (FONT_SPEC_P (p)), (struct font_spec *) XUNTAG (p, Lisp_Vectorlike))
@@ -848,12 +851,12 @@ extern void font_deferred_log (const char *, Lisp_Object, Lisp_Object);
848 do { \ 851 do { \
849 if (! EQ (Vfont_log, Qt)) \ 852 if (! EQ (Vfont_log, Qt)) \
850 font_add_log ((ACTION), (ARG), (RESULT)); \ 853 font_add_log ((ACTION), (ARG), (RESULT)); \
851 } while (0) 854 } while (false)
852 855
853#define FONT_DEFERRED_LOG(ACTION, ARG, RESULT) \ 856#define FONT_DEFERRED_LOG(ACTION, ARG, RESULT) \
854 do { \ 857 do { \
855 if (! EQ (Vfont_log, Qt)) \ 858 if (! EQ (Vfont_log, Qt)) \
856 font_deferred_log ((ACTION), (ARG), (RESULT)); \ 859 font_deferred_log ((ACTION), (ARG), (RESULT)); \
857 } while (0) 860 } while (false)
858 861
859#endif /* not EMACS_FONT_H */ 862#endif /* not EMACS_FONT_H */
diff --git a/src/frame.h b/src/frame.h
index 0f6a674dc06..91b8ca04903 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -177,46 +177,46 @@ struct frame
177 struct glyph_matrix *desired_matrix; 177 struct glyph_matrix *desired_matrix;
178 struct glyph_matrix *current_matrix; 178 struct glyph_matrix *current_matrix;
179 179
180 /* 1 means that glyphs on this frame have been initialized so it can 180 /* True means that glyphs on this frame have been initialized so it can
181 be used for output. */ 181 be used for output. */
182 unsigned glyphs_initialized_p : 1; 182 bool_bf glyphs_initialized_p : 1;
183 183
184 /* Set to non-zero in change_frame_size when size of frame changed 184 /* Set to true in change_frame_size when size of frame changed
185 Clear the frame in clear_garbaged_frames if set. */ 185 Clear the frame in clear_garbaged_frames if set. */
186 unsigned resized_p : 1; 186 bool_bf resized_p : 1;
187 187
188 /* Set to non-zero if the default face for the frame has been 188 /* Set to true if the default face for the frame has been
189 realized. Reset to zero whenever the default face changes. 189 realized. Reset to zero whenever the default face changes.
190 Used to see the difference between a font change and face change. */ 190 Used to see the difference between a font change and face change. */
191 unsigned default_face_done_p : 1; 191 bool_bf default_face_done_p : 1;
192 192
193 /* Set to non-zero if this frame has already been hscrolled during 193 /* Set to true if this frame has already been hscrolled during
194 current redisplay. */ 194 current redisplay. */
195 unsigned already_hscrolled_p : 1; 195 bool_bf already_hscrolled_p : 1;
196 196
197 /* Set to non-zero when current redisplay has updated frame. */ 197 /* Set to true when current redisplay has updated frame. */
198 unsigned updated_p : 1; 198 bool_bf updated_p : 1;
199 199
200#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) 200#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
201 /* Set to non-zero to minimize tool-bar height even when 201 /* Set to true to minimize tool-bar height even when
202 auto-resize-tool-bar is set to grow-only. */ 202 auto-resize-tool-bar is set to grow-only. */
203 unsigned minimize_tool_bar_window_p : 1; 203 bool_bf minimize_tool_bar_window_p : 1;
204#endif 204#endif
205 205
206#if defined (USE_GTK) || defined (HAVE_NS) 206#if defined (USE_GTK) || defined (HAVE_NS)
207 /* Nonzero means using a tool bar that comes from the toolkit. */ 207 /* True means using a tool bar that comes from the toolkit. */
208 unsigned external_tool_bar : 1; 208 bool_bf external_tool_bar : 1;
209#endif 209#endif
210 210
211 /* Nonzero means that fonts have been loaded since the last glyph 211 /* True means that fonts have been loaded since the last glyph
212 matrix adjustments. */ 212 matrix adjustments. */
213 unsigned fonts_changed : 1; 213 bool_bf fonts_changed : 1;
214 214
215 /* Nonzero means that cursor type has been changed. */ 215 /* True means that cursor type has been changed. */
216 unsigned cursor_type_changed : 1; 216 bool_bf cursor_type_changed : 1;
217 217
218 /* True if it needs to be redisplayed. */ 218 /* True if it needs to be redisplayed. */
219 unsigned redisplay : 1; 219 bool_bf redisplay : 1;
220 220
221 /* Margin at the top of the frame. Used to display the tool-bar. */ 221 /* Margin at the top of the frame. Used to display the tool-bar. */
222 int tool_bar_lines; 222 int tool_bar_lines;
@@ -353,8 +353,8 @@ struct frame
353 353
354#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ 354#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
355 || defined (HAVE_NS) || defined (USE_GTK) 355 || defined (HAVE_NS) || defined (USE_GTK)
356 /* Nonzero means using a menu bar that comes from the X toolkit. */ 356 /* True means using a menu bar that comes from the X toolkit. */
357 unsigned external_menu_bar : 1; 357 bool_bf external_menu_bar : 1;
358#endif 358#endif
359 359
360 /* Next two bitfields are mutually exclusive. They might both be 360 /* Next two bitfields are mutually exclusive. They might both be
@@ -371,45 +371,45 @@ struct frame
371 updating it. */ 371 updating it. */
372 unsigned visible : 2; 372 unsigned visible : 2;
373 373
374 /* Nonzero if the frame is currently iconified. Do not 374 /* True if the frame is currently iconified. Do not
375 set this directly, use SET_FRAME_ICONIFIED instead. */ 375 set this directly, use SET_FRAME_ICONIFIED instead. */
376 unsigned iconified : 1; 376 bool_bf iconified : 1;
377 377
378 /* Nonzero if this frame should be redrawn. */ 378 /* True if this frame should be redrawn. */
379 unsigned garbaged : 1; 379 bool_bf garbaged : 1;
380 380
381 /* 0 means, if this frame has just one window, 381 /* False means, if this frame has just one window,
382 show no modeline for that window. */ 382 show no modeline for that window. */
383 unsigned wants_modeline : 1; 383 bool_bf wants_modeline : 1;
384 384
385 /* Non-0 means raise this frame to the top of the heap when selected. */ 385 /* True means raise this frame to the top of the heap when selected. */
386 unsigned auto_raise : 1; 386 bool_bf auto_raise : 1;
387 387
388 /* Non-0 means lower this frame to the bottom of the stack when left. */ 388 /* True means lower this frame to the bottom of the stack when left. */
389 unsigned auto_lower : 1; 389 bool_bf auto_lower : 1;
390 390
391 /* True if frame's root window can't be split. */ 391 /* True if frame's root window can't be split. */
392 unsigned no_split : 1; 392 bool_bf no_split : 1;
393 393
394 /* If this is set, then Emacs won't change the frame name to indicate 394 /* If this is set, then Emacs won't change the frame name to indicate
395 the current buffer, etcetera. If the user explicitly sets the frame 395 the current buffer, etcetera. If the user explicitly sets the frame
396 name, this gets set. If the user sets the name to Qnil, this is 396 name, this gets set. If the user sets the name to Qnil, this is
397 cleared. */ 397 cleared. */
398 unsigned explicit_name : 1; 398 bool_bf explicit_name : 1;
399 399
400 /* Nonzero if size of some window on this frame has changed. */ 400 /* True if size of some window on this frame has changed. */
401 unsigned window_sizes_changed : 1; 401 bool_bf window_sizes_changed : 1;
402 402
403 /* Nonzero if the mouse has moved on this display device 403 /* True if the mouse has moved on this display device
404 since the last time we checked. */ 404 since the last time we checked. */
405 unsigned mouse_moved : 1; 405 bool_bf mouse_moved : 1;
406 406
407 /* Nonzero means that the pointer is invisible. */ 407 /* True means that the pointer is invisible. */
408 unsigned pointer_invisible : 1; 408 bool_bf pointer_invisible : 1;
409 409
410 /* Nonzero means that all windows except mini-window and 410 /* True means that all windows except mini-window and
411 selected window on this frame have frozen window starts. */ 411 selected window on this frame have frozen window starts. */
412 unsigned frozen_window_starts : 1; 412 bool_bf frozen_window_starts : 1;
413 413
414 /* Nonzero if we should actually display the scroll bars on this frame. */ 414 /* Nonzero if we should actually display the scroll bars on this frame. */
415 enum vertical_scroll_bar_type vertical_scroll_bar_type; 415 enum vertical_scroll_bar_type vertical_scroll_bar_type;
@@ -606,17 +606,17 @@ default_pixels_per_inch_y (void)
606#define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap) 606#define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
607#define FRAME_X_P(f) ((f)->output_method == output_x_window) 607#define FRAME_X_P(f) ((f)->output_method == output_x_window)
608#ifndef HAVE_NTGUI 608#ifndef HAVE_NTGUI
609#define FRAME_W32_P(f) (0) 609#define FRAME_W32_P(f) false
610#else 610#else
611#define FRAME_W32_P(f) ((f)->output_method == output_w32) 611#define FRAME_W32_P(f) ((f)->output_method == output_w32)
612#endif 612#endif
613#ifndef MSDOS 613#ifndef MSDOS
614#define FRAME_MSDOS_P(f) (0) 614#define FRAME_MSDOS_P(f) false
615#else 615#else
616#define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) 616#define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
617#endif 617#endif
618#ifndef HAVE_NS 618#ifndef HAVE_NS
619#define FRAME_NS_P(f) (0) 619#define FRAME_NS_P(f) false
620#else 620#else
621#define FRAME_NS_P(f) ((f)->output_method == output_ns) 621#define FRAME_NS_P(f) ((f)->output_method == output_ns)
622#endif 622#endif
@@ -634,7 +634,7 @@ default_pixels_per_inch_y (void)
634#define FRAME_WINDOW_P(f) FRAME_NS_P(f) 634#define FRAME_WINDOW_P(f) FRAME_NS_P(f)
635#endif 635#endif
636#ifndef FRAME_WINDOW_P 636#ifndef FRAME_WINDOW_P
637#define FRAME_WINDOW_P(f) ((void) (f), 0) 637#define FRAME_WINDOW_P(f) ((void) (f), false)
638#endif 638#endif
639 639
640/* Dots per inch of the screen the frame F is on. */ 640/* Dots per inch of the screen the frame F is on. */
@@ -669,14 +669,14 @@ default_pixels_per_inch_y (void)
669 (&(F)->output_data.tty->display_info->mouse_highlight) 669 (&(F)->output_data.tty->display_info->mouse_highlight)
670#endif 670#endif
671 671
672/* Nonzero if frame F is still alive (not deleted). */ 672/* True if frame F is still alive (not deleted). */
673#define FRAME_LIVE_P(f) ((f)->terminal != 0) 673#define FRAME_LIVE_P(f) ((f)->terminal != 0)
674 674
675/* Nonzero if frame F is a minibuffer-only frame. */ 675/* True if frame F is a minibuffer-only frame. */
676#define FRAME_MINIBUF_ONLY_P(f) \ 676#define FRAME_MINIBUF_ONLY_P(f) \
677 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f)) 677 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
678 678
679/* Nonzero if frame F contains it's own minibuffer window. Frame always has 679/* True if frame F contains it's own minibuffer window. Frame always has
680 minibuffer window, but it could use minibuffer window of another frame. */ 680 minibuffer window, but it could use minibuffer window of another frame. */
681#define FRAME_HAS_MINIBUF_P(f) \ 681#define FRAME_HAS_MINIBUF_P(f) \
682 (WINDOWP (f->minibuffer_window) \ 682 (WINDOWP (f->minibuffer_window) \
@@ -714,12 +714,12 @@ default_pixels_per_inch_y (void)
714/* Pixel height of frame F's menu bar. */ 714/* Pixel height of frame F's menu bar. */
715#define FRAME_MENU_BAR_HEIGHT(f) (f)->menu_bar_height 715#define FRAME_MENU_BAR_HEIGHT(f) (f)->menu_bar_height
716 716
717/* Nonzero if this frame should display a tool bar 717/* True if this frame should display a tool bar
718 in a way that does not use any text lines. */ 718 in a way that does not use any text lines. */
719#if defined (USE_GTK) || defined (HAVE_NS) 719#if defined (USE_GTK) || defined (HAVE_NS)
720#define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar 720#define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
721#else 721#else
722#define FRAME_EXTERNAL_TOOL_BAR(f) 0 722#define FRAME_EXTERNAL_TOOL_BAR(f) false
723#endif 723#endif
724 724
725/* Number of lines of frame F used for the tool-bar. */ 725/* Number of lines of frame F used for the tool-bar. */
@@ -736,40 +736,40 @@ default_pixels_per_inch_y (void)
736#define FRAME_TOP_MARGIN_HEIGHT(F) \ 736#define FRAME_TOP_MARGIN_HEIGHT(F) \
737 (FRAME_MENU_BAR_HEIGHT (F) + FRAME_TOOL_BAR_HEIGHT (F)) 737 (FRAME_MENU_BAR_HEIGHT (F) + FRAME_TOOL_BAR_HEIGHT (F))
738 738
739/* Nonzero if this frame should display a menu bar 739/* True if this frame should display a menu bar
740 in a way that does not use any text lines. */ 740 in a way that does not use any text lines. */
741#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ 741#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
742 || defined (HAVE_NS) || defined (USE_GTK) 742 || defined (HAVE_NS) || defined (USE_GTK)
743#define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar 743#define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
744#else 744#else
745#define FRAME_EXTERNAL_MENU_BAR(f) 0 745#define FRAME_EXTERNAL_MENU_BAR(f) false
746#endif 746#endif
747#define FRAME_VISIBLE_P(f) (f)->visible 747#define FRAME_VISIBLE_P(f) (f)->visible
748 748
749/* Nonzero if frame F is currently visible but hidden. */ 749/* True if frame F is currently visible but hidden. */
750#define FRAME_OBSCURED_P(f) ((f)->visible > 1) 750#define FRAME_OBSCURED_P(f) ((f)->visible > 1)
751 751
752/* Nonzero if frame F is currently iconified. */ 752/* True if frame F is currently iconified. */
753#define FRAME_ICONIFIED_P(f) (f)->iconified 753#define FRAME_ICONIFIED_P(f) (f)->iconified
754 754
755/* Mark frame F as currently garbaged. */ 755/* Mark frame F as currently garbaged. */
756#define SET_FRAME_GARBAGED(f) \ 756#define SET_FRAME_GARBAGED(f) \
757 (frame_garbaged = true, fset_redisplay (f), f->garbaged = true) 757 (frame_garbaged = true, fset_redisplay (f), f->garbaged = true)
758 758
759/* Nonzero if frame F is currently garbaged. */ 759/* True if frame F is currently garbaged. */
760#define FRAME_GARBAGED_P(f) (f)->garbaged 760#define FRAME_GARBAGED_P(f) (f)->garbaged
761 761
762/* Nonzero means do not allow splitting this frame's window. */ 762/* True means do not allow splitting this frame's window. */
763#define FRAME_NO_SPLIT_P(f) (f)->no_split 763#define FRAME_NO_SPLIT_P(f) (f)->no_split
764 764
765/* Not really implemented. */ 765/* Not really implemented. */
766#define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline 766#define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
767 767
768/* Nonzero if all windows except selected window and mini window 768/* True if all windows except selected window and mini window
769 are frozen on frame F. */ 769 are frozen on frame F. */
770#define FRAME_WINDOWS_FROZEN(f) (f)->frozen_window_starts 770#define FRAME_WINDOWS_FROZEN(f) (f)->frozen_window_starts
771 771
772/* Nonzero if a size change has been requested for frame F 772/* True if a size change has been requested for frame F
773 but not yet really put into effect. This can be true temporarily 773 but not yet really put into effect. This can be true temporarily
774 when an X event comes in at a bad time. */ 774 when an X event comes in at a bad time. */
775#define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed 775#define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed
@@ -888,8 +888,6 @@ default_pixels_per_inch_y (void)
888#define FRAME_CURSOR_X_LIMIT(f) \ 888#define FRAME_CURSOR_X_LIMIT(f) \
889 (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) 889 (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
890 890
891/* Nonzero if frame F has scroll bars. */
892
893#define FRAME_SCROLL_BARS(f) (f->scroll_bars) 891#define FRAME_SCROLL_BARS(f) (f->scroll_bars)
894 892
895#define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars) 893#define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars)
@@ -934,7 +932,7 @@ default_pixels_per_inch_y (void)
934#define FOR_EACH_FRAME(list_var, frame_var) \ 932#define FOR_EACH_FRAME(list_var, frame_var) \
935 for ((list_var) = Vframe_list; \ 933 for ((list_var) = Vframe_list; \
936 (CONSP (list_var) \ 934 (CONSP (list_var) \
937 && (frame_var = XCAR (list_var), 1)); \ 935 && (frame_var = XCAR (list_var), true)); \
938 list_var = XCDR (list_var)) 936 list_var = XCDR (list_var))
939 937
940/* Reflect mouse movement when a complete frame update is performed. */ 938/* Reflect mouse movement when a complete frame update is performed. */
@@ -950,7 +948,7 @@ default_pixels_per_inch_y (void)
950 hlinfo->mouse_face_mouse_y); \ 948 hlinfo->mouse_face_mouse_y); \
951 unblock_input (); \ 949 unblock_input (); \
952 } \ 950 } \
953 } while (0) 951 } while (true)
954 952
955/* Set visibility of frame F. 953/* Set visibility of frame F.
956 We call redisplay_other_windows to make sure the frame gets redisplayed 954 We call redisplay_other_windows to make sure the frame gets redisplayed
@@ -978,7 +976,7 @@ extern Lisp_Object Qtty_color_mode;
978extern Lisp_Object Qterminal; 976extern Lisp_Object Qterminal;
979extern Lisp_Object Qnoelisp; 977extern Lisp_Object Qnoelisp;
980 978
981/* Nonzero means there is at least one garbaged frame. */ 979/* True means there is at least one garbaged frame. */
982extern bool frame_garbaged; 980extern bool frame_garbaged;
983 981
984extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); 982extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
diff --git a/src/fringe.c b/src/fringe.c
index db4f92d6ce4..409c444a317 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -83,7 +83,7 @@ struct fringe_bitmap
83 unsigned width : 8; 83 unsigned width : 8;
84 unsigned period : 8; 84 unsigned period : 8;
85 unsigned align : 2; 85 unsigned align : 2;
86 unsigned dynamic : 1; 86 bool_bf dynamic : 1;
87}; 87};
88 88
89 89
@@ -1664,7 +1664,7 @@ If BITMAP already exists, the existing definition is replaced. */)
1664 Fput (bitmap, Qfringe, make_number (n)); 1664 Fput (bitmap, Qfringe, make_number (n));
1665 } 1665 }
1666 1666
1667 fb.dynamic = 1; 1667 fb.dynamic = true;
1668 1668
1669 xfb = xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW); 1669 xfb = xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW);
1670 fb.bits = b = (unsigned short *) (xfb + 1); 1670 fb.bits = b = (unsigned short *) (xfb + 1);
diff --git a/src/gnutls.h b/src/gnutls.h
index 4adaad4897d..e8a50d7cd1f 100644
--- a/src/gnutls.h
+++ b/src/gnutls.h
@@ -57,19 +57,19 @@ typedef enum
57 do { \ 57 do { \
58 if ((level) <= (max)) \ 58 if ((level) <= (max)) \
59 gnutls_log_function (level, "(Emacs) " string); \ 59 gnutls_log_function (level, "(Emacs) " string); \
60 } while (0) 60 } while (false)
61 61
62#define GNUTLS_LOG2(level, max, string, extra) \ 62#define GNUTLS_LOG2(level, max, string, extra) \
63 do { \ 63 do { \
64 if ((level) <= (max)) \ 64 if ((level) <= (max)) \
65 gnutls_log_function2 (level, "(Emacs) " string, extra); \ 65 gnutls_log_function2 (level, "(Emacs) " string, extra); \
66 } while (0) 66 } while (false)
67 67
68#define GNUTLS_LOG2i(level, max, string, extra) \ 68#define GNUTLS_LOG2i(level, max, string, extra) \
69 do { \ 69 do { \
70 if ((level) <= (max)) \ 70 if ((level) <= (max)) \
71 gnutls_log_function2i (level, "(Emacs) " string, extra); \ 71 gnutls_log_function2i (level, "(Emacs) " string, extra); \
72 } while (0) 72 } while (false)
73 73
74extern ptrdiff_t 74extern ptrdiff_t
75emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte); 75emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte);
diff --git a/src/image.c b/src/image.c
index 38a92277299..e1c6e5df3cd 100644
--- a/src/image.c
+++ b/src/image.c
@@ -264,7 +264,7 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi
264 264
265#ifdef HAVE_X_WINDOWS 265#ifdef HAVE_X_WINDOWS
266 dpyinfo->bitmaps[id - 1].pixmap = bitmap; 266 dpyinfo->bitmaps[id - 1].pixmap = bitmap;
267 dpyinfo->bitmaps[id - 1].have_mask = 0; 267 dpyinfo->bitmaps[id - 1].have_mask = false;
268 dpyinfo->bitmaps[id - 1].depth = 1; 268 dpyinfo->bitmaps[id - 1].depth = 1;
269#endif /* HAVE_X_WINDOWS */ 269#endif /* HAVE_X_WINDOWS */
270 270
@@ -339,7 +339,7 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
339 339
340 id = x_allocate_bitmap_record (f); 340 id = x_allocate_bitmap_record (f);
341 dpyinfo->bitmaps[id - 1].pixmap = bitmap; 341 dpyinfo->bitmaps[id - 1].pixmap = bitmap;
342 dpyinfo->bitmaps[id - 1].have_mask = 0; 342 dpyinfo->bitmaps[id - 1].have_mask = false;
343 dpyinfo->bitmaps[id - 1].refcount = 1; 343 dpyinfo->bitmaps[id - 1].refcount = 1;
344 dpyinfo->bitmaps[id - 1].file = xlispstrdup (file); 344 dpyinfo->bitmaps[id - 1].file = xlispstrdup (file);
345 dpyinfo->bitmaps[id - 1].depth = 1; 345 dpyinfo->bitmaps[id - 1].depth = 1;
@@ -515,7 +515,7 @@ x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
515 width, height); 515 width, height);
516 XFreeGC (FRAME_X_DISPLAY (f), gc); 516 XFreeGC (FRAME_X_DISPLAY (f), gc);
517 517
518 dpyinfo->bitmaps[id - 1].have_mask = 1; 518 dpyinfo->bitmaps[id - 1].have_mask = true;
519 dpyinfo->bitmaps[id - 1].mask = mask; 519 dpyinfo->bitmaps[id - 1].mask = mask;
520 520
521 XDestroyImage (ximg); 521 XDestroyImage (ximg);
@@ -3446,7 +3446,7 @@ x_create_bitmap_from_xpm_data (struct frame *f, const char **bits)
3446 3446
3447 id = x_allocate_bitmap_record (f); 3447 id = x_allocate_bitmap_record (f);
3448 dpyinfo->bitmaps[id - 1].pixmap = bitmap; 3448 dpyinfo->bitmaps[id - 1].pixmap = bitmap;
3449 dpyinfo->bitmaps[id - 1].have_mask = 1; 3449 dpyinfo->bitmaps[id - 1].have_mask = true;
3450 dpyinfo->bitmaps[id - 1].mask = mask; 3450 dpyinfo->bitmaps[id - 1].mask = mask;
3451 dpyinfo->bitmaps[id - 1].file = NULL; 3451 dpyinfo->bitmaps[id - 1].file = NULL;
3452 dpyinfo->bitmaps[id - 1].height = attrs.height; 3452 dpyinfo->bitmaps[id - 1].height = attrs.height;
@@ -3974,7 +3974,7 @@ xpm_load_image (struct frame *f,
3974 Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int); 3974 Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int);
3975 Lisp_Object frame, color_symbols, color_table; 3975 Lisp_Object frame, color_symbols, color_table;
3976 int best_key; 3976 int best_key;
3977 bool have_mask = 0; 3977 bool have_mask = false;
3978 XImagePtr ximg = NULL, mask_img = NULL; 3978 XImagePtr ximg = NULL, mask_img = NULL;
3979 3979
3980#define match() \ 3980#define match() \
@@ -4146,7 +4146,7 @@ xpm_load_image (struct frame *f,
4146#ifndef HAVE_NS 4146#ifndef HAVE_NS
4147 XPutPixel (mask_img, x, y, 4147 XPutPixel (mask_img, x, y,
4148 (!EQ (color_val, Qt) ? PIX_MASK_DRAW 4148 (!EQ (color_val, Qt) ? PIX_MASK_DRAW
4149 : (have_mask = 1, PIX_MASK_RETAIN))); 4149 : (have_mask = true, PIX_MASK_RETAIN)));
4150#else 4150#else
4151 if (EQ (color_val, Qt)) 4151 if (EQ (color_val, Qt))
4152 ns_set_alpha (ximg, x, y, 0); 4152 ns_set_alpha (ximg, x, y, 0);
diff --git a/src/intervals.h b/src/intervals.h
index 40f32645ba0..816ea105bd7 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -42,19 +42,19 @@ struct interval
42 struct interval *interval; 42 struct interval *interval;
43 Lisp_Object obj; 43 Lisp_Object obj;
44 } up; 44 } up;
45 unsigned int up_obj : 1; 45 bool_bf up_obj : 1;
46 46
47 unsigned gcmarkbit : 1; 47 bool_bf gcmarkbit : 1;
48 48
49 /* The remaining components are `properties' of the interval. 49 /* The remaining components are `properties' of the interval.
50 The first four are duplicates for things which can be on the list, 50 The first four are duplicates for things which can be on the list,
51 for purposes of speed. */ 51 for purposes of speed. */
52 52
53 unsigned int write_protect : 1; /* Non-zero means can't modify. */ 53 bool_bf write_protect : 1; /* True means can't modify. */
54 unsigned int visible : 1; /* Zero means don't display. */ 54 bool_bf visible : 1; /* False means don't display. */
55 unsigned int front_sticky : 1; /* Non-zero means text inserted just 55 bool_bf front_sticky : 1; /* True means text inserted just
56 before this interval goes into it. */ 56 before this interval goes into it. */
57 unsigned int rear_sticky : 1; /* Likewise for just after it. */ 57 bool_bf rear_sticky : 1; /* Likewise for just after it. */
58 Lisp_Object plist; /* Other properties. */ 58 Lisp_Object plist; /* Other properties. */
59}; 59};
60 60
@@ -116,7 +116,7 @@ struct interval
116 116
117/* Test what type of parent we have. Three possibilities: another 117/* Test what type of parent we have. Three possibilities: another
118 interval, a buffer or string object, or NULL. */ 118 interval, a buffer or string object, or NULL. */
119#define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0) 119#define INTERVAL_HAS_PARENT(i) (! (i)->up_obj && (i)->up.interval != 0)
120#define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) 120#define INTERVAL_HAS_OBJECT(i) ((i)->up_obj)
121 121
122/* Use these macros to get parent of an interval. 122/* Use these macros to get parent of an interval.
@@ -126,9 +126,9 @@ struct interval
126 progress. */ 126 progress. */
127 127
128#define INTERVAL_PARENT(i) \ 128#define INTERVAL_PARENT(i) \
129 (eassert ((i) != 0 && (i)->up_obj == 0), (i)->up.interval) 129 (eassert ((i) != 0 && ! (i)->up_obj), (i)->up.interval)
130 130
131#define GET_INTERVAL_OBJECT(d,s) (eassert ((s)->up_obj == 1), (d) = (s)->up.obj) 131#define GET_INTERVAL_OBJECT(d,s) (eassert ((s)->up_obj), (d) = (s)->up.obj)
132 132
133/* Use these functions to set Lisp_Object 133/* Use these functions to set Lisp_Object
134 or pointer slots of struct interval. */ 134 or pointer slots of struct interval. */
@@ -136,7 +136,7 @@ struct interval
136INLINE void 136INLINE void
137set_interval_parent (INTERVAL i, INTERVAL parent) 137set_interval_parent (INTERVAL i, INTERVAL parent)
138{ 138{
139 i->up_obj = 0; 139 i->up_obj = false;
140 i->up.interval = parent; 140 i->up.interval = parent;
141} 141}
142 142
@@ -154,33 +154,33 @@ set_interval_plist (INTERVAL i, Lisp_Object plist)
154 154
155/* Reset this interval to its vanilla, or no-property state. */ 155/* Reset this interval to its vanilla, or no-property state. */
156#define RESET_INTERVAL(i) \ 156#define RESET_INTERVAL(i) \
157{ \ 157 do { \
158 (i)->total_length = (i)->position = 0; \ 158 (i)->total_length = (i)->position = 0; \
159 (i)->left = (i)->right = NULL; \ 159 (i)->left = (i)->right = NULL; \
160 set_interval_parent (i, NULL); \ 160 set_interval_parent (i, NULL); \
161 (i)->write_protect = 0; \ 161 (i)->write_protect = false; \
162 (i)->visible = 0; \ 162 (i)->visible = false; \
163 (i)->front_sticky = (i)->rear_sticky = 0; \ 163 (i)->front_sticky = (i)->rear_sticky = false; \
164 set_interval_plist (i, Qnil); \ 164 set_interval_plist (i, Qnil); \
165} 165 } while (false)
166 166
167/* Copy the cached property values of interval FROM to interval TO. */ 167/* Copy the cached property values of interval FROM to interval TO. */
168#define COPY_INTERVAL_CACHE(from,to) \ 168#define COPY_INTERVAL_CACHE(from,to) \
169{ \ 169 do { \
170 (to)->write_protect = (from)->write_protect; \ 170 (to)->write_protect = (from)->write_protect; \
171 (to)->visible = (from)->visible; \ 171 (to)->visible = (from)->visible; \
172 (to)->front_sticky = (from)->front_sticky; \ 172 (to)->front_sticky = (from)->front_sticky; \
173 (to)->rear_sticky = (from)->rear_sticky; \ 173 (to)->rear_sticky = (from)->rear_sticky; \
174} 174 } while (false)
175 175
176/* Copy only the set bits of FROM's cache. */ 176/* Copy only the set bits of FROM's cache. */
177#define MERGE_INTERVAL_CACHE(from,to) \ 177#define MERGE_INTERVAL_CACHE(from,to) \
178{ \ 178 do { \
179 if ((from)->write_protect) (to)->write_protect = 1; \ 179 if ((from)->write_protect) (to)->write_protect = true; \
180 if ((from)->visible) (to)->visible = 1; \ 180 if ((from)->visible) (to)->visible = true; \
181 if ((from)->front_sticky) (to)->front_sticky = 1; \ 181 if ((from)->front_sticky) (to)->front_sticky = true; \
182 if ((from)->rear_sticky) (to)->rear_sticky = 1; \ 182 if ((from)->rear_sticky) (to)->rear_sticky = true; \
183} 183 } while (false)
184 184
185/* Is this interval visible? Replace later with cache access. */ 185/* Is this interval visible? Replace later with cache access. */
186#define INTERVAL_VISIBLE_P(i) \ 186#define INTERVAL_VISIBLE_P(i) \
@@ -198,7 +198,7 @@ set_interval_plist (INTERVAL i, Lisp_Object plist)
198 should stick to it. Now we have Vtext_property_default_nonsticky, 198 should stick to it. Now we have Vtext_property_default_nonsticky,
199 so these macros are unreliable now and never used. */ 199 so these macros are unreliable now and never used. */
200 200
201#if 0 201#if false
202#define FRONT_STICKY_P(i) \ 202#define FRONT_STICKY_P(i) \
203 (i && ! NILP (textget ((i)->plist, Qfront_sticky))) 203 (i && ! NILP (textget ((i)->plist, Qfront_sticky)))
204#define END_NONSTICKY_P(i) \ 204#define END_NONSTICKY_P(i) \
diff --git a/src/keyboard.h b/src/keyboard.h
index 33a2d535cd6..9785b961a28 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -169,7 +169,7 @@ struct kboard
169 char kbd_queue_has_data; 169 char kbd_queue_has_data;
170 170
171 /* True means echo each character as typed. */ 171 /* True means echo each character as typed. */
172 unsigned immediate_echo : 1; 172 bool_bf immediate_echo : 1;
173 173
174 /* If we have echoed a prompt string specified by the user, 174 /* If we have echoed a prompt string specified by the user,
175 this is its length in characters. Otherwise this is -1. */ 175 this is its length in characters. Otherwise this is -1. */
diff --git a/src/keymap.h b/src/keymap.h
index eca0f1b4108..feccb129b75 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29 We need one more byte for string terminator `\0'. */ 29 We need one more byte for string terminator `\0'. */
30#define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1) 30#define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1)
31 31
32#define KEYMAPP(m) (!NILP (get_keymap (m, 0, 0))) 32#define KEYMAPP(m) (!NILP (get_keymap (m, false, false)))
33extern Lisp_Object Qkeymap, Qmenu_bar; 33extern Lisp_Object Qkeymap, Qmenu_bar;
34extern Lisp_Object Qremap; 34extern Lisp_Object Qremap;
35extern Lisp_Object Qmenu_item; 35extern Lisp_Object Qmenu_item;
diff --git a/src/lisp.h b/src/lisp.h
index c4b36557eac..1e68b152dfc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <setjmp.h> 23#include <setjmp.h>
24#include <stdalign.h> 24#include <stdalign.h>
25#include <stdarg.h> 25#include <stdarg.h>
26#include <stdbool.h>
27#include <stddef.h> 26#include <stddef.h>
28#include <float.h> 27#include <float.h>
29#include <inttypes.h> 28#include <inttypes.h>
@@ -170,7 +169,7 @@ typedef EMACS_UINT uprintmax_t;
170 for COND to call external functions or access volatile storage. */ 169 for COND to call external functions or access volatile storage. */
171 170
172#ifndef ENABLE_CHECKING 171#ifndef ENABLE_CHECKING
173# define eassert(cond) ((void) (0 && (cond))) /* Check that COND compiles. */ 172# define eassert(cond) ((void) (false && (cond))) /* Check COND compiles. */
174# define eassume(cond) assume (cond) 173# define eassume(cond) assume (cond)
175#else /* ENABLE_CHECKING */ 174#else /* ENABLE_CHECKING */
176 175
@@ -251,20 +250,20 @@ enum Lisp_Bits
251 On hosts where pointers-as-ints do not exceed VAL_MAX, USE_LSB_TAG is: 250 On hosts where pointers-as-ints do not exceed VAL_MAX, USE_LSB_TAG is:
252 a. unnecessary, because the top bits of an EMACS_INT are unused, and 251 a. unnecessary, because the top bits of an EMACS_INT are unused, and
253 b. slower, because it typically requires extra masking. 252 b. slower, because it typically requires extra masking.
254 So, default USE_LSB_TAG to 1 only on hosts where it might be useful. */ 253 So, default USE_LSB_TAG to true only on hosts where it might be useful. */
255# if VAL_MAX < UINTPTR_MAX 254# if VAL_MAX < UINTPTR_MAX
256# define USE_LSB_TAG 1 255# define USE_LSB_TAG true
257# endif 256# endif
258# endif 257# endif
259# endif 258# endif
260#endif 259#endif
261#ifdef USE_LSB_TAG 260#ifdef USE_LSB_TAG
262# undef USE_LSB_TAG 261# undef USE_LSB_TAG
263enum enum_USE_LSB_TAG { USE_LSB_TAG = 1 }; 262enum enum_USE_LSB_TAG { USE_LSB_TAG = true };
264# define USE_LSB_TAG 1 263# define USE_LSB_TAG true
265#else 264#else
266enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; 265enum enum_USE_LSB_TAG { USE_LSB_TAG = false };
267# define USE_LSB_TAG 0 266# define USE_LSB_TAG false
268#endif 267#endif
269 268
270#ifndef alignas 269#ifndef alignas
@@ -356,7 +355,7 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 };
356 355
357/* When compiling via gcc -O0, define the key operations as macros, as 356/* When compiling via gcc -O0, define the key operations as macros, as
358 Emacs is too slow otherwise. To disable this optimization, compile 357 Emacs is too slow otherwise. To disable this optimization, compile
359 with -DINLINING=0. */ 358 with -DINLINING=false. */
360#if (defined __NO_INLINE__ \ 359#if (defined __NO_INLINE__ \
361 && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__ \ 360 && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__ \
362 && ! (defined INLINING && ! INLINING)) 361 && ! (defined INLINING && ! INLINING))
@@ -550,14 +549,14 @@ typedef struct { EMACS_INT i; } Lisp_Object;
550#define LISP_INITIALLY_ZERO {0} 549#define LISP_INITIALLY_ZERO {0}
551 550
552#undef CHECK_LISP_OBJECT_TYPE 551#undef CHECK_LISP_OBJECT_TYPE
553enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 1 }; 552enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = true };
554#else /* CHECK_LISP_OBJECT_TYPE */ 553#else /* CHECK_LISP_OBJECT_TYPE */
555 554
556/* If a struct type is not wanted, define Lisp_Object as just a number. */ 555/* If a struct type is not wanted, define Lisp_Object as just a number. */
557 556
558typedef EMACS_INT Lisp_Object; 557typedef EMACS_INT Lisp_Object;
559#define LISP_INITIALLY_ZERO 0 558#define LISP_INITIALLY_ZERO 0
560enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 }; 559enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false };
561#endif /* CHECK_LISP_OBJECT_TYPE */ 560#endif /* CHECK_LISP_OBJECT_TYPE */
562 561
563/* Convert a Lisp_Object to the corresponding EMACS_INT and vice versa. 562/* Convert a Lisp_Object to the corresponding EMACS_INT and vice versa.
@@ -736,7 +735,7 @@ make_natnum (EMACS_INT n)
736/* Return true if X and Y are the same object. */ 735/* Return true if X and Y are the same object. */
737LISP_MACRO_DEFUN (EQ, bool, (Lisp_Object x, Lisp_Object y), (x, y)) 736LISP_MACRO_DEFUN (EQ, bool, (Lisp_Object x, Lisp_Object y), (x, y))
738 737
739/* Value is non-zero if I doesn't fit into a Lisp fixnum. It is 738/* Value is true if I doesn't fit into a Lisp fixnum. It is
740 written this way so that it also works if I is of unsigned 739 written this way so that it also works if I is of unsigned
741 type or if I is a NaN. */ 740 type or if I is a NaN. */
742 741
@@ -1085,17 +1084,23 @@ STRING_MULTIBYTE (Lisp_Object str)
1085 ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, min (SIZE_MAX, PTRDIFF_MAX) - 1)) 1084 ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, min (SIZE_MAX, PTRDIFF_MAX) - 1))
1086 1085
1087/* Mark STR as a unibyte string. */ 1086/* Mark STR as a unibyte string. */
1088#define STRING_SET_UNIBYTE(STR) \ 1087#define STRING_SET_UNIBYTE(STR) \
1089 do { if (EQ (STR, empty_multibyte_string)) \ 1088 do { \
1090 (STR) = empty_unibyte_string; \ 1089 if (EQ (STR, empty_multibyte_string)) \
1091 else XSTRING (STR)->size_byte = -1; } while (0) 1090 (STR) = empty_unibyte_string; \
1091 else \
1092 XSTRING (STR)->size_byte = -1; \
1093 } while (false)
1092 1094
1093/* Mark STR as a multibyte string. Assure that STR contains only 1095/* Mark STR as a multibyte string. Assure that STR contains only
1094 ASCII characters in advance. */ 1096 ASCII characters in advance. */
1095#define STRING_SET_MULTIBYTE(STR) \ 1097#define STRING_SET_MULTIBYTE(STR) \
1096 do { if (EQ (STR, empty_unibyte_string)) \ 1098 do { \
1097 (STR) = empty_multibyte_string; \ 1099 if (EQ (STR, empty_unibyte_string)) \
1098 else XSTRING (STR)->size_byte = XSTRING (STR)->size; } while (0) 1100 (STR) = empty_multibyte_string; \
1101 else \
1102 XSTRING (STR)->size_byte = XSTRING (STR)->size; \
1103 } while (false)
1099 1104
1100/* Convenience functions for dealing with Lisp strings. */ 1105/* Convenience functions for dealing with Lisp strings. */
1101 1106
@@ -1348,14 +1353,14 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1348/* Compute A OP B, using the unsigned comparison operator OP. A and B 1353/* Compute A OP B, using the unsigned comparison operator OP. A and B
1349 should be integer expressions. This is not the same as 1354 should be integer expressions. This is not the same as
1350 mathematical comparison; for example, UNSIGNED_CMP (0, <, -1) 1355 mathematical comparison; for example, UNSIGNED_CMP (0, <, -1)
1351 returns 1. For efficiency, prefer plain unsigned comparison if A 1356 returns true. For efficiency, prefer plain unsigned comparison if A
1352 and B's sizes both fit (after integer promotion). */ 1357 and B's sizes both fit (after integer promotion). */
1353#define UNSIGNED_CMP(a, op, b) \ 1358#define UNSIGNED_CMP(a, op, b) \
1354 (max (sizeof ((a) + 0), sizeof ((b) + 0)) <= sizeof (unsigned) \ 1359 (max (sizeof ((a) + 0), sizeof ((b) + 0)) <= sizeof (unsigned) \
1355 ? ((a) + (unsigned) 0) op ((b) + (unsigned) 0) \ 1360 ? ((a) + (unsigned) 0) op ((b) + (unsigned) 0) \
1356 : ((a) + (uintmax_t) 0) op ((b) + (uintmax_t) 0)) 1361 : ((a) + (uintmax_t) 0) op ((b) + (uintmax_t) 0))
1357 1362
1358/* Nonzero iff C is an ASCII character. */ 1363/* True iff C is an ASCII character. */
1359#define ASCII_CHAR_P(c) UNSIGNED_CMP (c, <, 0x80) 1364#define ASCII_CHAR_P(c) UNSIGNED_CMP (c, <, 0x80)
1360 1365
1361/* A char-table is a kind of vectorlike, with contents are like a 1366/* A char-table is a kind of vectorlike, with contents are like a
@@ -1536,7 +1541,7 @@ enum symbol_redirect
1536 1541
1537struct Lisp_Symbol 1542struct Lisp_Symbol
1538{ 1543{
1539 unsigned gcmarkbit : 1; 1544 bool_bf gcmarkbit : 1;
1540 1545
1541 /* Indicates where the value can be found: 1546 /* Indicates where the value can be found:
1542 0 : it's a plain var, the value is in the `value' field. 1547 0 : it's a plain var, the value is in the `value' field.
@@ -1554,9 +1559,9 @@ struct Lisp_Symbol
1554 enum symbol_interned. */ 1559 enum symbol_interned. */
1555 unsigned interned : 2; 1560 unsigned interned : 2;
1556 1561
1557 /* Non-zero means that this variable has been explicitly declared 1562 /* True means that this variable has been explicitly declared
1558 special (with `defvar' etc), and shouldn't be lexically bound. */ 1563 special (with `defvar' etc), and shouldn't be lexically bound. */
1559 unsigned declared_special : 1; 1564 bool_bf declared_special : 1;
1560 1565
1561 /* The symbol's name, as a Lisp string. */ 1566 /* The symbol's name, as a Lisp string. */
1562 Lisp_Object name; 1567 Lisp_Object name;
@@ -1654,7 +1659,7 @@ SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (Lisp_Object sym)
1654LISP_MACRO_DEFUN (SYMBOL_CONSTANT_P, int, (Lisp_Object sym), (sym)) 1659LISP_MACRO_DEFUN (SYMBOL_CONSTANT_P, int, (Lisp_Object sym), (sym))
1655 1660
1656#define DEFSYM(sym, name) \ 1661#define DEFSYM(sym, name) \
1657 do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0) 1662 do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (false)
1658 1663
1659 1664
1660/*********************************************************************** 1665/***********************************************************************
@@ -1832,22 +1837,22 @@ SXHASH_REDUCE (EMACS_UINT x)
1832struct Lisp_Misc_Any /* Supertype of all Misc types. */ 1837struct Lisp_Misc_Any /* Supertype of all Misc types. */
1833{ 1838{
1834 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */ 1839 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */
1835 unsigned gcmarkbit : 1; 1840 bool_bf gcmarkbit : 1;
1836 unsigned spacer : 15; 1841 unsigned spacer : 15;
1837}; 1842};
1838 1843
1839struct Lisp_Marker 1844struct Lisp_Marker
1840{ 1845{
1841 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */ 1846 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */
1842 unsigned gcmarkbit : 1; 1847 bool_bf gcmarkbit : 1;
1843 unsigned spacer : 13; 1848 unsigned spacer : 13;
1844 /* This flag is temporarily used in the functions 1849 /* This flag is temporarily used in the functions
1845 decode/encode_coding_object to record that the marker position 1850 decode/encode_coding_object to record that the marker position
1846 must be adjusted after the conversion. */ 1851 must be adjusted after the conversion. */
1847 unsigned int need_adjustment : 1; 1852 bool_bf need_adjustment : 1;
1848 /* 1 means normal insertion at the marker's position 1853 /* True means normal insertion at the marker's position
1849 leaves the marker after the inserted text. */ 1854 leaves the marker after the inserted text. */
1850 unsigned int insertion_type : 1; 1855 bool_bf insertion_type : 1;
1851 /* This is the buffer that the marker points into, or 0 if it points nowhere. 1856 /* This is the buffer that the marker points into, or 0 if it points nowhere.
1852 Note: a chain of markers can contain markers pointing into different 1857 Note: a chain of markers can contain markers pointing into different
1853 buffers (the chain is per buffer_text rather than per buffer, so it's 1858 buffers (the chain is per buffer_text rather than per buffer, so it's
@@ -1893,7 +1898,7 @@ struct Lisp_Overlay
1893*/ 1898*/
1894 { 1899 {
1895 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ 1900 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */
1896 unsigned gcmarkbit : 1; 1901 bool_bf gcmarkbit : 1;
1897 unsigned spacer : 15; 1902 unsigned spacer : 15;
1898 struct Lisp_Overlay *next; 1903 struct Lisp_Overlay *next;
1899 Lisp_Object start; 1904 Lisp_Object start;
@@ -1971,7 +1976,7 @@ typedef void (*voidfuncptr) (void);
1971struct Lisp_Save_Value 1976struct Lisp_Save_Value
1972 { 1977 {
1973 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ 1978 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
1974 unsigned gcmarkbit : 1; 1979 bool_bf gcmarkbit : 1;
1975 unsigned spacer : 32 - (16 + 1 + SAVE_TYPE_BITS); 1980 unsigned spacer : 32 - (16 + 1 + SAVE_TYPE_BITS);
1976 1981
1977 /* V->data may hold up to SAVE_VALUE_SLOTS entries. The type of 1982 /* V->data may hold up to SAVE_VALUE_SLOTS entries. The type of
@@ -2047,7 +2052,7 @@ XSAVE_OBJECT (Lisp_Object obj, int n)
2047struct Lisp_Free 2052struct Lisp_Free
2048 { 2053 {
2049 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */ 2054 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */
2050 unsigned gcmarkbit : 1; 2055 bool_bf gcmarkbit : 1;
2051 unsigned spacer : 15; 2056 unsigned spacer : 15;
2052 union Lisp_Misc *chain; 2057 union Lisp_Misc *chain;
2053 }; 2058 };
@@ -2116,8 +2121,8 @@ struct Lisp_Intfwd
2116 2121
2117/* Boolean forwarding pointer to an int variable. 2122/* Boolean forwarding pointer to an int variable.
2118 This is like Lisp_Intfwd except that the ostensible 2123 This is like Lisp_Intfwd except that the ostensible
2119 "value" of the symbol is t if the int variable is nonzero, 2124 "value" of the symbol is t if the bool variable is true,
2120 nil if it is zero. */ 2125 nil if it is false. */
2121struct Lisp_Boolfwd 2126struct Lisp_Boolfwd
2122 { 2127 {
2123 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */ 2128 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */
@@ -2170,15 +2175,15 @@ struct Lisp_Buffer_Objfwd
2170 2175
2171struct Lisp_Buffer_Local_Value 2176struct Lisp_Buffer_Local_Value
2172 { 2177 {
2173 /* 1 means that merely setting the variable creates a local 2178 /* True means that merely setting the variable creates a local
2174 binding for the current buffer. */ 2179 binding for the current buffer. */
2175 unsigned int local_if_set : 1; 2180 bool_bf local_if_set : 1;
2176 /* 1 means this variable can have frame-local bindings, otherwise, it is 2181 /* True means this variable can have frame-local bindings, otherwise, it is
2177 can have buffer-local bindings. The two cannot be combined. */ 2182 can have buffer-local bindings. The two cannot be combined. */
2178 unsigned int frame_local : 1; 2183 bool_bf frame_local : 1;
2179 /* 1 means that the binding now loaded was found. 2184 /* True means that the binding now loaded was found.
2180 Presumably equivalent to (defcell!=valcell). */ 2185 Presumably equivalent to (defcell!=valcell). */
2181 unsigned int found : 1; 2186 bool_bf found : 1;
2182 /* If non-NULL, a forwarding to the C var where it should also be set. */ 2187 /* If non-NULL, a forwarding to the C var where it should also be set. */
2183 union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */ 2188 union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */
2184 /* The buffer or frame for which the loaded binding was found. */ 2189 /* The buffer or frame for which the loaded binding was found. */
@@ -2373,7 +2378,7 @@ INLINE bool
2373PSEUDOVECTORP (Lisp_Object a, int code) 2378PSEUDOVECTORP (Lisp_Object a, int code)
2374{ 2379{
2375 if (! VECTORLIKEP (a)) 2380 if (! VECTORLIKEP (a))
2376 return 0; 2381 return false;
2377 else 2382 else
2378 { 2383 {
2379 /* Converting to struct vectorlike_header * avoids aliasing issues. */ 2384 /* Converting to struct vectorlike_header * avoids aliasing issues. */
@@ -2541,18 +2546,22 @@ CHECK_NATNUM (Lisp_Object x)
2541 ? MOST_NEGATIVE_FIXNUM \ 2546 ? MOST_NEGATIVE_FIXNUM \
2542 : (lo)), \ 2547 : (lo)), \
2543 make_number (min (hi, MOST_POSITIVE_FIXNUM))); \ 2548 make_number (min (hi, MOST_POSITIVE_FIXNUM))); \
2544 } while (0) 2549 } while (false)
2545#define CHECK_TYPE_RANGED_INTEGER(type, x) \ 2550#define CHECK_TYPE_RANGED_INTEGER(type, x) \
2546 do { \ 2551 do { \
2547 if (TYPE_SIGNED (type)) \ 2552 if (TYPE_SIGNED (type)) \
2548 CHECK_RANGED_INTEGER (x, TYPE_MINIMUM (type), TYPE_MAXIMUM (type)); \ 2553 CHECK_RANGED_INTEGER (x, TYPE_MINIMUM (type), TYPE_MAXIMUM (type)); \
2549 else \ 2554 else \
2550 CHECK_RANGED_INTEGER (x, 0, TYPE_MAXIMUM (type)); \ 2555 CHECK_RANGED_INTEGER (x, 0, TYPE_MAXIMUM (type)); \
2551 } while (0) 2556 } while (false)
2552 2557
2553#define CHECK_NUMBER_COERCE_MARKER(x) \ 2558#define CHECK_NUMBER_COERCE_MARKER(x) \
2554 do { if (MARKERP ((x))) XSETFASTINT (x, marker_position (x)); \ 2559 do { \
2555 else CHECK_TYPE (INTEGERP (x), Qinteger_or_marker_p, x); } while (0) 2560 if (MARKERP ((x))) \
2561 XSETFASTINT (x, marker_position (x)); \
2562 else \
2563 CHECK_TYPE (INTEGERP (x), Qinteger_or_marker_p, x); \
2564 } while (false)
2556 2565
2557INLINE double 2566INLINE double
2558XFLOATINT (Lisp_Object n) 2567XFLOATINT (Lisp_Object n)
@@ -2566,9 +2575,13 @@ CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
2566 CHECK_TYPE (FLOATP (x) || INTEGERP (x), Qnumberp, x); 2575 CHECK_TYPE (FLOATP (x) || INTEGERP (x), Qnumberp, x);
2567} 2576}
2568 2577
2569#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \ 2578#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \
2570 do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \ 2579 do { \
2571 else CHECK_TYPE (INTEGERP (x) || FLOATP (x), Qnumber_or_marker_p, x); } while (0) 2580 if (MARKERP (x)) \
2581 XSETFASTINT (x, marker_position (x)); \
2582 else \
2583 CHECK_TYPE (INTEGERP (x) || FLOATP (x), Qnumber_or_marker_p, x); \
2584 } while (false)
2572 2585
2573/* Since we can't assign directly to the CAR or CDR fields of a cons 2586/* Since we can't assign directly to the CAR or CDR fields of a cons
2574 cell, use these when checking that those fields contain numbers. */ 2587 cell, use these when checking that those fields contain numbers. */
@@ -2701,34 +2714,34 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
2701 do { \ 2714 do { \
2702 static struct Lisp_Objfwd o_fwd; \ 2715 static struct Lisp_Objfwd o_fwd; \
2703 defvar_lisp (&o_fwd, lname, &globals.f_ ## vname); \ 2716 defvar_lisp (&o_fwd, lname, &globals.f_ ## vname); \
2704 } while (0) 2717 } while (false)
2705#define DEFVAR_LISP_NOPRO(lname, vname, doc) \ 2718#define DEFVAR_LISP_NOPRO(lname, vname, doc) \
2706 do { \ 2719 do { \
2707 static struct Lisp_Objfwd o_fwd; \ 2720 static struct Lisp_Objfwd o_fwd; \
2708 defvar_lisp_nopro (&o_fwd, lname, &globals.f_ ## vname); \ 2721 defvar_lisp_nopro (&o_fwd, lname, &globals.f_ ## vname); \
2709 } while (0) 2722 } while (false)
2710#define DEFVAR_BOOL(lname, vname, doc) \ 2723#define DEFVAR_BOOL(lname, vname, doc) \
2711 do { \ 2724 do { \
2712 static struct Lisp_Boolfwd b_fwd; \ 2725 static struct Lisp_Boolfwd b_fwd; \
2713 defvar_bool (&b_fwd, lname, &globals.f_ ## vname); \ 2726 defvar_bool (&b_fwd, lname, &globals.f_ ## vname); \
2714 } while (0) 2727 } while (false)
2715#define DEFVAR_INT(lname, vname, doc) \ 2728#define DEFVAR_INT(lname, vname, doc) \
2716 do { \ 2729 do { \
2717 static struct Lisp_Intfwd i_fwd; \ 2730 static struct Lisp_Intfwd i_fwd; \
2718 defvar_int (&i_fwd, lname, &globals.f_ ## vname); \ 2731 defvar_int (&i_fwd, lname, &globals.f_ ## vname); \
2719 } while (0) 2732 } while (false)
2720 2733
2721#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ 2734#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
2722 do { \ 2735 do { \
2723 static struct Lisp_Objfwd o_fwd; \ 2736 static struct Lisp_Objfwd o_fwd; \
2724 defvar_lisp_nopro (&o_fwd, lname, &BVAR (&buffer_defaults, vname)); \ 2737 defvar_lisp_nopro (&o_fwd, lname, &BVAR (&buffer_defaults, vname)); \
2725 } while (0) 2738 } while (false)
2726 2739
2727#define DEFVAR_KBOARD(lname, vname, doc) \ 2740#define DEFVAR_KBOARD(lname, vname, doc) \
2728 do { \ 2741 do { \
2729 static struct Lisp_Kboard_Objfwd ko_fwd; \ 2742 static struct Lisp_Kboard_Objfwd ko_fwd; \
2730 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ 2743 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \
2731 } while (0) 2744 } while (false)
2732 2745
2733/* Save and restore the instruction and environment pointers, 2746/* Save and restore the instruction and environment pointers,
2734 without affecting the signal mask. */ 2747 without affecting the signal mask. */
@@ -2812,7 +2825,7 @@ union specbinding
2812 } let; 2825 } let;
2813 struct { 2826 struct {
2814 ENUM_BF (specbind_tag) kind : CHAR_BIT; 2827 ENUM_BF (specbind_tag) kind : CHAR_BIT;
2815 unsigned debug_on_exit : 1; 2828 bool_bf debug_on_exit : 1;
2816 Lisp_Object function; 2829 Lisp_Object function;
2817 Lisp_Object *args; 2830 Lisp_Object *args;
2818 ptrdiff_t nargs; 2831 ptrdiff_t nargs;
@@ -2869,7 +2882,7 @@ struct handler
2869 2882
2870 /* Most global vars are reset to their value via the specpdl mechanism, 2883 /* Most global vars are reset to their value via the specpdl mechanism,
2871 but a few others are handled by storing their value here. */ 2884 but a few others are handled by storing their value here. */
2872#if 1 /* GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS, but they're defined later. */ 2885#if true /* GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS, but defined later. */
2873 struct gcpro *gcpro; 2886 struct gcpro *gcpro;
2874#endif 2887#endif
2875 sys_jmp_buf jmp; 2888 sys_jmp_buf jmp;
@@ -2917,7 +2930,7 @@ extern char *stack_bottom;
2917 Unless that is impossible, of course. 2930 Unless that is impossible, of course.
2918 But it is very desirable to avoid creating loops where QUIT is impossible. 2931 But it is very desirable to avoid creating loops where QUIT is impossible.
2919 2932
2920 Exception: if you set immediate_quit to nonzero, 2933 Exception: if you set immediate_quit to true,
2921 then the handler that responds to the C-g does the quit itself. 2934 then the handler that responds to the C-g does the quit itself.
2922 This is a good thing to do around a loop that has no side effects 2935 This is a good thing to do around a loop that has no side effects
2923 and (in particular) cannot call arbitrary Lisp code. 2936 and (in particular) cannot call arbitrary Lisp code.
@@ -2935,10 +2948,10 @@ extern void process_quit_flag (void);
2935 process_quit_flag (); \ 2948 process_quit_flag (); \
2936 else if (pending_signals) \ 2949 else if (pending_signals) \
2937 process_pending_signals (); \ 2950 process_pending_signals (); \
2938 } while (0) 2951 } while (false)
2939 2952
2940 2953
2941/* Nonzero if ought to quit now. */ 2954/* True if ought to quit now. */
2942 2955
2943#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 2956#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
2944 2957
@@ -3121,9 +3134,9 @@ extern int gcpro_level;
3121 gcprolist = &gcpro6; } 3134 gcprolist = &gcpro6; }
3122 3135
3123#define UNGCPRO \ 3136#define UNGCPRO \
3124 ((--gcpro_level != gcpro1.level) \ 3137 (--gcpro_level != gcpro1.level \
3125 ? (emacs_abort (), 0) \ 3138 ? emacs_abort () \
3126 : ((gcprolist = gcpro1.next), 0)) 3139 : (void) (gcprolist = gcpro1.next))
3127 3140
3128#endif /* DEBUG_GCPRO */ 3141#endif /* DEBUG_GCPRO */
3129#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ 3142#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
@@ -3131,14 +3144,14 @@ extern int gcpro_level;
3131 3144
3132/* Evaluate expr, UNGCPRO, and then return the value of expr. */ 3145/* Evaluate expr, UNGCPRO, and then return the value of expr. */
3133#define RETURN_UNGCPRO(expr) \ 3146#define RETURN_UNGCPRO(expr) \
3134do \ 3147 do \
3135 { \ 3148 { \
3136 Lisp_Object ret_ungc_val; \ 3149 Lisp_Object ret_ungc_val; \
3137 ret_ungc_val = (expr); \ 3150 ret_ungc_val = (expr); \
3138 UNGCPRO; \ 3151 UNGCPRO; \
3139 return ret_ungc_val; \ 3152 return ret_ungc_val; \
3140 } \ 3153 } \
3141while (0) 3154 while (false)
3142 3155
3143/* Call staticpro (&var) to protect static variable `var'. */ 3156/* Call staticpro (&var) to protect static variable `var'. */
3144 3157
@@ -4390,13 +4403,13 @@ enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 };
4390extern void *record_xmalloc (size_t); 4403extern void *record_xmalloc (size_t);
4391 4404
4392#define USE_SAFE_ALLOCA \ 4405#define USE_SAFE_ALLOCA \
4393 ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = 0 4406 ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = false
4394 4407
4395/* SAFE_ALLOCA allocates a simple buffer. */ 4408/* SAFE_ALLOCA allocates a simple buffer. */
4396 4409
4397#define SAFE_ALLOCA(size) ((size) < MAX_ALLOCA \ 4410#define SAFE_ALLOCA(size) ((size) < MAX_ALLOCA \
4398 ? alloca (size) \ 4411 ? alloca (size) \
4399 : (sa_must_free = 1, record_xmalloc (size))) 4412 : (sa_must_free = true, record_xmalloc (size)))
4400 4413
4401/* SAFE_NALLOCA sets BUF to a newly allocated array of MULTIPLIER * 4414/* SAFE_NALLOCA sets BUF to a newly allocated array of MULTIPLIER *
4402 NITEMS items, each of the same type as *BUF. MULTIPLIER must 4415 NITEMS items, each of the same type as *BUF. MULTIPLIER must
@@ -4409,20 +4422,20 @@ extern void *record_xmalloc (size_t);
4409 else \ 4422 else \
4410 { \ 4423 { \
4411 (buf) = xnmalloc (nitems, sizeof *(buf) * (multiplier)); \ 4424 (buf) = xnmalloc (nitems, sizeof *(buf) * (multiplier)); \
4412 sa_must_free = 1; \ 4425 sa_must_free = true; \
4413 record_unwind_protect_ptr (xfree, buf); \ 4426 record_unwind_protect_ptr (xfree, buf); \
4414 } \ 4427 } \
4415 } while (0) 4428 } while (false)
4416 4429
4417/* SAFE_FREE frees xmalloced memory and enables GC as needed. */ 4430/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
4418 4431
4419#define SAFE_FREE() \ 4432#define SAFE_FREE() \
4420 do { \ 4433 do { \
4421 if (sa_must_free) { \ 4434 if (sa_must_free) { \
4422 sa_must_free = 0; \ 4435 sa_must_free = false; \
4423 unbind_to (sa_count, Qnil); \ 4436 unbind_to (sa_count, Qnil); \
4424 } \ 4437 } \
4425 } while (0) 4438 } while (false)
4426 4439
4427 4440
4428/* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects. */ 4441/* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects. */
@@ -4430,39 +4443,40 @@ extern void *record_xmalloc (size_t);
4430#define SAFE_ALLOCA_LISP(buf, nelt) \ 4443#define SAFE_ALLOCA_LISP(buf, nelt) \
4431 do { \ 4444 do { \
4432 if ((nelt) < MAX_ALLOCA / word_size) \ 4445 if ((nelt) < MAX_ALLOCA / word_size) \
4433 buf = alloca ((nelt) * word_size); \ 4446 (buf) = alloca ((nelt) * word_size); \
4434 else if ((nelt) < min (PTRDIFF_MAX, SIZE_MAX) / word_size) \ 4447 else if ((nelt) < min (PTRDIFF_MAX, SIZE_MAX) / word_size) \
4435 { \ 4448 { \
4436 Lisp_Object arg_; \ 4449 Lisp_Object arg_; \
4437 buf = xmalloc ((nelt) * word_size); \ 4450 (buf) = xmalloc ((nelt) * word_size); \
4438 arg_ = make_save_memory (buf, nelt); \ 4451 arg_ = make_save_memory (buf, nelt); \
4439 sa_must_free = 1; \ 4452 sa_must_free = true; \
4440 record_unwind_protect (free_save_value, arg_); \ 4453 record_unwind_protect (free_save_value, arg_); \
4441 } \ 4454 } \
4442 else \ 4455 else \
4443 memory_full (SIZE_MAX); \ 4456 memory_full (SIZE_MAX); \
4444 } while (0) 4457 } while (false)
4445 4458
4446/* Loop over all tails of a list, checking for cycles. 4459/* Loop over all tails of a list, checking for cycles.
4447 FIXME: Make tortoise and n internal declarations. 4460 FIXME: Make tortoise and n internal declarations.
4448 FIXME: Unroll the loop body so we don't need `n'. */ 4461 FIXME: Unroll the loop body so we don't need `n'. */
4449#define FOR_EACH_TAIL(hare, list, tortoise, n) \ 4462#define FOR_EACH_TAIL(hare, list, tortoise, n) \
4450 for (tortoise = hare = (list), n = true; \ 4463 for ((tortoise) = (hare) = (list), (n) = true; \
4451 CONSP (hare); \ 4464 CONSP (hare); \
4452 (hare = XCDR (hare), n = !n, \ 4465 (hare = XCDR (hare), (n) = !(n), \
4453 (n \ 4466 ((n) \
4454 ? ((EQ (hare, tortoise) \ 4467 ? (EQ (hare, tortoise) \
4455 && (xsignal1 (Qcircular_list, (list)), 0))) \ 4468 ? xsignal1 (Qcircular_list, list) \
4469 : (void) 0) \
4456 /* Move tortoise before the next iteration, in case */ \ 4470 /* Move tortoise before the next iteration, in case */ \
4457 /* the next iteration does an Fsetcdr. */ \ 4471 /* the next iteration does an Fsetcdr. */ \
4458 : (tortoise = XCDR (tortoise), 0)))) 4472 : (void) ((tortoise) = XCDR (tortoise)))))
4459 4473
4460/* Do a `for' loop over alist values. */ 4474/* Do a `for' loop over alist values. */
4461 4475
4462#define FOR_EACH_ALIST_VALUE(head_var, list_var, value_var) \ 4476#define FOR_EACH_ALIST_VALUE(head_var, list_var, value_var) \
4463 for (list_var = head_var; \ 4477 for ((list_var) = (head_var); \
4464 (CONSP (list_var) && (value_var = XCDR (XCAR (list_var)), 1)); \ 4478 (CONSP (list_var) && ((value_var) = XCDR (XCAR (list_var)), true)); \
4465 list_var = XCDR (list_var)) 4479 (list_var) = XCDR (list_var))
4466 4480
4467/* Check whether it's time for GC, and run it if so. */ 4481/* Check whether it's time for GC, and run it if so. */
4468 4482
@@ -4498,14 +4512,14 @@ functionp (Lisp_Object object)
4498 if (SUBRP (object)) 4512 if (SUBRP (object))
4499 return XSUBR (object)->max_args != UNEVALLED; 4513 return XSUBR (object)->max_args != UNEVALLED;
4500 else if (COMPILEDP (object)) 4514 else if (COMPILEDP (object))
4501 return 1; 4515 return true;
4502 else if (CONSP (object)) 4516 else if (CONSP (object))
4503 { 4517 {
4504 Lisp_Object car = XCAR (object); 4518 Lisp_Object car = XCAR (object);
4505 return EQ (car, Qlambda) || EQ (car, Qclosure); 4519 return EQ (car, Qlambda) || EQ (car, Qclosure);
4506 } 4520 }
4507 else 4521 else
4508 return 0; 4522 return false;
4509} 4523}
4510 4524
4511INLINE_HEADER_END 4525INLINE_HEADER_END
diff --git a/src/macfont.m b/src/macfont.m
index 10623eb12fe..d129b330774 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -95,11 +95,11 @@ struct macfont_info
95 struct macfont_cache *cache; 95 struct macfont_cache *cache;
96 struct macfont_metrics **metrics; 96 struct macfont_metrics **metrics;
97 short metrics_nrows; 97 short metrics_nrows;
98 unsigned synthetic_italic_p : 1; 98 bool_bf synthetic_italic_p : 1;
99 unsigned synthetic_bold_p : 1; 99 bool_bf synthetic_bold_p : 1;
100 unsigned spacing : 2; 100 unsigned spacing : 2;
101 unsigned antialias : 2; 101 unsigned antialias : 2;
102 unsigned color_bitmap_p : 1; 102 bool_bf color_bitmap_p : 1;
103}; 103};
104 104
105/* Values for the `spacing' member in `struct macfont_info'. */ 105/* Values for the `spacing' member in `struct macfont_info'. */
diff --git a/src/process.h b/src/process.h
index 37d220e987c..00fd6be9e49 100644
--- a/src/process.h
+++ b/src/process.h
@@ -138,23 +138,23 @@ struct Lisp_Process
138 0 = nil, 1 = t, 2 = other. */ 138 0 = nil, 1 = t, 2 = other. */
139 unsigned int adaptive_read_buffering : 2; 139 unsigned int adaptive_read_buffering : 2;
140 /* Skip reading this process on next read. */ 140 /* Skip reading this process on next read. */
141 unsigned int read_output_skip : 1; 141 bool_bf read_output_skip : 1;
142 /* Non-nil means kill silently if Emacs is exited. 142 /* True means kill silently if Emacs is exited.
143 This is the inverse of the `query-on-exit' flag. */ 143 This is the inverse of the `query-on-exit' flag. */
144 unsigned int kill_without_query : 1; 144 bool_bf kill_without_query : 1;
145 /* Non-nil if communicating through a pty. */ 145 /* True if communicating through a pty. */
146 unsigned int pty_flag : 1; 146 bool_bf pty_flag : 1;
147 /* Flag to set coding-system of the process buffer from the 147 /* Flag to set coding-system of the process buffer from the
148 coding_system used to decode process output. */ 148 coding_system used to decode process output. */
149 unsigned int inherit_coding_system_flag : 1; 149 bool_bf inherit_coding_system_flag : 1;
150 /* Whether the process is alive, i.e., can be waited for. Running 150 /* Whether the process is alive, i.e., can be waited for. Running
151 processes can be waited for, but exited and fake processes cannot. */ 151 processes can be waited for, but exited and fake processes cannot. */
152 unsigned int alive : 1; 152 bool_bf alive : 1;
153 /* Record the process status in the raw form in which it comes from `wait'. 153 /* Record the process status in the raw form in which it comes from `wait'.
154 This is to avoid consing in a signal handler. The `raw_status_new' 154 This is to avoid consing in a signal handler. The `raw_status_new'
155 flag indicates that `raw_status' contains a new status that still 155 flag indicates that `raw_status' contains a new status that still
156 needs to be synced to `status'. */ 156 needs to be synced to `status'. */
157 unsigned int raw_status_new : 1; 157 bool_bf raw_status_new : 1;
158 int raw_status; 158 int raw_status;
159 159
160#ifdef HAVE_GNUTLS 160#ifdef HAVE_GNUTLS
@@ -164,7 +164,7 @@ struct Lisp_Process
164 gnutls_anon_client_credentials_t gnutls_anon_cred; 164 gnutls_anon_client_credentials_t gnutls_anon_cred;
165 int gnutls_log_level; 165 int gnutls_log_level;
166 int gnutls_handshakes_tried; 166 int gnutls_handshakes_tried;
167 unsigned int gnutls_p : 1; 167 bool_bf gnutls_p : 1;
168#endif 168#endif
169}; 169};
170 170
diff --git a/src/region-cache.c b/src/region-cache.c
index be7d50a50e4..8481a820301 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -716,8 +716,9 @@ region_cache_forward (struct buffer *buf, struct region_cache *c,
716 value is known, for the purposes of CACHE, and return zero 716 value is known, for the purposes of CACHE, and return zero
717 otherwise. If NEXT is non-zero, set *NEXT to the nearest 717 otherwise. If NEXT is non-zero, set *NEXT to the nearest
718 position before POS where the knowledge changes. */ 718 position before POS where the knowledge changes. */
719int region_cache_backward (struct buffer *buf, struct region_cache *c, 719int
720 ptrdiff_t pos, ptrdiff_t *next) 720region_cache_backward (struct buffer *buf, struct region_cache *c,
721 ptrdiff_t pos, ptrdiff_t *next)
721{ 722{
722 revalidate_region_cache (buf, c); 723 revalidate_region_cache (buf, c);
723 724
diff --git a/src/region-cache.h b/src/region-cache.h
index e4c6b59ee95..1a26938a39e 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -89,24 +89,19 @@ extern void invalidate_region_cache (struct buffer *BUF,
89/* The scanning functions. 89/* The scanning functions.
90 90
91 Basically, if you're scanning forward/backward from position POS, 91 Basically, if you're scanning forward/backward from position POS,
92 and region_cache_forward/backward returns true, you can skip all 92 and region_cache_forward/backward returns nonzero, you can skip all
93 the text between POS and *NEXT. And if the function returns false, 93 the text between POS and *NEXT. And if the function returns zero,
94 you should examine all the text from POS to *NEXT, and call 94 you should examine all the text from POS to *NEXT, and call
95 know_region_cache depending on what you find there; this way, you 95 know_region_cache depending on what you find there; this way, you
96 might be able to avoid scanning it again. */ 96 might be able to avoid scanning it again. */
97 97
98/* Return true if the text immediately after POS in BUF is known, for 98/* Return the value for the text immediately after POS in BUF if the value
99 the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest 99 is known, for the purposes of CACHE, and return zero otherwise.
100 If NEXT is non-zero, set *NEXT to the nearest
100 position after POS where the knowledge changes. */ 101 position after POS where the knowledge changes. */
101extern int region_cache_forward (struct buffer *BUF, 102extern int region_cache_forward (struct buffer *buf, struct region_cache *c,
102 struct region_cache *CACHE, 103 ptrdiff_t pos, ptrdiff_t *next);
103 ptrdiff_t POS, 104
104 ptrdiff_t *NEXT); 105/* Likewise, except before POS rather than after POS. */
105 106extern int region_cache_backward (struct buffer *buf, struct region_cache *c,
106/* Return true if the text immediately before POS in BUF is known, for 107 ptrdiff_t pos, ptrdiff_t *next);
107 the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
108 position before POS where the knowledge changes. */
109extern int region_cache_backward (struct buffer *BUF,
110 struct region_cache *CACHE,
111 ptrdiff_t POS,
112 ptrdiff_t *NEXT);
diff --git a/src/syntax.h b/src/syntax.h
index 73fbb153338..63cb0e96139 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -99,7 +99,7 @@ syntax_property_entry (int c, bool via_property)
99INLINE Lisp_Object 99INLINE Lisp_Object
100SYNTAX_ENTRY (int c) 100SYNTAX_ENTRY (int c)
101{ 101{
102 return syntax_property_entry (c, 0); 102 return syntax_property_entry (c, false);
103} 103}
104 104
105/* Extract the information from the entry for character C 105/* Extract the information from the entry for character C
@@ -114,7 +114,7 @@ syntax_property_with_flags (int c, bool via_property)
114INLINE int 114INLINE int
115SYNTAX_WITH_FLAGS (int c) 115SYNTAX_WITH_FLAGS (int c)
116{ 116{
117 return syntax_property_with_flags (c, 0); 117 return syntax_property_with_flags (c, false);
118} 118}
119 119
120INLINE enum syntaxcode 120INLINE enum syntaxcode
@@ -125,7 +125,7 @@ syntax_property (int c, bool via_property)
125INLINE enum syntaxcode 125INLINE enum syntaxcode
126SYNTAX (int c) 126SYNTAX (int c)
127{ 127{
128 return syntax_property (c, 0); 128 return syntax_property (c, false);
129} 129}
130 130
131 131
@@ -146,7 +146,8 @@ extern char const syntax_code_spec[16];
146 for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT. 146 for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT.
147 147
148 The value is meant for use in code that does nothing when 148 The value is meant for use in code that does nothing when
149 parse_sexp_lookup_properties is 0, so return 0 in that case, for speed. */ 149 parse_sexp_lookup_properties is false, so return 0 in that case,
150 for speed. */
150 151
151INLINE ptrdiff_t 152INLINE ptrdiff_t
152SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos) 153SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos)
@@ -172,7 +173,7 @@ INLINE void
172UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos) 173UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos)
173{ 174{
174 if (parse_sexp_lookup_properties && charpos >= gl_state.e_property) 175 if (parse_sexp_lookup_properties && charpos >= gl_state.e_property)
175 update_syntax_table (charpos + gl_state.offset, 1, 0, gl_state.object); 176 update_syntax_table (charpos + gl_state.offset, 1, false, gl_state.object);
176} 177}
177 178
178/* Make syntax table state (gl_state) good for CHARPOS, assuming it is 179/* Make syntax table state (gl_state) good for CHARPOS, assuming it is
@@ -182,7 +183,7 @@ INLINE void
182UPDATE_SYNTAX_TABLE_BACKWARD (ptrdiff_t charpos) 183UPDATE_SYNTAX_TABLE_BACKWARD (ptrdiff_t charpos)
183{ 184{
184 if (parse_sexp_lookup_properties && charpos < gl_state.b_property) 185 if (parse_sexp_lookup_properties && charpos < gl_state.b_property)
185 update_syntax_table (charpos + gl_state.offset, -1, 0, gl_state.object); 186 update_syntax_table (charpos + gl_state.offset, -1, false, gl_state.object);
186} 187}
187 188
188/* Make syntax table good for CHARPOS. */ 189/* Make syntax table good for CHARPOS. */
@@ -199,7 +200,7 @@ UPDATE_SYNTAX_TABLE (ptrdiff_t charpos)
199INLINE void 200INLINE void
200SETUP_BUFFER_SYNTAX_TABLE (void) 201SETUP_BUFFER_SYNTAX_TABLE (void)
201{ 202{
202 gl_state.use_global = 0; 203 gl_state.use_global = false;
203 gl_state.current_syntax_table = BVAR (current_buffer, syntax_table); 204 gl_state.current_syntax_table = BVAR (current_buffer, syntax_table);
204} 205}
205 206
diff --git a/src/syssignal.h b/src/syssignal.h
index 45ea8f1af3c..370948c429b 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20#include <signal.h> 20#include <signal.h>
21#include <stdbool.h>
22 21
23extern void init_signals (bool); 22extern void init_signals (bool);
24 23
diff --git a/src/systime.h b/src/systime.h
index a9bdf53b09f..ecb8e2183f4 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -57,10 +57,10 @@ invalid_timespec (void)
57 return make_timespec (0, -1); 57 return make_timespec (0, -1);
58} 58}
59 59
60/* Return 1 if TIME is a valid timespec. This currently doesn't worry 60/* Return true if TIME is a valid timespec. This currently doesn't worry
61 about whether tv_nsec is less than TIMESPEC_RESOLUTION; leap seconds 61 about whether tv_nsec is less than TIMESPEC_RESOLUTION; leap seconds
62 might cause a problem if it did. */ 62 might cause a problem if it did. */
63INLINE int 63INLINE bool
64timespec_valid_p (struct timespec t) 64timespec_valid_p (struct timespec t)
65{ 65{
66 return t.tv_nsec >= 0; 66 return t.tv_nsec >= 0;
diff --git a/src/syswait.h b/src/syswait.h
index 4ae9129d7ed..c56f2eec2a2 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#ifndef EMACS_SYSWAIT_H 23#ifndef EMACS_SYSWAIT_H
24#define EMACS_SYSWAIT_H 24#define EMACS_SYSWAIT_H
25 25
26#include <stdbool.h>
27#include <sys/types.h> 26#include <sys/types.h>
28 27
29#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ 28#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */
diff --git a/src/term.c b/src/term.c
index 7b6cb41e23d..43ce58c5ca2 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3027,7 +3027,7 @@ save_and_enable_current_matrix (struct frame *f)
3027 /* Make sure every row is enabled, or else update_frame will not 3027 /* Make sure every row is enabled, or else update_frame will not
3028 redraw them. (Rows that are identical to what is already on 3028 redraw them. (Rows that are identical to what is already on
3029 screen will not be redrawn anyway.) */ 3029 screen will not be redrawn anyway.) */
3030 to->enabled_p = 1; 3030 to->enabled_p = true;
3031 to->hash = from->hash; 3031 to->hash = from->hash;
3032 } 3032 }
3033 3033
diff --git a/src/termchar.h b/src/termchar.h
index feb89e02d0e..5ded6c82aea 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -54,7 +54,8 @@ struct tty_display_info
54 54
55 struct emacs_tty *old_tty; /* The initial tty mode bits */ 55 struct emacs_tty *old_tty; /* The initial tty mode bits */
56 56
57 unsigned term_initted : 1; /* 1 if we have been through init_sys_modes. */ 57 bool_bf term_initted : 1; /* True if we have been through
58 init_sys_modes. */
58 59
59 int reference_count; /* Number of frames that are on this display. */ 60 int reference_count; /* Number of frames that are on this display. */
60 61
@@ -166,12 +167,12 @@ struct tty_display_info
166 167
167 int RPov; /* # chars to start a TS_repeat */ 168 int RPov; /* # chars to start a TS_repeat */
168 169
169 unsigned delete_in_insert_mode : 1; /* delete mode == insert mode */ 170 bool_bf delete_in_insert_mode : 1; /* delete mode == insert mode */
170 171
171 unsigned costs_set : 1; /* Nonzero if costs have been calculated. */ 172 bool_bf costs_set : 1; /* True if costs have been calculated. */
172 173
173 unsigned insert_mode : 1; /* Nonzero when in insert mode. */ 174 bool_bf insert_mode : 1; /* True when in insert mode. */
174 unsigned standout_mode : 1; /* Nonzero when in standout mode. */ 175 bool_bf standout_mode : 1; /* True when in standout mode. */
175 176
176 /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should 177 /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
177 keep 0200 bit in input chars. 0 to ignore the 0200 bit. */ 178 keep 0200 bit in input chars. 0 to ignore the 0200 bit. */
@@ -189,33 +190,33 @@ struct tty_display_info
189 190
190 /* Flag used in tty_show/hide_cursor. */ 191 /* Flag used in tty_show/hide_cursor. */
191 192
192 unsigned cursor_hidden : 1; 193 bool_bf cursor_hidden : 1;
193 194
194 /* Nonzero means use ^S/^Q for flow control. */ 195 /* True means use ^S/^Q for flow control. */
195 196
196 unsigned flow_control : 1; 197 bool_bf flow_control : 1;
197 198
198 /* Non-zero means we are displaying a TTY menu on this tty. */ 199 /* True means we are displaying a TTY menu on this tty. */
199 unsigned showing_menu : 1; 200 bool_bf showing_menu : 1;
200 201
201 /* Nonzero means spaces in the text must actually be output; 202 /* True means spaces in the text must actually be output;
202 can't just skip over some columns to leave them blank. */ 203 can't just skip over some columns to leave them blank. */
203 unsigned must_write_spaces : 1; 204 bool_bf must_write_spaces : 1;
204 205
205 /* Nonzero if TTY can insert and delete lines. */ 206 /* True if TTY can insert and delete lines. */
206 unsigned line_ins_del_ok : 1; 207 bool_bf line_ins_del_ok : 1;
207 208
208 /* Nonzero if TTY can insert and delete chars. */ 209 /* True if TTY can insert and delete chars. */
209 unsigned char_ins_del_ok : 1; 210 bool_bf char_ins_del_ok : 1;
210 211
211 /* Nonzero if TTY supports setting the scroll window. */ 212 /* True if TTY supports setting the scroll window. */
212 unsigned scroll_region_ok : 1; 213 bool_bf scroll_region_ok : 1;
213 214
214 /* Nonzero if TTY remembers lines scrolled off bottom. */ 215 /* True if TTY remembers lines scrolled off bottom. */
215 unsigned memory_below_frame : 1; 216 bool_bf memory_below_frame : 1;
216 217
217 /* Cost of setting the scroll window, measured in characters. */ 218 /* Cost of setting the scroll window, measured in characters. */
218 int scroll_region_cost; 219 int scroll_region_cost;
219}; 220};
220 221
221/* A chain of structures for all tty devices currently in use. */ 222/* A chain of structures for all tty devices currently in use. */
diff --git a/src/unexelf.c b/src/unexelf.c
index e2412393286..94c9c02f70d 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -393,7 +393,6 @@ temacs:
393#include <fcntl.h> 393#include <fcntl.h>
394#include <limits.h> 394#include <limits.h>
395#include <memory.h> 395#include <memory.h>
396#include <stdbool.h>
397#include <stdint.h> 396#include <stdint.h>
398#include <stdio.h> 397#include <stdio.h>
399#include <sys/stat.h> 398#include <sys/stat.h>
diff --git a/src/window.h b/src/window.h
index b91161f4d32..05b4680471b 100644
--- a/src/window.h
+++ b/src/window.h
@@ -287,78 +287,78 @@ struct window
287 int header_line_height; 287 int header_line_height;
288 288
289 /* Z - the buffer position of the last glyph in the current 289 /* Z - the buffer position of the last glyph in the current
290 matrix of W. Only valid if window_end_valid is nonzero. */ 290 matrix of W. Only valid if window_end_valid is true. */
291 ptrdiff_t window_end_pos; 291 ptrdiff_t window_end_pos;
292 292
293 /* Glyph matrix row of the last glyph in the current matrix 293 /* Glyph matrix row of the last glyph in the current matrix
294 of W. Only valid if window_end_valid is nonzero. */ 294 of W. Only valid if window_end_valid is true. */
295 int window_end_vpos; 295 int window_end_vpos;
296 296
297 /* Non-zero if this window is a minibuffer window. */ 297 /* True if this window is a minibuffer window. */
298 unsigned mini : 1; 298 bool_bf mini : 1;
299 299
300 /* Meaningful only if contents is a window, non-zero if this 300 /* Meaningful only if contents is a window, non-zero if this
301 internal window is used in horizontal combination. */ 301 internal window is used in horizontal combination. */
302 unsigned horizontal : 1; 302 bool_bf horizontal : 1;
303 303
304 /* Non-zero means must regenerate mode line of this window. */ 304 /* True means must regenerate mode line of this window. */
305 unsigned update_mode_line : 1; 305 bool_bf update_mode_line : 1;
306 306
307 /* Non-nil if the buffer was "modified" when the window 307 /* True if the buffer was "modified" when the window
308 was last updated. */ 308 was last updated. */
309 unsigned last_had_star : 1; 309 bool_bf last_had_star : 1;
310 310
311 /* Non-zero means current value of `start' 311 /* True means current value of `start'
312 was the beginning of a line when it was chosen. */ 312 was the beginning of a line when it was chosen. */
313 unsigned start_at_line_beg : 1; 313 bool_bf start_at_line_beg : 1;
314 314
315 /* Non-zero means next redisplay must use the value of start 315 /* True means next redisplay must use the value of start
316 set up for it in advance. Set by scrolling commands. */ 316 set up for it in advance. Set by scrolling commands. */
317 unsigned force_start : 1; 317 bool_bf force_start : 1;
318 318
319 /* Non-zero means we have explicitly changed the value of start, 319 /* True means we have explicitly changed the value of start,
320 but that the next redisplay is not obliged to use the new value. 320 but that the next redisplay is not obliged to use the new value.
321 This is used in Fdelete_other_windows to force a call to 321 This is used in Fdelete_other_windows to force a call to
322 Vwindow_scroll_functions; also by Frecenter with argument. */ 322 Vwindow_scroll_functions; also by Frecenter with argument. */
323 unsigned optional_new_start : 1; 323 bool_bf optional_new_start : 1;
324 324
325 /* Non-zero means the cursor is currently displayed. This can be 325 /* True means the cursor is currently displayed. This can be
326 set to zero by functions overpainting the cursor image. */ 326 set to zero by functions overpainting the cursor image. */
327 unsigned phys_cursor_on_p : 1; 327 bool_bf phys_cursor_on_p : 1;
328 328
329 /* 0 means cursor is logically on, 1 means it's off. Used for 329 /* False means cursor is logically on, true means it's off. Used for
330 blinking cursor. */ 330 blinking cursor. */
331 unsigned cursor_off_p : 1; 331 bool_bf cursor_off_p : 1;
332 332
333 /* Value of cursor_off_p as of the last redisplay. */ 333 /* Value of cursor_off_p as of the last redisplay. */
334 unsigned last_cursor_off_p : 1; 334 bool_bf last_cursor_off_p : 1;
335 335
336 /* 1 means desired matrix has been build and window must be 336 /* True means desired matrix has been build and window must be
337 updated in update_frame. */ 337 updated in update_frame. */
338 unsigned must_be_updated_p : 1; 338 bool_bf must_be_updated_p : 1;
339 339
340 /* Flag indicating that this window is not a real one. 340 /* Flag indicating that this window is not a real one.
341 Currently only used for menu bar windows of frames. */ 341 Currently only used for menu bar windows of frames. */
342 unsigned pseudo_window_p : 1; 342 bool_bf pseudo_window_p : 1;
343 343
344 /* Non-zero means fringes are drawn outside display margins. 344 /* True means fringes are drawn outside display margins.
345 Otherwise draw them between margin areas and text. */ 345 Otherwise draw them between margin areas and text. */
346 unsigned fringes_outside_margins : 1; 346 bool_bf fringes_outside_margins : 1;
347 347
348 /* Nonzero if window_end_pos and window_end_vpos are truly valid. 348 /* True if window_end_pos and window_end_vpos are truly valid.
349 This is zero if nontrivial redisplay is preempted since in that case 349 This is false if nontrivial redisplay is preempted since in that case
350 the frame image that window_end_pos did not get onto the frame. */ 350 the frame image that window_end_pos did not get onto the frame. */
351 unsigned window_end_valid : 1; 351 bool_bf window_end_valid : 1;
352 352
353 /* True if it needs to be redisplayed. */ 353 /* True if it needs to be redisplayed. */
354 unsigned redisplay : 1; 354 bool_bf redisplay : 1;
355 355
356 /* Amount by which lines of this window are scrolled in 356 /* Amount by which lines of this window are scrolled in
357 y-direction (smooth scrolling). */ 357 y-direction (smooth scrolling). */
358 int vscroll; 358 int vscroll;
359 359
360 /* Z_BYTE - buffer position of the last glyph in the current matrix of W. 360 /* Z_BYTE - buffer position of the last glyph in the current matrix of W.
361 Should be nonnegative, and only valid if window_end_valid is nonzero. */ 361 Should be nonnegative, and only valid if window_end_valid is true. */
362 ptrdiff_t window_end_bytepos; 362 ptrdiff_t window_end_bytepos;
363 }; 363 };
364 364
@@ -412,7 +412,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
412 w->next_buffers = val; 412 w->next_buffers = val;
413} 413}
414 414
415/* 1 if W is a minibuffer window. */ 415/* True if W is a minibuffer window. */
416 416
417#define MINI_WINDOW_P(W) ((W)->mini) 417#define MINI_WINDOW_P(W) ((W)->mini)
418 418
@@ -443,17 +443,17 @@ wset_next_buffers (struct window *w, Lisp_Object val)
443 443
444/* A handy macro. */ 444/* A handy macro. */
445 445
446/* Non-zero if W is leaf (carry the buffer). */ 446/* Non-nil if W is leaf (carry the buffer). */
447 447
448#define WINDOW_LEAF_P(W) \ 448#define WINDOW_LEAF_P(W) \
449 (BUFFERP ((W)->contents)) 449 (BUFFERP ((W)->contents))
450 450
451/* Non-zero if W is a member of horizontal combination. */ 451/* True if W is a member of horizontal combination. */
452 452
453#define WINDOW_HORIZONTAL_COMBINATION_P(W) \ 453#define WINDOW_HORIZONTAL_COMBINATION_P(W) \
454 (WINDOWP ((W)->contents) && (W)->horizontal) 454 (WINDOWP ((W)->contents) && (W)->horizontal)
455 455
456/* Non-zero if W is a member of vertical combination. */ 456/* True if W is a member of vertical combination. */
457 457
458#define WINDOW_VERTICAL_COMBINATION_P(W) \ 458#define WINDOW_VERTICAL_COMBINATION_P(W) \
459 (WINDOWP ((W)->contents) && !(W)->horizontal) 459 (WINDOWP ((W)->contents) && !(W)->horizontal)
@@ -563,7 +563,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
563 (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ 563 (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
564 + WINDOW_RIGHT_PIXEL_EDGE (W)) 564 + WINDOW_RIGHT_PIXEL_EDGE (W))
565 565
566/* 1 if W is a menu bar window. */ 566/* True if W is a menu bar window. */
567 567
568#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) 568#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
569#define WINDOW_MENU_BAR_P(W) \ 569#define WINDOW_MENU_BAR_P(W) \
@@ -571,16 +571,16 @@ wset_next_buffers (struct window *w, Lisp_Object val)
571 && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window)) 571 && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
572#else 572#else
573/* No menu bar windows if X toolkit is in use. */ 573/* No menu bar windows if X toolkit is in use. */
574#define WINDOW_MENU_BAR_P(W) (0) 574#define WINDOW_MENU_BAR_P(W) false
575#endif 575#endif
576 576
577/* 1 if W is a tool bar window. */ 577/* True if W is a tool bar window. */
578#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) 578#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
579#define WINDOW_TOOL_BAR_P(W) \ 579#define WINDOW_TOOL_BAR_P(W) \
580 (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \ 580 (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \
581 && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window)) 581 && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window))
582#else 582#else
583#define WINDOW_TOOL_BAR_P(W) (0) 583#define WINDOW_TOOL_BAR_P(W) false
584#endif 584#endif
585 585
586/* Return the frame y-position at which window W starts. 586/* Return the frame y-position at which window W starts.
@@ -600,24 +600,24 @@ wset_next_buffers (struct window *w, Lisp_Object val)
600 ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \ 600 ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
601 + WINDOW_BOTTOM_PIXEL_EDGE (W)) 601 + WINDOW_BOTTOM_PIXEL_EDGE (W))
602 602
603/* 1 if window W takes up the full width of its frame. */ 603/* True if window W takes up the full width of its frame. */
604#define WINDOW_FULL_WIDTH_P(W) \ 604#define WINDOW_FULL_WIDTH_P(W) \
605 (WINDOW_PIXEL_WIDTH (W) \ 605 (WINDOW_PIXEL_WIDTH (W) \
606 == (WINDOW_PIXEL_WIDTH \ 606 == (WINDOW_PIXEL_WIDTH \
607 (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \ 607 (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \
608 608
609/* 1 if window W's has no other windows to its left in its frame. */ 609/* True if window W's has no other windows to its left in its frame. */
610 610
611#define WINDOW_LEFTMOST_P(W) \ 611#define WINDOW_LEFTMOST_P(W) \
612 (WINDOW_LEFT_PIXEL_EDGE (W) == 0) 612 (WINDOW_LEFT_PIXEL_EDGE (W) == 0)
613 613
614/* 1 if window W's has no other windows to its right in its frame. */ 614/* True if window W's has no other windows to its right in its frame. */
615#define WINDOW_RIGHTMOST_P(W) \ 615#define WINDOW_RIGHTMOST_P(W) \
616 (WINDOW_RIGHT_PIXEL_EDGE (W) \ 616 (WINDOW_RIGHT_PIXEL_EDGE (W) \
617 == (WINDOW_RIGHT_PIXEL_EDGE \ 617 == (WINDOW_RIGHT_PIXEL_EDGE \
618 (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \ 618 (XWINDOW (FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))) \
619 619
620/* 1 if window W's has no other windows below it in its frame 620/* True if window W's has no other windows below it in its frame
621 (the minibuffer window is not counted in this respect). */ 621 (the minibuffer window is not counted in this respect). */
622#define WINDOW_BOTTOMMOST_P(W) \ 622#define WINDOW_BOTTOMMOST_P(W) \
623 (WINDOW_BOTTOM_PIXEL_EDGE (W) \ 623 (WINDOW_BOTTOM_PIXEL_EDGE (W) \
@@ -882,7 +882,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
882#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ 882#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
883 (window_box_left ((W), TEXT_AREA) + (X)) 883 (window_box_left ((W), TEXT_AREA) + (X))
884 884
885/* Nonzero if the background of the window W's fringe that is adjacent to 885/* True if the background of the window W's fringe that is adjacent to
886 a scroll bar is extended to the gap between the fringe and the bar. */ 886 a scroll bar is extended to the gap between the fringe and the bar. */
887 887
888#define WINDOW_FRINGE_EXTENDED_P(w) \ 888#define WINDOW_FRINGE_EXTENDED_P(w) \
diff --git a/src/xdisp.c b/src/xdisp.c
index 3974810908a..97fa0ce5fe7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -984,7 +984,7 @@ static void append_stretch_glyph (struct it *, Lisp_Object,
984 984
985static void produce_special_glyphs (struct it *, enum display_element_type); 985static void produce_special_glyphs (struct it *, enum display_element_type);
986static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face); 986static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
987static int coords_in_mouse_face_p (struct window *, int, int); 987static bool coords_in_mouse_face_p (struct window *, int, int);
988 988
989 989
990 990
@@ -9469,9 +9469,9 @@ move_it_by_lines (struct it *it, ptrdiff_t dvpos)
9469 } 9469 }
9470} 9470}
9471 9471
9472/* Return 1 if IT points into the middle of a display vector. */ 9472/* Return true if IT points into the middle of a display vector. */
9473 9473
9474int 9474bool
9475in_display_vector_p (struct it *it) 9475in_display_vector_p (struct it *it)
9476{ 9476{
9477 return (it->method == GET_FROM_DISPLAY_VECTOR 9477 return (it->method == GET_FROM_DISPLAY_VECTOR
@@ -11939,7 +11939,7 @@ display_tool_bar_line (struct it *it, int height)
11939 11939
11940 /* Don't extend on a previously drawn tool bar items (Bug#16058). */ 11940 /* Don't extend on a previously drawn tool bar items (Bug#16058). */
11941 clear_glyph_row (row); 11941 clear_glyph_row (row);
11942 row->enabled_p = 1; 11942 row->enabled_p = true;
11943 row->y = it->current_y; 11943 row->y = it->current_y;
11944 11944
11945 /* Note that this isn't made use of if the face hasn't a box, 11945 /* Note that this isn't made use of if the face hasn't a box,
@@ -12771,7 +12771,7 @@ static ptrdiff_t debug_delta, debug_delta_bytes;
12771static ptrdiff_t debug_end_vpos; 12771static ptrdiff_t debug_end_vpos;
12772 12772
12773/* Append a string to W->desired_matrix->method. FMT is a printf 12773/* Append a string to W->desired_matrix->method. FMT is a printf
12774 format string. If trace_redisplay_p is non-zero also printf the 12774 format string. If trace_redisplay_p is true also printf the
12775 resulting string to stderr. */ 12775 resulting string to stderr. */
12776 12776
12777static void debug_method_add (struct window *, char const *, ...) 12777static void debug_method_add (struct window *, char const *, ...)
@@ -13556,7 +13556,7 @@ redisplay_internal (void)
13556 13556
13557 cancel: 13557 cancel:
13558 /* Text changed drastically or point moved off of line. */ 13558 /* Text changed drastically or point moved off of line. */
13559 SET_MATRIX_ROW_ENABLED_P (w->desired_matrix, this_line_vpos, 0); 13559 SET_MATRIX_ROW_ENABLED_P (w->desired_matrix, this_line_vpos, false);
13560 } 13560 }
13561 13561
13562 CHARPOS (this_line_start_pos) = 0; 13562 CHARPOS (this_line_start_pos) = 0;
@@ -16742,7 +16742,7 @@ try_window_reusing_current_matrix (struct window *w)
16742 16742
16743 /* Disable lines that must be updated. */ 16743 /* Disable lines that must be updated. */
16744 for (i = 0; i < nrows_scrolled; ++i) 16744 for (i = 0; i < nrows_scrolled; ++i)
16745 (start_row + i)->enabled_p = 0; 16745 (start_row + i)->enabled_p = false;
16746 16746
16747 /* Re-compute Y positions. */ 16747 /* Re-compute Y positions. */
16748 min_y = WINDOW_HEADER_LINE_HEIGHT (w); 16748 min_y = WINDOW_HEADER_LINE_HEIGHT (w);
@@ -16922,7 +16922,7 @@ try_window_reusing_current_matrix (struct window *w)
16922 16922
16923 /* Disable rows not reused. */ 16923 /* Disable rows not reused. */
16924 for (row -= nrows_scrolled; row < bottom_row; ++row) 16924 for (row -= nrows_scrolled; row < bottom_row; ++row)
16925 row->enabled_p = 0; 16925 row->enabled_p = false;
16926 16926
16927 /* Point may have moved to a different line, so we cannot assume that 16927 /* Point may have moved to a different line, so we cannot assume that
16928 the previous cursor position is valid; locate the correct row. */ 16928 the previous cursor position is valid; locate the correct row. */
@@ -17207,7 +17207,7 @@ sync_frame_with_window_matrix_rows (struct window *w)
17207 /* Disable frame rows whose corresponding window rows have 17207 /* Disable frame rows whose corresponding window rows have
17208 been disabled in try_window_id. */ 17208 been disabled in try_window_id. */
17209 if (!window_row->enabled_p) 17209 if (!window_row->enabled_p)
17210 frame_row->enabled_p = 0; 17210 frame_row->enabled_p = false;
17211 17211
17212 ++window_row, ++frame_row; 17212 ++window_row, ++frame_row;
17213 } 17213 }
@@ -17950,7 +17950,7 @@ try_window_id (struct window *w)
17950 the current matrix? I don't think so, so we mark rows 17950 the current matrix? I don't think so, so we mark rows
17951 displayed invalid in the current matrix by setting their 17951 displayed invalid in the current matrix by setting their
17952 enabled_p flag to zero. */ 17952 enabled_p flag to zero. */
17953 MATRIX_ROW (w->current_matrix, it.vpos)->enabled_p = 0; 17953 SET_MATRIX_ROW_ENABLED_P (w->current_matrix, it.vpos, false);
17954 if (display_line (&it)) 17954 if (display_line (&it))
17955 last_text_row_at_end = it.glyph_row - 1; 17955 last_text_row_at_end = it.glyph_row - 1;
17956 } 17956 }
@@ -20773,7 +20773,7 @@ display_menu_bar (struct window *w)
20773 { 20773 {
20774 struct glyph_row *row = it.glyph_row + i; 20774 struct glyph_row *row = it.glyph_row + i;
20775 clear_glyph_row (row); 20775 clear_glyph_row (row);
20776 row->enabled_p = 1; 20776 row->enabled_p = true;
20777 row->full_width_p = 1; 20777 row->full_width_p = 1;
20778 } 20778 }
20779 20779
@@ -20883,7 +20883,7 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
20883 row->full_width_p = 1; 20883 row->full_width_p = 1;
20884 saved_reversed = row->reversed_p; 20884 saved_reversed = row->reversed_p;
20885 row->reversed_p = 0; 20885 row->reversed_p = 0;
20886 row->enabled_p = 1; 20886 row->enabled_p = true;
20887 20887
20888 /* Arrange for the menu item glyphs to start at (X,Y) and have the 20888 /* Arrange for the menu item glyphs to start at (X,Y) and have the
20889 desired face. */ 20889 desired face. */
@@ -21049,7 +21049,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
21049 init_iterator (&it, w, -1, -1, NULL, face_id); 21049 init_iterator (&it, w, -1, -1, NULL, face_id);
21050 /* Don't extend on a previously drawn mode-line. 21050 /* Don't extend on a previously drawn mode-line.
21051 This may happen if called from pos_visible_p. */ 21051 This may happen if called from pos_visible_p. */
21052 it.glyph_row->enabled_p = 0; 21052 it.glyph_row->enabled_p = false;
21053 prepare_desired_row (it.glyph_row); 21053 prepare_desired_row (it.glyph_row);
21054 21054
21055 it.glyph_row->mode_line_p = 1; 21055 it.glyph_row->mode_line_p = 1;
@@ -27088,9 +27088,9 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
27088 return cleared; 27088 return cleared;
27089} 27089}
27090 27090
27091/* Return non-zero if the coordinates HPOS and VPOS on windows W are 27091/* Return true if the coordinates HPOS and VPOS on windows W are
27092 within the mouse face on that window. */ 27092 within the mouse face on that window. */
27093static int 27093static bool
27094coords_in_mouse_face_p (struct window *w, int hpos, int vpos) 27094coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
27095{ 27095{
27096 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); 27096 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
@@ -27098,48 +27098,48 @@ coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
27098 /* Quickly resolve the easy cases. */ 27098 /* Quickly resolve the easy cases. */
27099 if (!(WINDOWP (hlinfo->mouse_face_window) 27099 if (!(WINDOWP (hlinfo->mouse_face_window)
27100 && XWINDOW (hlinfo->mouse_face_window) == w)) 27100 && XWINDOW (hlinfo->mouse_face_window) == w))
27101 return 0; 27101 return false;
27102 if (vpos < hlinfo->mouse_face_beg_row 27102 if (vpos < hlinfo->mouse_face_beg_row
27103 || vpos > hlinfo->mouse_face_end_row) 27103 || vpos > hlinfo->mouse_face_end_row)
27104 return 0; 27104 return false;
27105 if (vpos > hlinfo->mouse_face_beg_row 27105 if (vpos > hlinfo->mouse_face_beg_row
27106 && vpos < hlinfo->mouse_face_end_row) 27106 && vpos < hlinfo->mouse_face_end_row)
27107 return 1; 27107 return true;
27108 27108
27109 if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p) 27109 if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p)
27110 { 27110 {
27111 if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row) 27111 if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row)
27112 { 27112 {
27113 if (hlinfo->mouse_face_beg_col <= hpos && hpos < hlinfo->mouse_face_end_col) 27113 if (hlinfo->mouse_face_beg_col <= hpos && hpos < hlinfo->mouse_face_end_col)
27114 return 1; 27114 return true;
27115 } 27115 }
27116 else if ((vpos == hlinfo->mouse_face_beg_row 27116 else if ((vpos == hlinfo->mouse_face_beg_row
27117 && hpos >= hlinfo->mouse_face_beg_col) 27117 && hpos >= hlinfo->mouse_face_beg_col)
27118 || (vpos == hlinfo->mouse_face_end_row 27118 || (vpos == hlinfo->mouse_face_end_row
27119 && hpos < hlinfo->mouse_face_end_col)) 27119 && hpos < hlinfo->mouse_face_end_col))
27120 return 1; 27120 return true;
27121 } 27121 }
27122 else 27122 else
27123 { 27123 {
27124 if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row) 27124 if (hlinfo->mouse_face_beg_row == hlinfo->mouse_face_end_row)
27125 { 27125 {
27126 if (hlinfo->mouse_face_end_col < hpos && hpos <= hlinfo->mouse_face_beg_col) 27126 if (hlinfo->mouse_face_end_col < hpos && hpos <= hlinfo->mouse_face_beg_col)
27127 return 1; 27127 return true;
27128 } 27128 }
27129 else if ((vpos == hlinfo->mouse_face_beg_row 27129 else if ((vpos == hlinfo->mouse_face_beg_row
27130 && hpos <= hlinfo->mouse_face_beg_col) 27130 && hpos <= hlinfo->mouse_face_beg_col)
27131 || (vpos == hlinfo->mouse_face_end_row 27131 || (vpos == hlinfo->mouse_face_end_row
27132 && hpos > hlinfo->mouse_face_end_col)) 27132 && hpos > hlinfo->mouse_face_end_col))
27133 return 1; 27133 return true;
27134 } 27134 }
27135 return 0; 27135 return false;
27136} 27136}
27137 27137
27138 27138
27139/* EXPORT: 27139/* EXPORT:
27140 Non-zero if physical cursor of window W is within mouse face. */ 27140 True if physical cursor of window W is within mouse face. */
27141 27141
27142int 27142bool
27143cursor_in_mouse_face_p (struct window *w) 27143cursor_in_mouse_face_p (struct window *w)
27144{ 27144{
27145 int hpos = w->phys_cursor.hpos; 27145 int hpos = w->phys_cursor.hpos;
diff --git a/src/xmenu.c b/src/xmenu.c
index fb3baa01ef4..216772edcd8 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1647,7 +1647,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
1647#endif 1647#endif
1648 1648
1649 wv_title->name = SSDATA (title); 1649 wv_title->name = SSDATA (title);
1650 wv_title->enabled = TRUE; 1650 wv_title->enabled = true;
1651 wv_title->button_type = BUTTON_TYPE_NONE; 1651 wv_title->button_type = BUTTON_TYPE_NONE;
1652 wv_title->help = Qnil; 1652 wv_title->help = Qnil;
1653 wv_title->next = wv_sep1; 1653 wv_title->next = wv_sep1;
diff --git a/src/xterm.c b/src/xterm.c
index 8498382511b..20157acca2e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -133,9 +133,9 @@ extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
133 133
134/* Default to using XIM if available. */ 134/* Default to using XIM if available. */
135#ifdef USE_XIM 135#ifdef USE_XIM
136int use_xim = 1; 136bool use_xim = true;
137#else 137#else
138int use_xim = 0; /* configure --without-xim */ 138bool use_xim = false; /* configure --without-xim */
139#endif 139#endif
140 140
141/* Non-zero means that a HELP_EVENT has been generated since Emacs 141/* Non-zero means that a HELP_EVENT has been generated since Emacs
@@ -6172,7 +6172,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6172#ifdef USE_GTK 6172#ifdef USE_GTK
6173 /* Don't pass keys to GTK. A Tab will shift focus to the 6173 /* Don't pass keys to GTK. A Tab will shift focus to the
6174 tool bar in GTK 2.4. Keys will still go to menus and 6174 tool bar in GTK 2.4. Keys will still go to menus and
6175 dialogs because in that case popup_activated is TRUE 6175 dialogs because in that case popup_activated is nonzero
6176 (see above). */ 6176 (see above). */
6177 *finish = X_EVENT_DROP; 6177 *finish = X_EVENT_DROP;
6178#endif 6178#endif
@@ -10092,12 +10092,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10092 if (STRINGP (value) 10092 if (STRINGP (value)
10093 && (!strcmp (SSDATA (value), "false") 10093 && (!strcmp (SSDATA (value), "false")
10094 || !strcmp (SSDATA (value), "off"))) 10094 || !strcmp (SSDATA (value), "off")))
10095 use_xim = 0; 10095 use_xim = false;
10096#else 10096#else
10097 if (STRINGP (value) 10097 if (STRINGP (value)
10098 && (!strcmp (SSDATA (value), "true") 10098 && (!strcmp (SSDATA (value), "true")
10099 || !strcmp (SSDATA (value), "on"))) 10099 || !strcmp (SSDATA (value), "on")))
10100 use_xim = 1; 10100 use_xim = true;
10101#endif 10101#endif
10102 } 10102 }
10103 10103
diff --git a/src/xterm.h b/src/xterm.h
index eff75403476..e79eecadc34 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -50,7 +50,7 @@ typedef GtkWidget *xt_or_gtk_widget;
50#define XtParent(x) (gtk_widget_get_parent (x)) 50#define XtParent(x) (gtk_widget_get_parent (x))
51#undef XSync 51#undef XSync
52#define XSync(d, b) do { gdk_window_process_all_updates (); \ 52#define XSync(d, b) do { gdk_window_process_all_updates (); \
53 XSync (d, b); } while (0) 53 XSync (d, b); } while (false)
54#endif /* USE_GTK */ 54#endif /* USE_GTK */
55 55
56/* True iff GTK's version is at least I.J.K. */ 56/* True iff GTK's version is at least I.J.K. */
@@ -62,7 +62,7 @@ typedef GtkWidget *xt_or_gtk_widget;
62 < GTK_MINOR_VERSION + ((k) \ 62 < GTK_MINOR_VERSION + ((k) \
63 <= GTK_MICRO_VERSION))) 63 <= GTK_MICRO_VERSION)))
64# else 64# else
65# define GTK_CHECK_VERSION(i, j, k) 0 65# define GTK_CHECK_VERSION(i, j, k) false
66# endif 66# endif
67#endif 67#endif
68 68
@@ -115,7 +115,7 @@ struct xim_inst_t
115struct x_bitmap_record 115struct x_bitmap_record
116{ 116{
117 Pixmap pixmap; 117 Pixmap pixmap;
118 int have_mask; 118 bool have_mask;
119 Pixmap mask; 119 Pixmap mask;
120 char *file; 120 char *file;
121 int refcount; 121 int refcount;
@@ -400,7 +400,7 @@ struct x_display_info
400 400
401#ifdef HAVE_X_I18N 401#ifdef HAVE_X_I18N
402/* Whether or not to use XIM if we have it. */ 402/* Whether or not to use XIM if we have it. */
403extern int use_xim; 403extern bool use_xim;
404#endif 404#endif
405 405
406/* This is a chain of structures for all the X displays currently in use. */ 406/* This is a chain of structures for all the X displays currently in use. */
@@ -488,9 +488,9 @@ struct x_output
488/* The handle box that makes the tool bar detachable. */ 488/* The handle box that makes the tool bar detachable. */
489 GtkWidget *handlebox_widget; 489 GtkWidget *handlebox_widget;
490#endif 490#endif
491 /* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */ 491 /* True if tool bar is packed into the hbox widget (i.e. vertical). */
492 bool toolbar_in_hbox; 492 bool_bf toolbar_in_hbox : 1;
493 bool toolbar_is_packed; 493 bool_bf toolbar_is_packed : 1;
494 494
495 /* The last size hints set. */ 495 /* The last size hints set. */
496 GdkGeometry size_hints; 496 GdkGeometry size_hints;
@@ -551,9 +551,6 @@ struct x_output
551 mapped to display an hourglass cursor. */ 551 mapped to display an hourglass cursor. */
552 Window hourglass_window; 552 Window hourglass_window;
553 553
554 /* Non-zero means hourglass cursor is currently displayed. */
555 unsigned hourglass_p : 1;
556
557 /* These are the current window manager hints. It seems that 554 /* These are the current window manager hints. It seems that
558 XSetWMHints, when presented with an unset bit in the `flags' 555 XSetWMHints, when presented with an unset bit in the `flags'
559 member of the hints structure, does not leave the corresponding 556 member of the hints structure, does not leave the corresponding
@@ -579,15 +576,28 @@ struct x_output
579 int id; 576 int id;
580#endif 577#endif
581 578
582 /* Nonzero means our parent is another application's window 579 /* True means hourglass cursor is currently displayed. */
580 bool_bf hourglass_p : 1;
581
582 /* True means our parent is another application's window
583 and was explicitly specified. */ 583 and was explicitly specified. */
584 unsigned explicit_parent : 1; 584 bool_bf explicit_parent : 1;
585
586 /* True means tried already to make this frame visible. */
587 bool_bf asked_for_visible : 1;
588
589 /* True if this frame was ever previously visible. */
590 bool_bf has_been_visible : 1;
585 591
586 /* Nonzero means tried already to make this frame visible. */ 592 /* Xt waits for a ConfigureNotify event from the window manager in
587 unsigned asked_for_visible : 1; 593 EmacsFrameSetCharSize when the shell widget is resized. For some
594 window managers like fvwm2 2.2.5 and KDE 2.1 this event doesn't
595 arrive for an unknown reason and Emacs hangs in Xt. If this is
596 false, tell Xt not to wait. */
597 bool_bf wait_for_wm : 1;
588 598
589 /* Nonzero if this frame was ever previously visible. */ 599 /* True if _NET_WM_STATE_HIDDEN is set for this frame. */
590 unsigned has_been_visible : 1; 600 bool_bf net_wm_state_hidden_seen : 1;
591 601
592#ifdef HAVE_X_I18N 602#ifdef HAVE_X_I18N
593 /* Input context (currently, this means Compose key handler setup). */ 603 /* Input context (currently, this means Compose key handler setup). */
@@ -608,13 +618,6 @@ struct x_output
608 They are changed only when a different background is involved. */ 618 They are changed only when a different background is involved. */
609 unsigned long relief_background; 619 unsigned long relief_background;
610 620
611 /* Xt waits for a ConfigureNotify event from the window manager in
612 EmacsFrameSetCharSize when the shell widget is resized. For some
613 window managers like fvwm2 2.2.5 and KDE 2.1 this event doesn't
614 arrive for an unknown reason and Emacs hangs in Xt. If this is
615 zero, tell Xt not to wait. */
616 int wait_for_wm;
617
618 /* As x_pixels_diff, but to FRAME_OUTER_WINDOW. For some reason the 621 /* As x_pixels_diff, but to FRAME_OUTER_WINDOW. For some reason the
619 two might differ by a pixel, depending on WM */ 622 two might differ by a pixel, depending on WM */
620 int x_pixels_outer_diff; 623 int x_pixels_outer_diff;
@@ -632,9 +635,6 @@ struct x_output
632 /* The offset we need to add to compensate for type A WMs. */ 635 /* The offset we need to add to compensate for type A WMs. */
633 int move_offset_top; 636 int move_offset_top;
634 int move_offset_left; 637 int move_offset_left;
635
636 /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */
637 unsigned net_wm_state_hidden_seen : 1;
638}; 638};
639 639
640#define No_Cursor (None) 640#define No_Cursor (None)
@@ -827,7 +827,7 @@ struct scroll_bar
827 do { \ 827 do { \
828 Window window = XtWindow (w); \ 828 Window window = XtWindow (w); \
829 ptr->x_window = window; \ 829 ptr->x_window = window; \
830} while (0) 830 } while (false)
831 831
832#endif /* USE_X_TOOLKIT */ 832#endif /* USE_X_TOOLKIT */
833 833