aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-12-14 13:36:44 -0800
committerPaul Eggert2013-12-14 13:36:44 -0800
commit96c0686368d8b7d481cb40239db896ff37df416a (patch)
tree84d8ee02271476dd4aaaee52c5302f2c576089ef
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.
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac8
-rw-r--r--lib-src/ChangeLog18
-rw-r--r--lib-src/emacsclient.c92
-rw-r--r--lib-src/etags.c574
-rw-r--r--lib-src/hexl.c18
-rw-r--r--lib-src/pop.c12
-rw-r--r--lib-src/pop.h7
-rw-r--r--lwlib/ChangeLog5
-rw-r--r--lwlib/xlwmenuP.h4
-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
52 files changed, 1242 insertions, 1110 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c676d1cdfd..ba36b72f739 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12013-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use bool for boolean, focusing on headers.
4 * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
5 Use bool for boolean.
6
12013-12-14 Dani Moncayo <dmoncayo@gmail.com> 72013-12-14 Dani Moncayo <dmoncayo@gmail.com>
2 8
3 * configure.ac (srcdir) [MINGW32]: Convert to an absolute MSYS 9 * configure.ac (srcdir) [MINGW32]: Convert to an absolute MSYS
diff --git a/configure.ac b/configure.ac
index 2e9eee6b367..9e4ef127534 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4067,7 +4067,7 @@ case $opsys in
4067 cygwin ) 4067 cygwin )
4068 AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)]) 4068 AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
4069 dnl multi-line AC_DEFINEs are hard. :( 4069 dnl multi-line AC_DEFINEs are hard. :(
4070 AC_DEFINE(PTY_OPEN, [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (0)]) 4070 AC_DEFINE(PTY_OPEN, [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (false)])
4071 AC_DEFINE(PTY_NAME_SPRINTF, []) 4071 AC_DEFINE(PTY_NAME_SPRINTF, [])
4072 AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) 4072 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
4073 ;; 4073 ;;
@@ -4080,7 +4080,7 @@ case $opsys in
4080 dnl Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8. 4080 dnl Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
4081 dnl But we don't have to block SIGCHLD because it is blocked in the 4081 dnl But we don't have to block SIGCHLD because it is blocked in the
4082 dnl implementation of grantpt. 4082 dnl implementation of grantpt.
4083 AC_DEFINE(PTY_OPEN, [ do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (0)]) 4083 AC_DEFINE(PTY_OPEN, [ do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (false)])
4084 AC_DEFINE(PTY_NAME_SPRINTF, []) 4084 AC_DEFINE(PTY_NAME_SPRINTF, [])
4085 AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) 4085 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
4086 ;; 4086 ;;
@@ -4099,7 +4099,7 @@ case $opsys in
4099 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) 4099 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
4100 dnl if HAVE_POSIX_OPENPT 4100 dnl if HAVE_POSIX_OPENPT
4101 if test "x$ac_cv_func_posix_openpt" = xyes; then 4101 if test "x$ac_cv_func_posix_openpt" = xyes; then
4102 AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (0)]) 4102 AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)])
4103 AC_DEFINE(PTY_NAME_SPRINTF, []) 4103 AC_DEFINE(PTY_NAME_SPRINTF, [])
4104 dnl if HAVE_GETPT 4104 dnl if HAVE_GETPT
4105 elif test "x$ac_cv_func_getpt" = xyes; then 4105 elif test "x$ac_cv_func_getpt" = xyes; then
@@ -4232,7 +4232,7 @@ case $opsys in
4232# error "not ia64" 4232# error "not ia64"
4233#endif 4233#endif
4234 ]], [[]])], AC_DEFINE(GC_MARK_SECONDARY_STACK(), 4234 ]], [[]])], AC_DEFINE(GC_MARK_SECONDARY_STACK(),
4235 [do { extern void *__libc_ia64_register_backing_store_base; __builtin_ia64_flushrs (); mark_memory (__libc_ia64_register_backing_store_base, __builtin_ia64_bsp ());} while (0)], 4235 [do { extern void *__libc_ia64_register_backing_store_base; __builtin_ia64_flushrs (); mark_memory (__libc_ia64_register_backing_store_base, __builtin_ia64_bsp ());} while (false)],
4236 [Mark a secondary stack, like the register stack on the ia64.]), []) 4236 [Mark a secondary stack, like the register stack on the ia64.]), [])
4237 ;; 4237 ;;
4238 4238
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 2010444743a..d7442e51fdd 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,21 @@
12013-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use bool for boolean, focusing on headers.
4 * emacsclient.c, etags.c, hexl.c (FALSE, TRUE):
5 Remove. All uses replaced with uncapitalized version.
6 * emacsclient.c (message):
7 * etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
8 * hexl.c (un_flag, iso_flag, endian):
9 * pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
10 (pop_trash):
11 Use bool for boolean.
12 * etags.c (bool): Remove.
13 * etags.c (globals, members, declarations, no_line_directive)
14 (no_duplicates): Use 'int' for boolean values that getopt requires
15 to be 'int'. Formerly, these were 'bool' and 'bool' was 'int',
16 but we can no longer rely on this implementation.
17 * pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
18
12013-11-14 Paul Eggert <eggert@cs.ucla.edu> 192013-11-14 Paul Eggert <eggert@cs.ucla.edu>
2 20
3 * ebrowse.c (xstrdup): 21 * ebrowse.c (xstrdup):
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 74ccfa26259..42958fe6b56 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -103,14 +103,6 @@ char *getenv (const char *);
103#define EXIT_FAILURE 1 103#define EXIT_FAILURE 1
104#endif 104#endif
105 105
106#ifndef FALSE
107#define FALSE 0
108#endif
109
110#ifndef TRUE
111#define TRUE 1
112#endif
113
114/* Additional space when allocating buffers for filenames, etc. */ 106/* Additional space when allocating buffers for filenames, etc. */
115#define EXTRA_SPACE 100 107#define EXTRA_SPACE 100
116 108
@@ -433,9 +425,9 @@ ttyname (int fd)
433 425
434/* Display a normal or error message. 426/* Display a normal or error message.
435 On Windows, use a message box if compiled as a Windows app. */ 427 On Windows, use a message box if compiled as a Windows app. */
436static void message (int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); 428static void message (bool, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3);
437static void 429static void
438message (int is_error, const char *format, ...) 430message (bool is_error, const char *format, ...)
439{ 431{
440 va_list args; 432 va_list args;
441 433
@@ -528,7 +520,7 @@ decode_options (int argc, char **argv)
528 break; 520 break;
529 521
530 case 'V': 522 case 'V':
531 message (FALSE, "emacsclient %s\n", VERSION); 523 message (false, "emacsclient %s\n", VERSION);
532 exit (EXIT_SUCCESS); 524 exit (EXIT_SUCCESS);
533 break; 525 break;
534 526
@@ -555,7 +547,7 @@ decode_options (int argc, char **argv)
555 break; 547 break;
556 548
557 default: 549 default:
558 message (TRUE, "Try `%s --help' for more information\n", progname); 550 message (true, "Try `%s --help' for more information\n", progname);
559 exit (EXIT_FAILURE); 551 exit (EXIT_FAILURE);
560 break; 552 break;
561 } 553 }
@@ -614,7 +606,7 @@ decode_options (int argc, char **argv)
614 606
615 if (alternate_editor && alternate_editor[0] == '\0') 607 if (alternate_editor && alternate_editor[0] == '\0')
616 { 608 {
617 message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\ 609 message (true, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\
618an empty string"); 610an empty string");
619 exit (EXIT_FAILURE); 611 exit (EXIT_FAILURE);
620 } 612 }
@@ -629,7 +621,7 @@ print_help_and_exit (void)
629 message aligns properly both in a tty and in a Windows message box. 621 message aligns properly both in a tty and in a Windows message box.
630 Please try to preserve them; otherwise the output is very hard to read 622 Please try to preserve them; otherwise the output is very hard to read
631 when using emacsclientw. */ 623 when using emacsclientw. */
632 message (FALSE, 624 message (false,
633 "Usage: %s [OPTIONS] FILE...\n%s%s%s", progname, "\ 625 "Usage: %s [OPTIONS] FILE...\n%s%s%s", progname, "\
634Tell the Emacs server to visit the specified files.\n\ 626Tell the Emacs server to visit the specified files.\n\
635Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ 627Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
@@ -679,7 +671,7 @@ fail (void)
679 int i = optind - 1; 671 int i = optind - 1;
680 672
681 execvp (alternate_editor, main_argv + i); 673 execvp (alternate_editor, main_argv + i);
682 message (TRUE, "%s: error executing alternate editor \"%s\"\n", 674 message (true, "%s: error executing alternate editor \"%s\"\n",
683 progname, alternate_editor); 675 progname, alternate_editor);
684 } 676 }
685 exit (EXIT_FAILURE); 677 exit (EXIT_FAILURE);
@@ -693,7 +685,7 @@ main (int argc, char **argv)
693{ 685{
694 main_argv = argv; 686 main_argv = argv;
695 progname = argv[0]; 687 progname = argv[0];
696 message (TRUE, "%s: Sorry, the Emacs server is supported only\n" 688 message (true, "%s: Sorry, the Emacs server is supported only\n"
697 "on systems with Berkeley sockets.\n", 689 "on systems with Berkeley sockets.\n",
698 argv[0]); 690 argv[0]);
699 fail (); 691 fail ();
@@ -724,11 +716,11 @@ sock_err_message (const char *function_name)
724 | FORMAT_MESSAGE_ARGUMENT_ARRAY, 716 | FORMAT_MESSAGE_ARGUMENT_ARRAY,
725 NULL, WSAGetLastError (), 0, (LPTSTR)&msg, 0, NULL); 717 NULL, WSAGetLastError (), 0, (LPTSTR)&msg, 0, NULL);
726 718
727 message (TRUE, "%s: %s: %s\n", progname, function_name, msg); 719 message (true, "%s: %s: %s\n", progname, function_name, msg);
728 720
729 LocalFree (msg); 721 LocalFree (msg);
730#else 722#else
731 message (TRUE, "%s: %s: %s\n", progname, function_name, strerror (errno)); 723 message (true, "%s: %s: %s\n", progname, function_name, strerror (errno));
732#endif 724#endif
733} 725}
734 726
@@ -759,7 +751,7 @@ send_to_emacs (HSOCKET s, const char *data)
759 int sent = send (s, send_buffer, sblen, 0); 751 int sent = send (s, send_buffer, sblen, 0);
760 if (sent < 0) 752 if (sent < 0)
761 { 753 {
762 message (TRUE, "%s: failed to send %d bytes to socket: %s\n", 754 message (true, "%s: failed to send %d bytes to socket: %s\n",
763 progname, sblen, strerror (errno)); 755 progname, sblen, strerror (errno));
764 fail (); 756 fail ();
765 } 757 }
@@ -854,25 +846,25 @@ static int
854file_name_absolute_p (const char *filename) 846file_name_absolute_p (const char *filename)
855{ 847{
856 /* Sanity check, it shouldn't happen. */ 848 /* Sanity check, it shouldn't happen. */
857 if (! filename) return FALSE; 849 if (! filename) return false;
858 850
859 /* /xxx is always an absolute path. */ 851 /* /xxx is always an absolute path. */
860 if (filename[0] == '/') return TRUE; 852 if (filename[0] == '/') return true;
861 853
862 /* Empty filenames (which shouldn't happen) are relative. */ 854 /* Empty filenames (which shouldn't happen) are relative. */
863 if (filename[0] == '\0') return FALSE; 855 if (filename[0] == '\0') return false;
864 856
865#ifdef WINDOWSNT 857#ifdef WINDOWSNT
866 /* X:\xxx is always absolute. */ 858 /* X:\xxx is always absolute. */
867 if (isalpha ((unsigned char) filename[0]) 859 if (isalpha ((unsigned char) filename[0])
868 && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/')) 860 && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/'))
869 return TRUE; 861 return true;
870 862
871 /* Both \xxx and \\xxx\yyy are absolute. */ 863 /* Both \xxx and \\xxx\yyy are absolute. */
872 if (filename[0] == '\\') return TRUE; 864 if (filename[0] == '\\') return true;
873#endif 865#endif
874 866
875 return FALSE; 867 return false;
876} 868}
877 869
878#ifdef WINDOWSNT 870#ifdef WINDOWSNT
@@ -891,7 +883,7 @@ initialize_sockets (void)
891 883
892 if (WSAStartup (MAKEWORD (2, 0), &wsaData)) 884 if (WSAStartup (MAKEWORD (2, 0), &wsaData))
893 { 885 {
894 message (TRUE, "%s: error initializing WinSock2\n", progname); 886 message (true, "%s: error initializing WinSock2\n", progname);
895 exit (EXIT_FAILURE); 887 exit (EXIT_FAILURE);
896 } 888 }
897 889
@@ -942,14 +934,14 @@ get_server_config (const char *config_file, struct sockaddr_in *server,
942 } 934 }
943 935
944 if (! config) 936 if (! config)
945 return FALSE; 937 return false;
946 938
947 if (fgets (dotted, sizeof dotted, config) 939 if (fgets (dotted, sizeof dotted, config)
948 && (port = strchr (dotted, ':'))) 940 && (port = strchr (dotted, ':')))
949 *port++ = '\0'; 941 *port++ = '\0';
950 else 942 else
951 { 943 {
952 message (TRUE, "%s: invalid configuration info\n", progname); 944 message (true, "%s: invalid configuration info\n", progname);
953 exit (EXIT_FAILURE); 945 exit (EXIT_FAILURE);
954 } 946 }
955 947
@@ -959,13 +951,13 @@ get_server_config (const char *config_file, struct sockaddr_in *server,
959 951
960 if (! fread (authentication, AUTH_KEY_LENGTH, 1, config)) 952 if (! fread (authentication, AUTH_KEY_LENGTH, 1, config))
961 { 953 {
962 message (TRUE, "%s: cannot read authentication info\n", progname); 954 message (true, "%s: cannot read authentication info\n", progname);
963 exit (EXIT_FAILURE); 955 exit (EXIT_FAILURE);
964 } 956 }
965 957
966 fclose (config); 958 fclose (config);
967 959
968 return TRUE; 960 return true;
969} 961}
970 962
971static HSOCKET 963static HSOCKET
@@ -980,7 +972,7 @@ set_tcp_socket (const char *local_server_file)
980 return INVALID_SOCKET; 972 return INVALID_SOCKET;
981 973
982 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet) 974 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet)
983 message (FALSE, "%s: connected to remote socket at %s\n", 975 message (false, "%s: connected to remote socket at %s\n",
984 progname, inet_ntoa (server.sin_addr)); 976 progname, inet_ntoa (server.sin_addr));
985 977
986 /* Open up an AF_INET socket. */ 978 /* Open up an AF_INET socket. */
@@ -1033,7 +1025,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort)
1033 return 0; 1025 return 0;
1034 else 1026 else
1035 { 1027 {
1036 message (TRUE, "%s: could not get terminal name\n", progname); 1028 message (true, "%s: could not get terminal name\n", progname);
1037 fail (); 1029 fail ();
1038 } 1030 }
1039 } 1031 }
@@ -1044,7 +1036,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort)
1044 return 0; 1036 return 0;
1045 else 1037 else
1046 { 1038 {
1047 message (TRUE, "%s: please set the TERM variable to your terminal type\n", 1039 message (true, "%s: please set the TERM variable to your terminal type\n",
1048 progname); 1040 progname);
1049 fail (); 1041 fail ();
1050 } 1042 }
@@ -1057,7 +1049,7 @@ find_tty (const char **tty_type, const char **tty_name, int noabort)
1057 else 1049 else
1058 { 1050 {
1059 /* This causes nasty, MULTI_KBOARD-related input lockouts. */ 1051 /* This causes nasty, MULTI_KBOARD-related input lockouts. */
1060 message (TRUE, "%s: opening a frame in an Emacs term buffer" 1052 message (true, "%s: opening a frame in an Emacs term buffer"
1061 " is not supported\n", progname); 1053 " is not supported\n", progname);
1062 fail (); 1054 fail ();
1063 } 1055 }
@@ -1188,7 +1180,7 @@ set_local_socket (const char *local_socket_name)
1188 /* Open up an AF_UNIX socket in this person's home directory. */ 1180 /* Open up an AF_UNIX socket in this person's home directory. */
1189 if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) 1181 if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
1190 { 1182 {
1191 message (TRUE, "%s: socket: %s\n", progname, strerror (errno)); 1183 message (true, "%s: socket: %s\n", progname, strerror (errno));
1192 return INVALID_SOCKET; 1184 return INVALID_SOCKET;
1193 } 1185 }
1194 1186
@@ -1239,7 +1231,7 @@ set_local_socket (const char *local_socket_name)
1239 strcpy (server.sun_path, local_socket_name); 1231 strcpy (server.sun_path, local_socket_name);
1240 else 1232 else
1241 { 1233 {
1242 message (TRUE, "%s: socket-name %s too long\n", 1234 message (true, "%s: socket-name %s too long\n",
1243 progname, local_socket_name); 1235 progname, local_socket_name);
1244 fail (); 1236 fail ();
1245 } 1237 }
@@ -1278,7 +1270,7 @@ set_local_socket (const char *local_socket_name)
1278 strcpy (server.sun_path, user_socket_name); 1270 strcpy (server.sun_path, user_socket_name);
1279 else 1271 else
1280 { 1272 {
1281 message (TRUE, "%s: socket-name %s too long\n", 1273 message (true, "%s: socket-name %s too long\n",
1282 progname, user_socket_name); 1274 progname, user_socket_name);
1283 exit (EXIT_FAILURE); 1275 exit (EXIT_FAILURE);
1284 } 1276 }
@@ -1302,7 +1294,7 @@ set_local_socket (const char *local_socket_name)
1302 we are root. */ 1294 we are root. */
1303 if (0 != geteuid ()) 1295 if (0 != geteuid ())
1304 { 1296 {
1305 message (TRUE, "%s: Invalid socket owner\n", progname); 1297 message (true, "%s: Invalid socket owner\n", progname);
1306 return INVALID_SOCKET; 1298 return INVALID_SOCKET;
1307 } 1299 }
1308 break; 1300 break;
@@ -1310,12 +1302,12 @@ set_local_socket (const char *local_socket_name)
1310 case 2: 1302 case 2:
1311 /* `stat' failed */ 1303 /* `stat' failed */
1312 if (saved_errno == ENOENT) 1304 if (saved_errno == ENOENT)
1313 message (TRUE, 1305 message (true,
1314 "%s: can't find socket; have you started the server?\n\ 1306 "%s: can't find socket; have you started the server?\n\
1315To start the server in Emacs, type \"M-x server-start\".\n", 1307To start the server in Emacs, type \"M-x server-start\".\n",
1316 progname); 1308 progname);
1317 else 1309 else
1318 message (TRUE, "%s: can't stat %s: %s\n", 1310 message (true, "%s: can't stat %s: %s\n",
1319 progname, server.sun_path, strerror (saved_errno)); 1311 progname, server.sun_path, strerror (saved_errno));
1320 return INVALID_SOCKET; 1312 return INVALID_SOCKET;
1321 } 1313 }
@@ -1324,7 +1316,7 @@ To start the server in Emacs, type \"M-x server-start\".\n",
1324 if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2) 1316 if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2)
1325 < 0) 1317 < 0)
1326 { 1318 {
1327 message (TRUE, "%s: connect: %s\n", progname, strerror (errno)); 1319 message (true, "%s: connect: %s\n", progname, strerror (errno));
1328 return INVALID_SOCKET; 1320 return INVALID_SOCKET;
1329 } 1321 }
1330 1322
@@ -1347,7 +1339,7 @@ set_socket (int no_exit_if_error)
1347 s = set_local_socket (socket_name); 1339 s = set_local_socket (socket_name);
1348 if ((s != INVALID_SOCKET) || no_exit_if_error) 1340 if ((s != INVALID_SOCKET) || no_exit_if_error)
1349 return s; 1341 return s;
1350 message (TRUE, "%s: error accessing socket \"%s\"\n", 1342 message (true, "%s: error accessing socket \"%s\"\n",
1351 progname, socket_name); 1343 progname, socket_name);
1352 exit (EXIT_FAILURE); 1344 exit (EXIT_FAILURE);
1353 } 1345 }
@@ -1363,7 +1355,7 @@ set_socket (int no_exit_if_error)
1363 if ((s != INVALID_SOCKET) || no_exit_if_error) 1355 if ((s != INVALID_SOCKET) || no_exit_if_error)
1364 return s; 1356 return s;
1365 1357
1366 message (TRUE, "%s: error accessing server file \"%s\"\n", 1358 message (true, "%s: error accessing server file \"%s\"\n",
1367 progname, local_server_file); 1359 progname, local_server_file);
1368 exit (EXIT_FAILURE); 1360 exit (EXIT_FAILURE);
1369 } 1361 }
@@ -1381,7 +1373,7 @@ set_socket (int no_exit_if_error)
1381 return s; 1373 return s;
1382 1374
1383 /* No implicit or explicit socket, and no alternate editor. */ 1375 /* No implicit or explicit socket, and no alternate editor. */
1384 message (TRUE, "%s: No socket or alternate editor. Please use:\n\n" 1376 message (true, "%s: No socket or alternate editor. Please use:\n\n"
1385#ifndef NO_SOCKETS_IN_FILE_SYSTEM 1377#ifndef NO_SOCKETS_IN_FILE_SYSTEM
1386"\t--socket-name\n" 1378"\t--socket-name\n"
1387#endif 1379#endif
@@ -1490,15 +1482,15 @@ start_daemon_and_retry_set_socket (void)
1490 1482
1491 if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS (status)) 1483 if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS (status))
1492 { 1484 {
1493 message (TRUE, "Error: Could not start the Emacs daemon\n"); 1485 message (true, "Error: Could not start the Emacs daemon\n");
1494 exit (EXIT_FAILURE); 1486 exit (EXIT_FAILURE);
1495 } 1487 }
1496 1488
1497 /* Try connecting, the daemon should have started by now. */ 1489 /* Try connecting, the daemon should have started by now. */
1498 message (TRUE, "Emacs daemon should have started, trying to connect again\n"); 1490 message (true, "Emacs daemon should have started, trying to connect again\n");
1499 if ((emacs_socket = set_socket (1)) == INVALID_SOCKET) 1491 if ((emacs_socket = set_socket (1)) == INVALID_SOCKET)
1500 { 1492 {
1501 message (TRUE, "Error: Cannot connect even after starting the Emacs daemon\n"); 1493 message (true, "Error: Cannot connect even after starting the Emacs daemon\n");
1502 exit (EXIT_FAILURE); 1494 exit (EXIT_FAILURE);
1503 } 1495 }
1504 } 1496 }
@@ -1526,7 +1518,7 @@ start_daemon_and_retry_set_socket (void)
1526 d_argv[1] = daemon_arg; 1518 d_argv[1] = daemon_arg;
1527 } 1519 }
1528 execvp ("emacs", d_argv); 1520 execvp ("emacs", d_argv);
1529 message (TRUE, "%s: error starting emacs daemon\n", progname); 1521 message (true, "%s: error starting emacs daemon\n", progname);
1530 } 1522 }
1531#endif /* WINDOWSNT */ 1523#endif /* WINDOWSNT */
1532} 1524}
@@ -1556,7 +1548,7 @@ main (int argc, char **argv)
1556 1548
1557 if ((argc - optind < 1) && !eval && current_frame) 1549 if ((argc - optind < 1) && !eval && current_frame)
1558 { 1550 {
1559 message (TRUE, "%s: file name or argument required\n" 1551 message (true, "%s: file name or argument required\n"
1560 "Try `%s --help' for more information\n", 1552 "Try `%s --help' for more information\n",
1561 progname, progname); 1553 progname, progname);
1562 exit (EXIT_FAILURE); 1554 exit (EXIT_FAILURE);
@@ -1579,7 +1571,7 @@ main (int argc, char **argv)
1579 cwd = get_current_dir_name (); 1571 cwd = get_current_dir_name ();
1580 if (cwd == 0) 1572 if (cwd == 0)
1581 { 1573 {
1582 message (TRUE, "%s: %s\n", progname, 1574 message (true, "%s: %s\n", progname,
1583 "Cannot get current working directory"); 1575 "Cannot get current working directory");
1584 fail (); 1576 fail ();
1585 } 1577 }
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 21cf3654b9e..c3ed5fa07b2 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -80,14 +80,11 @@ University of California, as described above. */
80 80
81char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; 81char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
82 82
83#define TRUE 1
84#define FALSE 0
85
86#ifdef DEBUG 83#ifdef DEBUG
87# undef DEBUG 84# undef DEBUG
88# define DEBUG TRUE 85# define DEBUG true
89#else 86#else
90# define DEBUG FALSE 87# define DEBUG false
91# define NDEBUG /* disable assert */ 88# define NDEBUG /* disable assert */
92#endif 89#endif
93 90
@@ -107,12 +104,12 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
107 104
108#ifdef MSDOS 105#ifdef MSDOS
109# undef MSDOS 106# undef MSDOS
110# define MSDOS TRUE 107# define MSDOS true
111# include <fcntl.h> 108# include <fcntl.h>
112# include <sys/param.h> 109# include <sys/param.h>
113# include <io.h> 110# include <io.h>
114#else 111#else
115# define MSDOS FALSE 112# define MSDOS false
116#endif /* MSDOS */ 113#endif /* MSDOS */
117 114
118#ifdef WINDOWSNT 115#ifdef WINDOWSNT
@@ -150,9 +147,9 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
150 tag tables and tags typedefs, #defines and struct/union/enum by default. */ 147 tag tables and tags typedefs, #defines and struct/union/enum by default. */
151#ifdef CTAGS 148#ifdef CTAGS
152# undef CTAGS 149# undef CTAGS
153# define CTAGS TRUE 150# define CTAGS true
154#else 151#else
155# define CTAGS FALSE 152# define CTAGS false
156#endif 153#endif
157 154
158#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL), !strcmp (s, t)) 155#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL), !strcmp (s, t))
@@ -194,8 +191,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
194 (char *) (op), (n) * sizeof (Type))) 191 (char *) (op), (n) * sizeof (Type)))
195#endif 192#endif
196 193
197#define bool int
198
199typedef void Lang_function (FILE *); 194typedef void Lang_function (FILE *);
200 195
201typedef struct 196typedef struct
@@ -401,7 +396,7 @@ static const char
401 *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789"; 396 *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789";
402 397
403static bool append_to_tagfile; /* -a: append to tags */ 398static bool append_to_tagfile; /* -a: append to tags */
404/* The next five default to TRUE in C and derived languages. */ 399/* The next five default to true in C and derived languages. */
405static bool typedefs; /* -t: create tags for C and Ada typedefs */ 400static bool typedefs; /* -t: create tags for C and Ada typedefs */
406static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */ 401static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */
407 /* 0 struct/enum/union decls, and C++ */ 402 /* 0 struct/enum/union decls, and C++ */
@@ -409,18 +404,18 @@ static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */
409static bool constantypedefs; /* -d: create tags for C #define, enum */ 404static bool constantypedefs; /* -d: create tags for C #define, enum */
410 /* constants and variables. */ 405 /* constants and variables. */
411 /* -D: opposite of -d. Default under ctags. */ 406 /* -D: opposite of -d. Default under ctags. */
412static bool globals; /* create tags for global variables */ 407static int globals; /* create tags for global variables */
413static bool members; /* create tags for C member variables */ 408static int members; /* create tags for C member variables */
414static bool declarations; /* --declarations: tag them and extern in C&Co*/ 409static int declarations; /* --declarations: tag them and extern in C&Co*/
415static bool no_line_directive; /* ignore #line directives (undocumented) */ 410static int no_line_directive; /* ignore #line directives (undocumented) */
416static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ 411static int no_duplicates; /* no duplicate tags for ctags (undocumented) */
417static bool update; /* -u: update tags */ 412static bool update; /* -u: update tags */
418static bool vgrind_style; /* -v: create vgrind style index output */ 413static bool vgrind_style; /* -v: create vgrind style index output */
419static bool no_warnings; /* -w: suppress warnings (undocumented) */ 414static bool no_warnings; /* -w: suppress warnings (undocumented) */
420static bool cxref_style; /* -x: create cxref style output */ 415static bool cxref_style; /* -x: create cxref style output */
421static bool cplusplus; /* .[hc] means C++, not C (undocumented) */ 416static bool cplusplus; /* .[hc] means C++, not C (undocumented) */
422static bool ignoreindent; /* -I: ignore indentation in C */ 417static bool ignoreindent; /* -I: ignore indentation in C */
423static bool packages_only; /* --packages-only: in Ada, only tag packages*/ 418static int packages_only; /* --packages-only: in Ada, only tag packages*/
424 419
425/* STDIN is defined in LynxOS system headers */ 420/* STDIN is defined in LynxOS system headers */
426#ifdef STDIN 421#ifdef STDIN
@@ -436,17 +431,17 @@ static bool need_filebuf; /* some regexes are multi-line */
436static struct option longopts[] = 431static struct option longopts[] =
437{ 432{
438 { "append", no_argument, NULL, 'a' }, 433 { "append", no_argument, NULL, 'a' },
439 { "packages-only", no_argument, &packages_only, TRUE }, 434 { "packages-only", no_argument, &packages_only, 1 },
440 { "c++", no_argument, NULL, 'C' }, 435 { "c++", no_argument, NULL, 'C' },
441 { "declarations", no_argument, &declarations, TRUE }, 436 { "declarations", no_argument, &declarations, 1 },
442 { "no-line-directive", no_argument, &no_line_directive, TRUE }, 437 { "no-line-directive", no_argument, &no_line_directive, 1 },
443 { "no-duplicates", no_argument, &no_duplicates, TRUE }, 438 { "no-duplicates", no_argument, &no_duplicates, 1 },
444 { "help", no_argument, NULL, 'h' }, 439 { "help", no_argument, NULL, 'h' },
445 { "help", no_argument, NULL, 'H' }, 440 { "help", no_argument, NULL, 'H' },
446 { "ignore-indentation", no_argument, NULL, 'I' }, 441 { "ignore-indentation", no_argument, NULL, 'I' },
447 { "language", required_argument, NULL, 'l' }, 442 { "language", required_argument, NULL, 'l' },
448 { "members", no_argument, &members, TRUE }, 443 { "members", no_argument, &members, 1 },
449 { "no-members", no_argument, &members, FALSE }, 444 { "no-members", no_argument, &members, 0 },
450 { "output", required_argument, NULL, 'o' }, 445 { "output", required_argument, NULL, 'o' },
451 { "regex", required_argument, NULL, 'r' }, 446 { "regex", required_argument, NULL, 'r' },
452 { "no-regex", no_argument, NULL, 'R' }, 447 { "no-regex", no_argument, NULL, 'R' },
@@ -458,7 +453,7 @@ static struct option longopts[] =
458 { "backward-search", no_argument, NULL, 'B' }, 453 { "backward-search", no_argument, NULL, 'B' },
459 { "cxref", no_argument, NULL, 'x' }, 454 { "cxref", no_argument, NULL, 'x' },
460 { "defines", no_argument, NULL, 'd' }, 455 { "defines", no_argument, NULL, 'd' },
461 { "globals", no_argument, &globals, TRUE }, 456 { "globals", no_argument, &globals, 1 },
462 { "typedefs", no_argument, NULL, 't' }, 457 { "typedefs", no_argument, NULL, 't' },
463 { "typedefs-and-c++", no_argument, NULL, 'T' }, 458 { "typedefs-and-c++", no_argument, NULL, 'T' },
464 { "update", no_argument, NULL, 'u' }, 459 { "update", no_argument, NULL, 'u' },
@@ -467,7 +462,7 @@ static struct option longopts[] =
467 462
468#else /* Etags options */ 463#else /* Etags options */
469 { "no-defines", no_argument, NULL, 'D' }, 464 { "no-defines", no_argument, NULL, 'D' },
470 { "no-globals", no_argument, &globals, FALSE }, 465 { "no-globals", no_argument, &globals, 0 },
471 { "include", required_argument, NULL, 'i' }, 466 { "include", required_argument, NULL, 'i' },
472#endif 467#endif
473 { NULL } 468 { NULL }
@@ -761,7 +756,7 @@ static language lang_names [] =
761 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, 756 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
762 { "tex", TeX_help, TeX_commands, TeX_suffixes }, 757 { "tex", TeX_help, TeX_commands, TeX_suffixes },
763 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, 758 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
764 { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,TRUE}, 759 { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,true},
765 { "auto", auto_help }, /* default guessing scheme */ 760 { "auto", auto_help }, /* default guessing scheme */
766 { "none", none_help, just_read_file }, /* regexp matching only */ 761 { "none", none_help, just_read_file }, /* regexp matching only */
767 { NULL } /* end of list */ 762 { NULL } /* end of list */
@@ -820,13 +815,13 @@ print_version (void)
820} 815}
821 816
822#ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP 817#ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP
823# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE 818# define PRINT_UNDOCUMENTED_OPTIONS_HELP false
824#endif 819#endif
825 820
826static _Noreturn void 821static _Noreturn void
827print_help (argument *argbuffer) 822print_help (argument *argbuffer)
828{ 823{
829 bool help_for_lang = FALSE; 824 bool help_for_lang = false;
830 825
831 for (; argbuffer->arg_type != at_end; argbuffer++) 826 for (; argbuffer->arg_type != at_end; argbuffer++)
832 if (argbuffer->arg_type == at_language) 827 if (argbuffer->arg_type == at_language)
@@ -834,7 +829,7 @@ print_help (argument *argbuffer)
834 if (help_for_lang) 829 if (help_for_lang)
835 puts (""); 830 puts ("");
836 puts (argbuffer->lang->help); 831 puts (argbuffer->lang->help);
837 help_for_lang = TRUE; 832 help_for_lang = true;
838 } 833 }
839 834
840 if (help_for_lang) 835 if (help_for_lang)
@@ -1005,7 +1000,7 @@ main (int argc, char **argv)
1005 argument *argbuffer; 1000 argument *argbuffer;
1006 int current_arg, file_count; 1001 int current_arg, file_count;
1007 linebuffer filename_lb; 1002 linebuffer filename_lb;
1008 bool help_asked = FALSE; 1003 bool help_asked = false;
1009 ptrdiff_t len; 1004 ptrdiff_t len;
1010 char *optstring; 1005 char *optstring;
1011 int opt; 1006 int opt;
@@ -1030,8 +1025,8 @@ main (int argc, char **argv)
1030 * Also default to find macro constants, enum constants, struct 1025 * Also default to find macro constants, enum constants, struct
1031 * members and global variables. Do it for both etags and ctags. 1026 * members and global variables. Do it for both etags and ctags.
1032 */ 1027 */
1033 typedefs = typedefs_or_cplusplus = constantypedefs = TRUE; 1028 typedefs = typedefs_or_cplusplus = constantypedefs = true;
1034 globals = members = TRUE; 1029 globals = members = true;
1035 1030
1036 /* When the optstring begins with a '-' getopt_long does not rearrange the 1031 /* When the optstring begins with a '-' getopt_long does not rearrange the
1037 non-options arguments to be at the end, but leaves them alone. */ 1032 non-options arguments to be at the end, but leaves them alone. */
@@ -1069,12 +1064,12 @@ main (int argc, char **argv)
1069 ++file_count; 1064 ++file_count;
1070 if (parsing_stdin) 1065 if (parsing_stdin)
1071 fatal ("cannot parse standard input more than once", (char *)NULL); 1066 fatal ("cannot parse standard input more than once", (char *)NULL);
1072 parsing_stdin = TRUE; 1067 parsing_stdin = true;
1073 break; 1068 break;
1074 1069
1075 /* Common options. */ 1070 /* Common options. */
1076 case 'a': append_to_tagfile = TRUE; break; 1071 case 'a': append_to_tagfile = true; break;
1077 case 'C': cplusplus = TRUE; break; 1072 case 'C': cplusplus = true; break;
1078 case 'f': /* for compatibility with old makefiles */ 1073 case 'f': /* for compatibility with old makefiles */
1079 case 'o': 1074 case 'o':
1080 if (tagfile) 1075 if (tagfile)
@@ -1087,7 +1082,7 @@ main (int argc, char **argv)
1087 break; 1082 break;
1088 case 'I': 1083 case 'I':
1089 case 'S': /* for backward compatibility */ 1084 case 'S': /* for backward compatibility */
1090 ignoreindent = TRUE; 1085 ignoreindent = true;
1091 break; 1086 break;
1092 case 'l': 1087 case 'l':
1093 { 1088 {
@@ -1122,22 +1117,22 @@ main (int argc, char **argv)
1122 break; 1117 break;
1123 case 'h': 1118 case 'h':
1124 case 'H': 1119 case 'H':
1125 help_asked = TRUE; 1120 help_asked = true;
1126 break; 1121 break;
1127 1122
1128 /* Etags options */ 1123 /* Etags options */
1129 case 'D': constantypedefs = FALSE; break; 1124 case 'D': constantypedefs = false; break;
1130 case 'i': included_files[nincluded_files++] = optarg; break; 1125 case 'i': included_files[nincluded_files++] = optarg; break;
1131 1126
1132 /* Ctags options. */ 1127 /* Ctags options. */
1133 case 'B': searchar = '?'; break; 1128 case 'B': searchar = '?'; break;
1134 case 'd': constantypedefs = TRUE; break; 1129 case 'd': constantypedefs = true; break;
1135 case 't': typedefs = TRUE; break; 1130 case 't': typedefs = true; break;
1136 case 'T': typedefs = typedefs_or_cplusplus = TRUE; break; 1131 case 'T': typedefs = typedefs_or_cplusplus = true; break;
1137 case 'u': update = TRUE; break; 1132 case 'u': update = true; break;
1138 case 'v': vgrind_style = TRUE; /*FALLTHRU*/ 1133 case 'v': vgrind_style = true; /*FALLTHRU*/
1139 case 'x': cxref_style = TRUE; break; 1134 case 'x': cxref_style = true; break;
1140 case 'w': no_warnings = TRUE; break; 1135 case 'w': no_warnings = true; break;
1141 default: 1136 default:
1142 suggest_asking_for_help (); 1137 suggest_asking_for_help ();
1143 /* NOTREACHED */ 1138 /* NOTREACHED */
@@ -1308,7 +1303,7 @@ main (int argc, char **argv)
1308 fatal ("failed to execute shell command", (char *)NULL); 1303 fatal ("failed to execute shell command", (char *)NULL);
1309 } 1304 }
1310 free (cmd); 1305 free (cmd);
1311 append_to_tagfile = TRUE; 1306 append_to_tagfile = true;
1312 } 1307 }
1313 1308
1314 tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); 1309 tagf = fopen (tagfile, append_to_tagfile ? "a" : "w");
@@ -1605,9 +1600,9 @@ process_file (FILE *fh, char *fn, language *lang)
1605 to the directory of the tags file. */ 1600 to the directory of the tags file. */
1606 fdp->taggedfname = relative_filename (fn, tagfiledir); 1601 fdp->taggedfname = relative_filename (fn, tagfiledir);
1607 } 1602 }
1608 fdp->usecharno = TRUE; /* use char position when making tags */ 1603 fdp->usecharno = true; /* use char position when making tags */
1609 fdp->prop = NULL; 1604 fdp->prop = NULL;
1610 fdp->written = FALSE; /* not written on tags file yet */ 1605 fdp->written = false; /* not written on tags file yet */
1611 1606
1612 fdhead = fdp; 1607 fdhead = fdp;
1613 curfdp = fdhead; /* the current file description */ 1608 curfdp = fdhead; /* the current file description */
@@ -1653,26 +1648,27 @@ process_file (FILE *fh, char *fn, language *lang)
1653 * This routine sets up the boolean pseudo-functions which work 1648 * This routine sets up the boolean pseudo-functions which work
1654 * by setting boolean flags dependent upon the corresponding character. 1649 * by setting boolean flags dependent upon the corresponding character.
1655 * Every char which is NOT in that string is not a white char. Therefore, 1650 * Every char which is NOT in that string is not a white char. Therefore,
1656 * all of the array "_wht" is set to FALSE, and then the elements 1651 * all of the array "_wht" is set to false, and then the elements
1657 * subscripted by the chars in "white" are set to TRUE. Thus "_wht" 1652 * subscripted by the chars in "white" are set to true. Thus "_wht"
1658 * of a char is TRUE if it is the string "white", else FALSE. 1653 * of a char is true if it is the string "white", else false.
1659 */ 1654 */
1660static void 1655static void
1661init (void) 1656init (void)
1662{ 1657{
1663 register const char *sp; 1658 const char *sp;
1664 register int i; 1659 int i;
1665 1660
1666 for (i = 0; i < CHARS; i++) 1661 for (i = 0; i < CHARS; i++)
1667 iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i) = FALSE; 1662 iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i)
1668 for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; 1663 = false;
1669 for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; 1664 for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = true;
1665 for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = true;
1670 notinname ('\0') = notinname ('\n'); 1666 notinname ('\0') = notinname ('\n');
1671 for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE; 1667 for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = true;
1672 begtoken ('\0') = begtoken ('\n'); 1668 begtoken ('\0') = begtoken ('\n');
1673 for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE; 1669 for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = true;
1674 intoken ('\0') = intoken ('\n'); 1670 intoken ('\0') = intoken ('\n');
1675 for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE; 1671 for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = true;
1676 endtoken ('\0') = endtoken ('\n'); 1672 endtoken ('\0') = endtoken ('\n');
1677} 1673}
1678 1674
@@ -1696,7 +1692,7 @@ find_entries (FILE *inf)
1696 /* Else try to guess the language given the file name. */ 1692 /* Else try to guess the language given the file name. */
1697 if (parser == NULL) 1693 if (parser == NULL)
1698 { 1694 {
1699 lang = get_language_from_filename (curfdp->infname, TRUE); 1695 lang = get_language_from_filename (curfdp->infname, true);
1700 if (lang != NULL && lang->function != NULL) 1696 if (lang != NULL && lang->function != NULL)
1701 { 1697 {
1702 curfdp->lang = lang; 1698 curfdp->lang = lang;
@@ -1743,7 +1739,7 @@ find_entries (FILE *inf)
1743 /* Else try to guess the language given the case insensitive file name. */ 1739 /* Else try to guess the language given the case insensitive file name. */
1744 if (parser == NULL) 1740 if (parser == NULL)
1745 { 1741 {
1746 lang = get_language_from_filename (curfdp->infname, FALSE); 1742 lang = get_language_from_filename (curfdp->infname, false);
1747 if (lang != NULL && lang->function != NULL) 1743 if (lang != NULL && lang->function != NULL)
1748 { 1744 {
1749 curfdp->lang = lang; 1745 curfdp->lang = lang;
@@ -1841,7 +1837,7 @@ find_entries (FILE *inf)
1841static void 1837static void
1842make_tag (const char *name, /* tag name, or NULL if unnamed */ 1838make_tag (const char *name, /* tag name, or NULL if unnamed */
1843 int namelen, /* tag length */ 1839 int namelen, /* tag length */
1844 int is_func, /* tag is a function */ 1840 bool is_func, /* tag is a function */
1845 char *linestart, /* start of the line where tag is */ 1841 char *linestart, /* start of the line where tag is */
1846 int linelen, /* length of the line where tag is */ 1842 int linelen, /* length of the line where tag is */
1847 int lno, /* line number */ 1843 int lno, /* line number */
@@ -1869,7 +1865,7 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */
1869 && (cp == linestart 1865 && (cp == linestart
1870 || notinname (cp[-1])) /* rule #3 */ 1866 || notinname (cp[-1])) /* rule #3 */
1871 && strneq (name, cp, namelen)) /* rule #2 */ 1867 && strneq (name, cp, namelen)) /* rule #2 */
1872 named = FALSE; /* use implicit tag name */ 1868 named = false; /* use implicit tag name */
1873 } 1869 }
1874 } 1870 }
1875 1871
@@ -1881,7 +1877,8 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */
1881 1877
1882/* Record a tag. */ 1878/* Record a tag. */
1883static void 1879static void
1884pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno) 1880pfnote (char *name, bool is_func, char *linestart, int linelen, int lno,
1881 long int cno)
1885 /* tag name, or NULL if unnamed */ 1882 /* tag name, or NULL if unnamed */
1886 /* tag is a function */ 1883 /* tag is a function */
1887 /* start of the line where tag is */ 1884 /* start of the line where tag is */
@@ -1908,8 +1905,8 @@ pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int
1908 } 1905 }
1909 else 1906 else
1910 np->name = name; 1907 np->name = name;
1911 np->valid = TRUE; 1908 np->valid = true;
1912 np->been_warned = FALSE; 1909 np->been_warned = false;
1913 np->fdp = curfdp; 1910 np->fdp = curfdp;
1914 np->is_func = is_func; 1911 np->is_func = is_func;
1915 np->lno = lno; 1912 np->lno = lno;
@@ -2043,7 +2040,7 @@ add_node (node *np, node **cur_node_p)
2043 (stderr, 2040 (stderr,
2044 "Duplicate entry in files %s and %s: %s (Warning only)\n", 2041 "Duplicate entry in files %s and %s: %s (Warning only)\n",
2045 np->fdp->infname, cur_node->fdp->infname, np->name); 2042 np->fdp->infname, cur_node->fdp->infname, np->name);
2046 cur_node->been_warned = TRUE; 2043 cur_node->been_warned = true;
2047 } 2044 }
2048 return; 2045 return;
2049 } 2046 }
@@ -2071,7 +2068,7 @@ invalidate_nodes (fdesc *badfdp, node **npp)
2071 if (np->left != NULL) 2068 if (np->left != NULL)
2072 invalidate_nodes (badfdp, &np->left); 2069 invalidate_nodes (badfdp, &np->left);
2073 if (np->fdp == badfdp) 2070 if (np->fdp == badfdp)
2074 np->valid = FALSE; 2071 np->valid = false;
2075 if (np->right != NULL) 2072 if (np->right != NULL)
2076 invalidate_nodes (badfdp, &np->right); 2073 invalidate_nodes (badfdp, &np->right);
2077 } 2074 }
@@ -2154,7 +2151,7 @@ put_entries (register node *np)
2154 fdp = np->fdp; 2151 fdp = np->fdp;
2155 fprintf (tagf, "\f\n%s,%d\n", 2152 fprintf (tagf, "\f\n%s,%d\n",
2156 fdp->taggedfname, total_size_of_entries (np)); 2153 fdp->taggedfname, total_size_of_entries (np));
2157 fdp->written = TRUE; 2154 fdp->written = true;
2158 } 2155 }
2159 fputs (np->regex, tagf); 2156 fputs (np->regex, tagf);
2160 fputc ('\177', tagf); 2157 fputc ('\177', tagf);
@@ -2625,7 +2622,7 @@ static void make_C_tag (bool);
2625 * function or variable, or corresponds to a typedef, or 2622 * function or variable, or corresponds to a typedef, or
2626 * is a struct/union/enum tag, or #define, or an enum constant. 2623 * is a struct/union/enum tag, or #define, or an enum constant.
2627 * 2624 *
2628 * *IS_FUNC gets TRUE if the token is a function or #define macro 2625 * *IS_FUNC_OR_VAR gets true if the token is a function or #define macro
2629 * with args. C_EXTP points to which language we are looking at. 2626 * with args. C_EXTP points to which language we are looking at.
2630 * 2627 *
2631 * Globals 2628 * Globals
@@ -2637,7 +2634,8 @@ static void make_C_tag (bool);
2637 */ 2634 */
2638 2635
2639static bool 2636static bool
2640consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var) 2637consider_token (char *str, int len, int c, int *c_extp,
2638 int bracelev, int parlev, bool *is_func_or_var)
2641 /* IN: token pointer */ 2639 /* IN: token pointer */
2642 /* IN: token length */ 2640 /* IN: token length */
2643 /* IN: first char after the token */ 2641 /* IN: first char after the token */
@@ -2661,8 +2659,8 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2661 */ 2659 */
2662 if (toktype == st_C_attribute) 2660 if (toktype == st_C_attribute)
2663 { 2661 {
2664 inattribute = TRUE; 2662 inattribute = true;
2665 return FALSE; 2663 return false;
2666 } 2664 }
2667 2665
2668 /* 2666 /*
@@ -2675,7 +2673,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2675 if (toktype == st_C_gnumacro) 2673 if (toktype == st_C_gnumacro)
2676 { 2674 {
2677 fvdef = fdefunkey; 2675 fvdef = fdefunkey;
2678 return FALSE; 2676 return false;
2679 } 2677 }
2680 break; 2678 break;
2681 case dsharpseen: 2679 case dsharpseen:
@@ -2687,20 +2685,20 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2687 { 2685 {
2688 definedef = dignorerest; 2686 definedef = dignorerest;
2689 } 2687 }
2690 return FALSE; 2688 return false;
2691 case ddefineseen: 2689 case ddefineseen:
2692 /* 2690 /*
2693 * Make a tag for any macro, unless it is a constant 2691 * Make a tag for any macro, unless it is a constant
2694 * and constantypedefs is FALSE. 2692 * and constantypedefs is false.
2695 */ 2693 */
2696 definedef = dignorerest; 2694 definedef = dignorerest;
2697 *is_func_or_var = (c == '('); 2695 *is_func_or_var = (c == '(');
2698 if (!*is_func_or_var && !constantypedefs) 2696 if (!*is_func_or_var && !constantypedefs)
2699 return FALSE; 2697 return false;
2700 else 2698 else
2701 return TRUE; 2699 return true;
2702 case dignorerest: 2700 case dignorerest:
2703 return FALSE; 2701 return false;
2704 default: 2702 default:
2705 error ("internal error: definedef value."); 2703 error ("internal error: definedef value.");
2706 } 2704 }
@@ -2715,9 +2713,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2715 { 2713 {
2716 if (typedefs) 2714 if (typedefs)
2717 typdef = tkeyseen; 2715 typdef = tkeyseen;
2718 fvextern = FALSE; 2716 fvextern = false;
2719 fvdef = fvnone; 2717 fvdef = fvnone;
2720 return FALSE; 2718 return false;
2721 } 2719 }
2722 break; 2720 break;
2723 case tkeyseen: 2721 case tkeyseen:
@@ -2734,7 +2732,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2734 if (structdef == snone && fvdef == fvnone) 2732 if (structdef == snone && fvdef == fvnone)
2735 { 2733 {
2736 fvdef = fvnameseen; 2734 fvdef = fvnameseen;
2737 return TRUE; 2735 return true;
2738 } 2736 }
2739 break; 2737 break;
2740 case tend: 2738 case tend:
@@ -2743,9 +2741,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2743 case st_C_class: 2741 case st_C_class:
2744 case st_C_struct: 2742 case st_C_struct:
2745 case st_C_enum: 2743 case st_C_enum:
2746 return FALSE; 2744 return false;
2747 } 2745 }
2748 return TRUE; 2746 return true;
2749 } 2747 }
2750 2748
2751 switch (toktype) 2749 switch (toktype)
@@ -2753,7 +2751,7 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2753 case st_C_javastruct: 2751 case st_C_javastruct:
2754 if (structdef == stagseen) 2752 if (structdef == stagseen)
2755 structdef = scolonseen; 2753 structdef = scolonseen;
2756 return FALSE; 2754 return false;
2757 case st_C_template: 2755 case st_C_template:
2758 case st_C_class: 2756 case st_C_class:
2759 if ((*c_extp & C_AUTO) /* automatic detection of C++ language */ 2757 if ((*c_extp & C_AUTO) /* automatic detection of C++ language */
@@ -2777,13 +2775,13 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2777 if (fvdef == fvnameseen) 2775 if (fvdef == fvnameseen)
2778 fvdef = fvnone; 2776 fvdef = fvnone;
2779 } 2777 }
2780 return FALSE; 2778 return false;
2781 } 2779 }
2782 2780
2783 if (structdef == skeyseen) 2781 if (structdef == skeyseen)
2784 { 2782 {
2785 structdef = stagseen; 2783 structdef = stagseen;
2786 return TRUE; 2784 return true;
2787 } 2785 }
2788 2786
2789 if (typdef != tnone) 2787 if (typdef != tnone)
@@ -2797,27 +2795,27 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2797 { 2795 {
2798 case st_C_objprot: 2796 case st_C_objprot:
2799 objdef = oprotocol; 2797 objdef = oprotocol;
2800 return FALSE; 2798 return false;
2801 case st_C_objimpl: 2799 case st_C_objimpl:
2802 objdef = oimplementation; 2800 objdef = oimplementation;
2803 return FALSE; 2801 return false;
2804 } 2802 }
2805 break; 2803 break;
2806 case oimplementation: 2804 case oimplementation:
2807 /* Save the class tag for functions or variables defined inside. */ 2805 /* Save the class tag for functions or variables defined inside. */
2808 objtag = savenstr (str, len); 2806 objtag = savenstr (str, len);
2809 objdef = oinbody; 2807 objdef = oinbody;
2810 return FALSE; 2808 return false;
2811 case oprotocol: 2809 case oprotocol:
2812 /* Save the class tag for categories. */ 2810 /* Save the class tag for categories. */
2813 objtag = savenstr (str, len); 2811 objtag = savenstr (str, len);
2814 objdef = otagseen; 2812 objdef = otagseen;
2815 *is_func_or_var = TRUE; 2813 *is_func_or_var = true;
2816 return TRUE; 2814 return true;
2817 case oparenseen: 2815 case oparenseen:
2818 objdef = ocatseen; 2816 objdef = ocatseen;
2819 *is_func_or_var = TRUE; 2817 *is_func_or_var = true;
2820 return TRUE; 2818 return true;
2821 case oinbody: 2819 case oinbody:
2822 break; 2820 break;
2823 case omethodsign: 2821 case omethodsign:
@@ -2828,13 +2826,13 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2828 linebuffer_setlen (&token_name, len); 2826 linebuffer_setlen (&token_name, len);
2829 memcpy (token_name.buffer, str, len); 2827 memcpy (token_name.buffer, str, len);
2830 token_name.buffer[len] = '\0'; 2828 token_name.buffer[len] = '\0';
2831 return TRUE; 2829 return true;
2832 } 2830 }
2833 return FALSE; 2831 return false;
2834 case omethodcolon: 2832 case omethodcolon:
2835 if (parlev == 0) 2833 if (parlev == 0)
2836 objdef = omethodparm; 2834 objdef = omethodparm;
2837 return FALSE; 2835 return false;
2838 case omethodparm: 2836 case omethodparm:
2839 if (parlev == 0) 2837 if (parlev == 0)
2840 { 2838 {
@@ -2844,9 +2842,9 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2844 linebuffer_setlen (&token_name, oldlen + len); 2842 linebuffer_setlen (&token_name, oldlen + len);
2845 memcpy (token_name.buffer + oldlen, str, len); 2843 memcpy (token_name.buffer + oldlen, str, len);
2846 token_name.buffer[oldlen + len] = '\0'; 2844 token_name.buffer[oldlen + len] = '\0';
2847 return TRUE; 2845 return true;
2848 } 2846 }
2849 return FALSE; 2847 return false;
2850 case oignore: 2848 case oignore:
2851 if (toktype == st_C_objend) 2849 if (toktype == st_C_objend)
2852 { 2850 {
@@ -2858,14 +2856,14 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2858 free (objtag); */ 2856 free (objtag); */
2859 objdef = onone; 2857 objdef = onone;
2860 } 2858 }
2861 return FALSE; 2859 return false;
2862 } 2860 }
2863 2861
2864 /* A function, variable or enum constant? */ 2862 /* A function, variable or enum constant? */
2865 switch (toktype) 2863 switch (toktype)
2866 { 2864 {
2867 case st_C_extern: 2865 case st_C_extern:
2868 fvextern = TRUE; 2866 fvextern = true;
2869 switch (fvdef) 2867 switch (fvdef)
2870 { 2868 {
2871 case finlist: 2869 case finlist:
@@ -2876,39 +2874,39 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2876 default: 2874 default:
2877 fvdef = fvnone; 2875 fvdef = fvnone;
2878 } 2876 }
2879 return FALSE; 2877 return false;
2880 case st_C_ignore: 2878 case st_C_ignore:
2881 fvextern = FALSE; 2879 fvextern = false;
2882 fvdef = vignore; 2880 fvdef = vignore;
2883 return FALSE; 2881 return false;
2884 case st_C_operator: 2882 case st_C_operator:
2885 fvdef = foperator; 2883 fvdef = foperator;
2886 *is_func_or_var = TRUE; 2884 *is_func_or_var = true;
2887 return TRUE; 2885 return true;
2888 case st_none: 2886 case st_none:
2889 if (constantypedefs 2887 if (constantypedefs
2890 && structdef == snone 2888 && structdef == snone
2891 && structtype == st_C_enum && bracelev > structbracelev) 2889 && structtype == st_C_enum && bracelev > structbracelev)
2892 return TRUE; /* enum constant */ 2890 return true; /* enum constant */
2893 switch (fvdef) 2891 switch (fvdef)
2894 { 2892 {
2895 case fdefunkey: 2893 case fdefunkey:
2896 if (bracelev > 0) 2894 if (bracelev > 0)
2897 break; 2895 break;
2898 fvdef = fdefunname; /* GNU macro */ 2896 fvdef = fdefunname; /* GNU macro */
2899 *is_func_or_var = TRUE; 2897 *is_func_or_var = true;
2900 return TRUE; 2898 return true;
2901 case fvnone: 2899 case fvnone:
2902 switch (typdef) 2900 switch (typdef)
2903 { 2901 {
2904 case ttypeseen: 2902 case ttypeseen:
2905 return FALSE; 2903 return false;
2906 case tnone: 2904 case tnone:
2907 if ((strneq (str, "asm", 3) && endtoken (str[3])) 2905 if ((strneq (str, "asm", 3) && endtoken (str[3]))
2908 || (strneq (str, "__asm__", 7) && endtoken (str[7]))) 2906 || (strneq (str, "__asm__", 7) && endtoken (str[7])))
2909 { 2907 {
2910 fvdef = vignore; 2908 fvdef = vignore;
2911 return FALSE; 2909 return false;
2912 } 2910 }
2913 break; 2911 break;
2914 } 2912 }
@@ -2919,19 +2917,19 @@ consider_token (register char *str, register int len, register int c, int *c_ext
2919 if (*c_extp & C_AUTO) /* automatic detection of C++ */ 2917 if (*c_extp & C_AUTO) /* automatic detection of C++ */
2920 *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; 2918 *c_extp = (*c_extp | C_PLPL) & ~C_AUTO;
2921 fvdef = foperator; 2919 fvdef = foperator;
2922 *is_func_or_var = TRUE; 2920 *is_func_or_var = true;
2923 return TRUE; 2921 return true;
2924 } 2922 }
2925 if (bracelev > 0 && !instruct) 2923 if (bracelev > 0 && !instruct)
2926 break; 2924 break;
2927 fvdef = fvnameseen; /* function or variable */ 2925 fvdef = fvnameseen; /* function or variable */
2928 *is_func_or_var = TRUE; 2926 *is_func_or_var = true;
2929 return TRUE; 2927 return true;
2930 } 2928 }
2931 break; 2929 break;
2932 } 2930 }
2933 2931
2934 return FALSE; 2932 return false;
2935} 2933}
2936 2934
2937 2935
@@ -2963,7 +2961,7 @@ do { \
2963 curlinepos = charno; \ 2961 curlinepos = charno; \
2964 readline (&curlb, inf); \ 2962 readline (&curlb, inf); \
2965 lp = curlb.buffer; \ 2963 lp = curlb.buffer; \
2966 quotednl = FALSE; \ 2964 quotednl = false; \
2967 newndx = curndx; \ 2965 newndx = curndx; \
2968} while (0) 2966} while (0)
2969 2967
@@ -2973,16 +2971,16 @@ do { \
2973 if (savetoken.valid) \ 2971 if (savetoken.valid) \
2974 { \ 2972 { \
2975 token = savetoken; \ 2973 token = savetoken; \
2976 savetoken.valid = FALSE; \ 2974 savetoken.valid = false; \
2977 } \ 2975 } \
2978 definedef = dnone; \ 2976 definedef = dnone; \
2979} while (0) 2977} while (0)
2980 2978
2981 2979
2982static void 2980static void
2983make_C_tag (int isfun) 2981make_C_tag (bool isfun)
2984{ 2982{
2985 /* This function is never called when token.valid is FALSE, but 2983 /* This function is never called when token.valid is false, but
2986 we must protect against invalid input or internal errors. */ 2984 we must protect against invalid input or internal errors. */
2987 if (token.valid) 2985 if (token.valid)
2988 make_tag (token_name.buffer, token_name.len, isfun, token.line, 2986 make_tag (token_name.buffer, token_name.len, isfun, token.line,
@@ -2995,7 +2993,7 @@ make_C_tag (int isfun)
2995 error ("INVALID TOKEN"); 2993 error ("INVALID TOKEN");
2996 } 2994 }
2997 2995
2998 token.valid = FALSE; 2996 token.valid = false;
2999} 2997}
3000 2998
3001 2999
@@ -3043,11 +3041,11 @@ C_entries (int c_ext, FILE *inf)
3043 lp = curlb.buffer; 3041 lp = curlb.buffer;
3044 *lp = 0; 3042 *lp = 0;
3045 3043
3046 fvdef = fvnone; fvextern = FALSE; typdef = tnone; 3044 fvdef = fvnone; fvextern = false; typdef = tnone;
3047 structdef = snone; definedef = dnone; objdef = onone; 3045 structdef = snone; definedef = dnone; objdef = onone;
3048 yacc_rules = FALSE; 3046 yacc_rules = false;
3049 midtoken = inquote = inchar = incomm = quotednl = FALSE; 3047 midtoken = inquote = inchar = incomm = quotednl = false;
3050 token.valid = savetoken.valid = FALSE; 3048 token.valid = savetoken.valid = false;
3051 bracelev = bracketlev = parlev = attrparlev = templatelev = 0; 3049 bracelev = bracketlev = parlev = attrparlev = templatelev = 0;
3052 if (cjava) 3050 if (cjava)
3053 { qualifier = "."; qlen = 1; } 3051 { qualifier = "."; qlen = 1; }
@@ -3065,7 +3063,7 @@ C_entries (int c_ext, FILE *inf)
3065 to read the next line. */ 3063 to read the next line. */
3066 if (*lp == '\0') 3064 if (*lp == '\0')
3067 { 3065 {
3068 quotednl = TRUE; 3066 quotednl = true;
3069 continue; 3067 continue;
3070 } 3068 }
3071 lp++; 3069 lp++;
@@ -3079,7 +3077,7 @@ C_entries (int c_ext, FILE *inf)
3079 if (*lp == '/') 3077 if (*lp == '/')
3080 { 3078 {
3081 c = *lp++; 3079 c = *lp++;
3082 incomm = FALSE; 3080 incomm = false;
3083 } 3081 }
3084 break; 3082 break;
3085 case '\0': 3083 case '\0':
@@ -3095,7 +3093,7 @@ C_entries (int c_ext, FILE *inf)
3095 switch (c) 3093 switch (c)
3096 { 3094 {
3097 case '"': 3095 case '"':
3098 inquote = FALSE; 3096 inquote = false;
3099 break; 3097 break;
3100 case '\0': 3098 case '\0':
3101 /* Newlines inside strings do not end macro definitions 3099 /* Newlines inside strings do not end macro definitions
@@ -3115,7 +3113,7 @@ C_entries (int c_ext, FILE *inf)
3115 CNL (); 3113 CNL ();
3116 /* FALLTHRU */ 3114 /* FALLTHRU */
3117 case '\'': 3115 case '\'':
3118 inchar = FALSE; 3116 inchar = false;
3119 break; 3117 break;
3120 } 3118 }
3121 continue; 3119 continue;
@@ -3123,7 +3121,7 @@ C_entries (int c_ext, FILE *inf)
3123 else switch (c) 3121 else switch (c)
3124 { 3122 {
3125 case '"': 3123 case '"':
3126 inquote = TRUE; 3124 inquote = true;
3127 if (bracketlev > 0) 3125 if (bracketlev > 0)
3128 continue; 3126 continue;
3129 if (inattribute) 3127 if (inattribute)
@@ -3137,26 +3135,26 @@ C_entries (int c_ext, FILE *inf)
3137 case vignore: 3135 case vignore:
3138 break; 3136 break;
3139 default: 3137 default:
3140 fvextern = FALSE; 3138 fvextern = false;
3141 fvdef = fvnone; 3139 fvdef = fvnone;
3142 } 3140 }
3143 continue; 3141 continue;
3144 case '\'': 3142 case '\'':
3145 inchar = TRUE; 3143 inchar = true;
3146 if (bracketlev > 0) 3144 if (bracketlev > 0)
3147 continue; 3145 continue;
3148 if (inattribute) 3146 if (inattribute)
3149 break; 3147 break;
3150 if (fvdef != finlist && fvdef != fignore && fvdef != vignore) 3148 if (fvdef != finlist && fvdef != fignore && fvdef != vignore)
3151 { 3149 {
3152 fvextern = FALSE; 3150 fvextern = false;
3153 fvdef = fvnone; 3151 fvdef = fvnone;
3154 } 3152 }
3155 continue; 3153 continue;
3156 case '/': 3154 case '/':
3157 if (*lp == '*') 3155 if (*lp == '*')
3158 { 3156 {
3159 incomm = TRUE; 3157 incomm = true;
3160 lp++; 3158 lp++;
3161 c = ' '; 3159 c = ' ';
3162 if (bracketlev > 0) 3160 if (bracketlev > 0)
@@ -3172,9 +3170,9 @@ C_entries (int c_ext, FILE *inf)
3172 { 3170 {
3173 /* Entering or exiting rules section in yacc file. */ 3171 /* Entering or exiting rules section in yacc file. */
3174 lp++; 3172 lp++;
3175 definedef = dnone; fvdef = fvnone; fvextern = FALSE; 3173 definedef = dnone; fvdef = fvnone; fvextern = false;
3176 typdef = tnone; structdef = snone; 3174 typdef = tnone; structdef = snone;
3177 midtoken = inquote = inchar = incomm = quotednl = FALSE; 3175 midtoken = inquote = inchar = incomm = quotednl = false;
3178 bracelev = 0; 3176 bracelev = 0;
3179 yacc_rules = !yacc_rules; 3177 yacc_rules = !yacc_rules;
3180 continue; 3178 continue;
@@ -3185,7 +3183,7 @@ C_entries (int c_ext, FILE *inf)
3185 if (definedef == dnone) 3183 if (definedef == dnone)
3186 { 3184 {
3187 char *cp; 3185 char *cp;
3188 bool cpptoken = TRUE; 3186 bool cpptoken = true;
3189 3187
3190 /* Look back on this line. If all blanks, or nonblanks 3188 /* Look back on this line. If all blanks, or nonblanks
3191 followed by an end of comment, this is a preprocessor 3189 followed by an end of comment, this is a preprocessor
@@ -3196,10 +3194,10 @@ C_entries (int c_ext, FILE *inf)
3196 if (*cp == '*' && cp[1] == '/') 3194 if (*cp == '*' && cp[1] == '/')
3197 { 3195 {
3198 cp++; 3196 cp++;
3199 cpptoken = TRUE; 3197 cpptoken = true;
3200 } 3198 }
3201 else 3199 else
3202 cpptoken = FALSE; 3200 cpptoken = false;
3203 } 3201 }
3204 if (cpptoken) 3202 if (cpptoken)
3205 definedef = dsharpseen; 3203 definedef = dsharpseen;
@@ -3248,7 +3246,7 @@ C_entries (int c_ext, FILE *inf)
3248 } 3246 }
3249 else 3247 else
3250 { 3248 {
3251 bool funorvar = FALSE; 3249 bool funorvar = false;
3252 3250
3253 if (yacc_rules 3251 if (yacc_rules
3254 || consider_token (newlb.buffer + tokoff, toklen, c, 3252 || consider_token (newlb.buffer + tokoff, toklen, c,
@@ -3267,7 +3265,7 @@ C_entries (int c_ext, FILE *inf)
3267 c = *lp++; 3265 c = *lp++;
3268 toklen += lp - oldlp; 3266 toklen += lp - oldlp;
3269 } 3267 }
3270 token.named = FALSE; 3268 token.named = false;
3271 if (!plainc 3269 if (!plainc
3272 && nestlev > 0 && definedef == dnone) 3270 && nestlev > 0 && definedef == dnone)
3273 /* in struct body */ 3271 /* in struct body */
@@ -3278,7 +3276,7 @@ C_entries (int c_ext, FILE *inf)
3278 linebuffer_setlen (&token_name, len+qlen+toklen); 3276 linebuffer_setlen (&token_name, len+qlen+toklen);
3279 sprintf (token_name.buffer + len, "%s%.*s", 3277 sprintf (token_name.buffer + len, "%s%.*s",
3280 qualifier, toklen, newlb.buffer + tokoff); 3278 qualifier, toklen, newlb.buffer + tokoff);
3281 token.named = TRUE; 3279 token.named = true;
3282 } 3280 }
3283 else if (objdef == ocatseen) 3281 else if (objdef == ocatseen)
3284 /* Objective C category */ 3282 /* Objective C category */
@@ -3287,13 +3285,13 @@ C_entries (int c_ext, FILE *inf)
3287 linebuffer_setlen (&token_name, len); 3285 linebuffer_setlen (&token_name, len);
3288 sprintf (token_name.buffer, "%s(%.*s)", 3286 sprintf (token_name.buffer, "%s(%.*s)",
3289 objtag, toklen, newlb.buffer + tokoff); 3287 objtag, toklen, newlb.buffer + tokoff);
3290 token.named = TRUE; 3288 token.named = true;
3291 } 3289 }
3292 else if (objdef == omethodtag 3290 else if (objdef == omethodtag
3293 || objdef == omethodparm) 3291 || objdef == omethodparm)
3294 /* Objective C method */ 3292 /* Objective C method */
3295 { 3293 {
3296 token.named = TRUE; 3294 token.named = true;
3297 } 3295 }
3298 else if (fvdef == fdefunname) 3296 else if (fvdef == fdefunname)
3299 /* GNU DEFUN and similar macros */ 3297 /* GNU DEFUN and similar macros */
@@ -3341,7 +3339,7 @@ C_entries (int c_ext, FILE *inf)
3341 token.length = toklen; 3339 token.length = toklen;
3342 token.line = newlb.buffer; 3340 token.line = newlb.buffer;
3343 token.linepos = newlinepos; 3341 token.linepos = newlinepos;
3344 token.valid = TRUE; 3342 token.valid = true;
3345 3343
3346 if (definedef == dnone 3344 if (definedef == dnone
3347 && (fvdef == fvnameseen 3345 && (fvdef == fvnameseen
@@ -3369,7 +3367,7 @@ C_entries (int c_ext, FILE *inf)
3369 fvdef = fvnone; 3367 fvdef = fvnone;
3370 } 3368 }
3371 } 3369 }
3372 midtoken = FALSE; 3370 midtoken = false;
3373 } 3371 }
3374 } /* if (endtoken (c)) */ 3372 } /* if (endtoken (c)) */
3375 else if (intoken (c)) 3373 else if (intoken (c))
@@ -3395,7 +3393,7 @@ C_entries (int c_ext, FILE *inf)
3395 case flistseen: 3393 case flistseen:
3396 if (plainc || declarations) 3394 if (plainc || declarations)
3397 { 3395 {
3398 make_C_tag (TRUE); /* a function */ 3396 make_C_tag (true); /* a function */
3399 fvdef = fignore; 3397 fvdef = fignore;
3400 } 3398 }
3401 break; 3399 break;
@@ -3414,7 +3412,7 @@ C_entries (int c_ext, FILE *inf)
3414 { 3412 {
3415 tokoff = lp - 1 - newlb.buffer; 3413 tokoff = lp - 1 - newlb.buffer;
3416 toklen = 1; 3414 toklen = 1;
3417 midtoken = TRUE; 3415 midtoken = true;
3418 } 3416 }
3419 continue; 3417 continue;
3420 } /* if (begtoken) */ 3418 } /* if (begtoken) */
@@ -3430,7 +3428,7 @@ C_entries (int c_ext, FILE *inf)
3430 break; 3428 break;
3431 if (yacc_rules && token.offset == 0 && token.valid) 3429 if (yacc_rules && token.offset == 0 && token.valid)
3432 { 3430 {
3433 make_C_tag (FALSE); /* a yacc function */ 3431 make_C_tag (false); /* a yacc function */
3434 break; 3432 break;
3435 } 3433 }
3436 if (definedef != dnone) 3434 if (definedef != dnone)
@@ -3439,7 +3437,7 @@ C_entries (int c_ext, FILE *inf)
3439 { 3437 {
3440 case otagseen: 3438 case otagseen:
3441 objdef = oignore; 3439 objdef = oignore;
3442 make_C_tag (TRUE); /* an Objective C class */ 3440 make_C_tag (true); /* an Objective C class */
3443 break; 3441 break;
3444 case omethodtag: 3442 case omethodtag:
3445 case omethodparm: 3443 case omethodparm:
@@ -3456,7 +3454,7 @@ C_entries (int c_ext, FILE *inf)
3456 /* Should be useless, but may be work as a safety net. */ 3454 /* Should be useless, but may be work as a safety net. */
3457 if (cplpl && fvdef == flistseen) 3455 if (cplpl && fvdef == flistseen)
3458 { 3456 {
3459 make_C_tag (TRUE); /* a function */ 3457 make_C_tag (true); /* a function */
3460 fvdef = fignore; 3458 fvdef = fignore;
3461 break; 3459 break;
3462 } 3460 }
@@ -3468,7 +3466,7 @@ C_entries (int c_ext, FILE *inf)
3468 { 3466 {
3469 case tend: 3467 case tend:
3470 case ttypeseen: 3468 case ttypeseen:
3471 make_C_tag (FALSE); /* a typedef */ 3469 make_C_tag (false); /* a typedef */
3472 typdef = tnone; 3470 typdef = tnone;
3473 fvdef = fvnone; 3471 fvdef = fvnone;
3474 break; 3472 break;
@@ -3484,10 +3482,10 @@ C_entries (int c_ext, FILE *inf)
3484 case fvnameseen: 3482 case fvnameseen:
3485 if ((globals && bracelev == 0 && (!fvextern || declarations)) 3483 if ((globals && bracelev == 0 && (!fvextern || declarations))
3486 || (members && instruct)) 3484 || (members && instruct))
3487 make_C_tag (FALSE); /* a variable */ 3485 make_C_tag (false); /* a variable */
3488 fvextern = FALSE; 3486 fvextern = false;
3489 fvdef = fvnone; 3487 fvdef = fvnone;
3490 token.valid = FALSE; 3488 token.valid = false;
3491 break; 3489 break;
3492 case flistseen: 3490 case flistseen:
3493 if ((declarations 3491 if ((declarations
@@ -3495,16 +3493,16 @@ C_entries (int c_ext, FILE *inf)
3495 && (typdef == tnone || (typdef != tignore && instruct))) 3493 && (typdef == tnone || (typdef != tignore && instruct)))
3496 || (members 3494 || (members
3497 && plainc && instruct)) 3495 && plainc && instruct))
3498 make_C_tag (TRUE); /* a function */ 3496 make_C_tag (true); /* a function */
3499 /* FALLTHRU */ 3497 /* FALLTHRU */
3500 default: 3498 default:
3501 fvextern = FALSE; 3499 fvextern = false;
3502 fvdef = fvnone; 3500 fvdef = fvnone;
3503 if (declarations 3501 if (declarations
3504 && cplpl && structdef == stagseen) 3502 && cplpl && structdef == stagseen)
3505 make_C_tag (FALSE); /* forward declaration */ 3503 make_C_tag (false); /* forward declaration */
3506 else 3504 else
3507 token.valid = FALSE; 3505 token.valid = false;
3508 } /* switch (fvdef) */ 3506 } /* switch (fvdef) */
3509 /* FALLTHRU */ 3507 /* FALLTHRU */
3510 default: 3508 default:
@@ -3521,7 +3519,7 @@ C_entries (int c_ext, FILE *inf)
3521 { 3519 {
3522 case omethodtag: 3520 case omethodtag:
3523 case omethodparm: 3521 case omethodparm:
3524 make_C_tag (TRUE); /* an Objective C method */ 3522 make_C_tag (true); /* an Objective C method */
3525 objdef = oinbody; 3523 objdef = oinbody;
3526 break; 3524 break;
3527 } 3525 }
@@ -3544,18 +3542,18 @@ C_entries (int c_ext, FILE *inf)
3544 && templatelev == 0 3542 && templatelev == 0
3545 && (!fvextern || declarations)) 3543 && (!fvextern || declarations))
3546 || (members && instruct))) 3544 || (members && instruct)))
3547 make_C_tag (FALSE); /* a variable */ 3545 make_C_tag (false); /* a variable */
3548 break; 3546 break;
3549 case flistseen: 3547 case flistseen:
3550 if ((declarations && typdef == tnone && !instruct) 3548 if ((declarations && typdef == tnone && !instruct)
3551 || (members && typdef != tignore && instruct)) 3549 || (members && typdef != tignore && instruct))
3552 { 3550 {
3553 make_C_tag (TRUE); /* a function */ 3551 make_C_tag (true); /* a function */
3554 fvdef = fvnameseen; 3552 fvdef = fvnameseen;
3555 } 3553 }
3556 else if (!declarations) 3554 else if (!declarations)
3557 fvdef = fvnone; 3555 fvdef = fvnone;
3558 token.valid = FALSE; 3556 token.valid = false;
3559 break; 3557 break;
3560 default: 3558 default:
3561 fvdef = fvnone; 3559 fvdef = fvnone;
@@ -3573,7 +3571,7 @@ C_entries (int c_ext, FILE *inf)
3573 case ttypeseen: 3571 case ttypeseen:
3574 case tend: 3572 case tend:
3575 typdef = tignore; 3573 typdef = tignore;
3576 make_C_tag (FALSE); /* a typedef */ 3574 make_C_tag (false); /* a typedef */
3577 break; 3575 break;
3578 case tnone: 3576 case tnone:
3579 case tinbody: 3577 case tinbody:
@@ -3588,7 +3586,7 @@ C_entries (int c_ext, FILE *inf)
3588 if ((members && bracelev == 1) 3586 if ((members && bracelev == 1)
3589 || (globals && bracelev == 0 3587 || (globals && bracelev == 0
3590 && (!fvextern || declarations))) 3588 && (!fvextern || declarations)))
3591 make_C_tag (FALSE); /* a variable */ 3589 make_C_tag (false); /* a variable */
3592 /* FALLTHRU */ 3590 /* FALLTHRU */
3593 default: 3591 default:
3594 fvdef = fvnone; 3592 fvdef = fvnone;
@@ -3615,7 +3613,7 @@ C_entries (int c_ext, FILE *inf)
3615 { 3613 {
3616 /* This handles constructs like: 3614 /* This handles constructs like:
3617 typedef void OperatorFun (int fun); */ 3615 typedef void OperatorFun (int fun); */
3618 make_C_tag (FALSE); 3616 make_C_tag (false);
3619 typdef = tignore; 3617 typdef = tignore;
3620 fvdef = fignore; 3618 fvdef = fignore;
3621 break; 3619 break;
@@ -3634,14 +3632,14 @@ C_entries (int c_ext, FILE *inf)
3634 if (inattribute) 3632 if (inattribute)
3635 { 3633 {
3636 if (--attrparlev == 0) 3634 if (--attrparlev == 0)
3637 inattribute = FALSE; 3635 inattribute = false;
3638 break; 3636 break;
3639 } 3637 }
3640 if (definedef != dnone) 3638 if (definedef != dnone)
3641 break; 3639 break;
3642 if (objdef == ocatseen && parlev == 1) 3640 if (objdef == ocatseen && parlev == 1)
3643 { 3641 {
3644 make_C_tag (TRUE); /* an Objective C category */ 3642 make_C_tag (true); /* an Objective C category */
3645 objdef = oignore; 3643 objdef = oignore;
3646 } 3644 }
3647 if (--parlev == 0) 3645 if (--parlev == 0)
@@ -3658,7 +3656,7 @@ C_entries (int c_ext, FILE *inf)
3658 || typdef == ttypeseen)) 3656 || typdef == ttypeseen))
3659 { 3657 {
3660 typdef = tignore; 3658 typdef = tignore;
3661 make_C_tag (FALSE); /* a typedef */ 3659 make_C_tag (false); /* a typedef */
3662 } 3660 }
3663 } 3661 }
3664 else if (parlev < 0) /* can happen due to ill-conceived #if's. */ 3662 else if (parlev < 0) /* can happen due to ill-conceived #if's. */
@@ -3677,7 +3675,7 @@ C_entries (int c_ext, FILE *inf)
3677 switch (fvdef) 3675 switch (fvdef)
3678 { 3676 {
3679 case flistseen: 3677 case flistseen:
3680 make_C_tag (TRUE); /* a function */ 3678 make_C_tag (true); /* a function */
3681 /* FALLTHRU */ 3679 /* FALLTHRU */
3682 case fignore: 3680 case fignore:
3683 fvdef = fvnone; 3681 fvdef = fvnone;
@@ -3686,12 +3684,12 @@ C_entries (int c_ext, FILE *inf)
3686 switch (objdef) 3684 switch (objdef)
3687 { 3685 {
3688 case otagseen: 3686 case otagseen:
3689 make_C_tag (TRUE); /* an Objective C class */ 3687 make_C_tag (true); /* an Objective C class */
3690 objdef = oignore; 3688 objdef = oignore;
3691 break; 3689 break;
3692 case omethodtag: 3690 case omethodtag:
3693 case omethodparm: 3691 case omethodparm:
3694 make_C_tag (TRUE); /* an Objective C method */ 3692 make_C_tag (true); /* an Objective C method */
3695 objdef = oinbody; 3693 objdef = oinbody;
3696 break; 3694 break;
3697 default: 3695 default:
@@ -3712,7 +3710,7 @@ C_entries (int c_ext, FILE *inf)
3712 case scolonseen: /* a class */ 3710 case scolonseen: /* a class */
3713 pushclass_above (bracelev,token.line+token.offset, token.length); 3711 pushclass_above (bracelev,token.line+token.offset, token.length);
3714 structdef = snone; 3712 structdef = snone;
3715 make_C_tag (FALSE); /* a struct or enum */ 3713 make_C_tag (false); /* a struct or enum */
3716 break; 3714 break;
3717 } 3715 }
3718 bracelev += 1; 3716 bracelev += 1;
@@ -3723,7 +3721,7 @@ C_entries (int c_ext, FILE *inf)
3723 if (fvdef == fstartlist) 3721 if (fvdef == fstartlist)
3724 { 3722 {
3725 fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */ 3723 fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */
3726 token.valid = FALSE; 3724 token.valid = false;
3727 } 3725 }
3728 break; 3726 break;
3729 case '}': 3727 case '}':
@@ -3733,13 +3731,13 @@ C_entries (int c_ext, FILE *inf)
3733 if (!ignoreindent && lp == newlb.buffer + 1) 3731 if (!ignoreindent && lp == newlb.buffer + 1)
3734 { 3732 {
3735 if (bracelev != 0) 3733 if (bracelev != 0)
3736 token.valid = FALSE; /* unexpected value, token unreliable */ 3734 token.valid = false; /* unexpected value, token unreliable */
3737 bracelev = 0; /* reset brace level if first column */ 3735 bracelev = 0; /* reset brace level if first column */
3738 parlev = 0; /* also reset paren level, just in case... */ 3736 parlev = 0; /* also reset paren level, just in case... */
3739 } 3737 }
3740 else if (bracelev < 0) 3738 else if (bracelev < 0)
3741 { 3739 {
3742 token.valid = FALSE; /* something gone amiss, token unreliable */ 3740 token.valid = false; /* something gone amiss, token unreliable */
3743 bracelev = 0; 3741 bracelev = 0;
3744 } 3742 }
3745 if (bracelev == 0 && fvdef == vignore) 3743 if (bracelev == 0 && fvdef == vignore)
@@ -3766,7 +3764,7 @@ C_entries (int c_ext, FILE *inf)
3766 case fvnameseen: 3764 case fvnameseen:
3767 if ((members && bracelev == 1) 3765 if ((members && bracelev == 1)
3768 || (globals && bracelev == 0 && (!fvextern || declarations))) 3766 || (globals && bracelev == 0 && (!fvextern || declarations)))
3769 make_C_tag (FALSE); /* a variable */ 3767 make_C_tag (false); /* a variable */
3770 /* FALLTHRU */ 3768 /* FALLTHRU */
3771 default: 3769 default:
3772 fvdef = vignore; 3770 fvdef = vignore;
@@ -3815,7 +3813,7 @@ C_entries (int c_ext, FILE *inf)
3815 case '\0': 3813 case '\0':
3816 if (objdef == otagseen) 3814 if (objdef == otagseen)
3817 { 3815 {
3818 make_C_tag (TRUE); /* an Objective C class */ 3816 make_C_tag (true); /* an Objective C class */
3819 objdef = oignore; 3817 objdef = oignore;
3820 } 3818 }
3821 /* If a macro spans multiple lines don't reset its state. */ 3819 /* If a macro spans multiple lines don't reset its state. */
@@ -3885,18 +3883,18 @@ Yacc_entries (FILE *inf)
3885 && /* instructions at start of loop */ \ 3883 && /* instructions at start of loop */ \
3886 (readline (&line_buffer, file_pointer), \ 3884 (readline (&line_buffer, file_pointer), \
3887 char_pointer = line_buffer.buffer, \ 3885 char_pointer = line_buffer.buffer, \
3888 TRUE); \ 3886 true); \
3889 ) 3887 )
3890 3888
3891#define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \ 3889#define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \
3892 ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \ 3890 ((assert ("" kw), true) /* syntax error if not a literal string */ \
3893 && strneq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ 3891 && strneq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \
3894 && notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \ 3892 && notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \
3895 && ((cp) = skip_spaces ((cp)+sizeof (kw)-1))) /* skip spaces */ 3893 && ((cp) = skip_spaces ((cp)+sizeof (kw)-1))) /* skip spaces */
3896 3894
3897/* Similar to LOOKING_AT but does not use notinname, does not skip */ 3895/* Similar to LOOKING_AT but does not use notinname, does not skip */
3898#define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \ 3896#define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \
3899 ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \ 3897 ((assert ("" kw), true) /* syntax error if not a literal string */ \
3900 && strncaseeq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \ 3898 && strncaseeq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \
3901 && ((cp) += sizeof (kw)-1)) /* skip spaces */ 3899 && ((cp) += sizeof (kw)-1)) /* skip spaces */
3902 3900
@@ -3959,7 +3957,7 @@ F_getit (FILE *inf)
3959 return; 3957 return;
3960 for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++) 3958 for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++)
3961 continue; 3959 continue;
3962 make_tag (dbp, cp-dbp, TRUE, 3960 make_tag (dbp, cp-dbp, true,
3963 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 3961 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
3964} 3962}
3965 3963
@@ -4036,7 +4034,7 @@ Fortran_functions (FILE *inf)
4036 { 4034 {
4037 dbp = skip_spaces (dbp); 4035 dbp = skip_spaces (dbp);
4038 if (*dbp == '\0') /* assume un-named */ 4036 if (*dbp == '\0') /* assume un-named */
4039 make_tag ("blockdata", 9, TRUE, 4037 make_tag ("blockdata", 9, true,
4040 lb.buffer, dbp - lb.buffer, lineno, linecharno); 4038 lb.buffer, dbp - lb.buffer, lineno, linecharno);
4041 else 4039 else
4042 F_getit (inf); /* look for name */ 4040 F_getit (inf); /* look for name */
@@ -4109,7 +4107,7 @@ Ada_getit (FILE *inf, const char *name_qualifier)
4109 *cp = '\0'; 4107 *cp = '\0';
4110 name = concat (dbp, name_qualifier, ""); 4108 name = concat (dbp, name_qualifier, "");
4111 *cp = c; 4109 *cp = c;
4112 make_tag (name, strlen (name), TRUE, 4110 make_tag (name, strlen (name), true,
4113 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4111 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4114 free (name); 4112 free (name);
4115 if (c == '"') 4113 if (c == '"')
@@ -4121,8 +4119,8 @@ Ada_getit (FILE *inf, const char *name_qualifier)
4121static void 4119static void
4122Ada_funcs (FILE *inf) 4120Ada_funcs (FILE *inf)
4123{ 4121{
4124 bool inquote = FALSE; 4122 bool inquote = false;
4125 bool skip_till_semicolumn = FALSE; 4123 bool skip_till_semicolumn = false;
4126 4124
4127 LOOP_ON_INPUT_LINES (inf, lb, dbp) 4125 LOOP_ON_INPUT_LINES (inf, lb, dbp)
4128 { 4126 {
@@ -4134,13 +4132,13 @@ Ada_funcs (FILE *inf)
4134 dbp = etags_strchr (dbp + !inquote, '"'); 4132 dbp = etags_strchr (dbp + !inquote, '"');
4135 if (dbp != NULL) 4133 if (dbp != NULL)
4136 { 4134 {
4137 inquote = FALSE; 4135 inquote = false;
4138 dbp += 1; 4136 dbp += 1;
4139 continue; /* advance char */ 4137 continue; /* advance char */
4140 } 4138 }
4141 else 4139 else
4142 { 4140 {
4143 inquote = TRUE; 4141 inquote = true;
4144 break; /* advance line */ 4142 break; /* advance line */
4145 } 4143 }
4146 } 4144 }
@@ -4162,7 +4160,7 @@ Ada_funcs (FILE *inf)
4162 if (skip_till_semicolumn) 4160 if (skip_till_semicolumn)
4163 { 4161 {
4164 if (*dbp == ';') 4162 if (*dbp == ';')
4165 skip_till_semicolumn = FALSE; 4163 skip_till_semicolumn = false;
4166 dbp++; 4164 dbp++;
4167 continue; /* advance char */ 4165 continue; /* advance char */
4168 } 4166 }
@@ -4199,7 +4197,7 @@ Ada_funcs (FILE *inf)
4199 { 4197 {
4200 /* when tagging types, avoid tagging use type Pack.Typename; 4198 /* when tagging types, avoid tagging use type Pack.Typename;
4201 for this, we will skip everything till a ; */ 4199 for this, we will skip everything till a ; */
4202 skip_till_semicolumn = TRUE; 4200 skip_till_semicolumn = true;
4203 continue; /* advance char */ 4201 continue; /* advance char */
4204 } 4202 }
4205 4203
@@ -4248,7 +4246,7 @@ Asm_labels (FILE *inf)
4248 cp++; 4246 cp++;
4249 if (*cp == ':' || iswhite (*cp)) 4247 if (*cp == ':' || iswhite (*cp))
4250 /* Found end of label, so copy it and add it to the table. */ 4248 /* Found end of label, so copy it and add it to the table. */
4251 make_tag (lb.buffer, cp - lb.buffer, TRUE, 4249 make_tag (lb.buffer, cp - lb.buffer, true,
4252 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4250 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4253 } 4251 }
4254 } 4252 }
@@ -4292,7 +4290,7 @@ Perl_functions (FILE *inf)
4292 if ((pos = etags_strchr (sp, ':')) != NULL 4290 if ((pos = etags_strchr (sp, ':')) != NULL
4293 && pos < cp && pos[1] == ':') 4291 && pos < cp && pos[1] == ':')
4294 /* The name is already qualified. */ 4292 /* The name is already qualified. */
4295 make_tag (sp, cp - sp, TRUE, 4293 make_tag (sp, cp - sp, true,
4296 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4294 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4297 else 4295 else
4298 /* Qualify it. */ 4296 /* Qualify it. */
@@ -4303,7 +4301,7 @@ Perl_functions (FILE *inf)
4303 *cp = '\0'; 4301 *cp = '\0';
4304 name = concat (package, "::", sp); 4302 name = concat (package, "::", sp);
4305 *cp = savechar; 4303 *cp = savechar;
4306 make_tag (name, strlen (name), TRUE, 4304 make_tag (name, strlen (name), true,
4307 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4305 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4308 free (name); 4306 free (name);
4309 } 4307 }
@@ -4346,7 +4344,7 @@ Perl_functions (FILE *inf)
4346 else 4344 else
4347 continue; 4345 continue;
4348 4346
4349 make_tag (varstart, cp - varstart, FALSE, 4347 make_tag (varstart, cp - varstart, false,
4350 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4348 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4351 } 4349 }
4352 } 4350 }
@@ -4373,7 +4371,7 @@ Python_functions (FILE *inf)
4373 char *name = cp; 4371 char *name = cp;
4374 while (!notinname (*cp) && *cp != ':') 4372 while (!notinname (*cp) && *cp != ':')
4375 cp++; 4373 cp++;
4376 make_tag (name, cp - name, TRUE, 4374 make_tag (name, cp - name, true,
4377 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4375 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4378 } 4376 }
4379 } 4377 }
@@ -4393,8 +4391,8 @@ Python_functions (FILE *inf)
4393static void 4391static void
4394PHP_functions (FILE *inf) 4392PHP_functions (FILE *inf)
4395{ 4393{
4396 register char *cp, *name; 4394 char *cp, *name;
4397 bool search_identifier = FALSE; 4395 bool search_identifier = false;
4398 4396
4399 LOOP_ON_INPUT_LINES (inf, lb, cp) 4397 LOOP_ON_INPUT_LINES (inf, lb, cp)
4400 { 4398 {
@@ -4405,9 +4403,9 @@ PHP_functions (FILE *inf)
4405 { 4403 {
4406 while (!notinname (*cp)) 4404 while (!notinname (*cp))
4407 cp++; 4405 cp++;
4408 make_tag (name, cp - name, TRUE, 4406 make_tag (name, cp - name, true,
4409 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4407 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4410 search_identifier = FALSE; 4408 search_identifier = false;
4411 } 4409 }
4412 else if (LOOKING_AT (cp, "function")) 4410 else if (LOOKING_AT (cp, "function"))
4413 { 4411 {
@@ -4418,11 +4416,11 @@ PHP_functions (FILE *inf)
4418 name = cp; 4416 name = cp;
4419 while (!notinname (*cp)) 4417 while (!notinname (*cp))
4420 cp++; 4418 cp++;
4421 make_tag (name, cp - name, TRUE, 4419 make_tag (name, cp - name, true,
4422 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4420 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4423 } 4421 }
4424 else 4422 else
4425 search_identifier = TRUE; 4423 search_identifier = true;
4426 } 4424 }
4427 else if (LOOKING_AT (cp, "class")) 4425 else if (LOOKING_AT (cp, "class"))
4428 { 4426 {
@@ -4431,11 +4429,11 @@ PHP_functions (FILE *inf)
4431 name = cp; 4429 name = cp;
4432 while (*cp != '\0' && !iswhite (*cp)) 4430 while (*cp != '\0' && !iswhite (*cp))
4433 cp++; 4431 cp++;
4434 make_tag (name, cp - name, FALSE, 4432 make_tag (name, cp - name, false,
4435 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4433 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4436 } 4434 }
4437 else 4435 else
4438 search_identifier = TRUE; 4436 search_identifier = true;
4439 } 4437 }
4440 else if (strneq (cp, "define", 6) 4438 else if (strneq (cp, "define", 6)
4441 && (cp = skip_spaces (cp+6)) 4439 && (cp = skip_spaces (cp+6))
@@ -4446,7 +4444,7 @@ PHP_functions (FILE *inf)
4446 name = cp; 4444 name = cp;
4447 while (*cp != quote && *cp != '\0') 4445 while (*cp != quote && *cp != '\0')
4448 cp++; 4446 cp++;
4449 make_tag (name, cp - name, FALSE, 4447 make_tag (name, cp - name, false,
4450 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4448 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4451 } 4449 }
4452 else if (members 4450 else if (members
@@ -4456,7 +4454,7 @@ PHP_functions (FILE *inf)
4456 name = cp; 4454 name = cp;
4457 while (!notinname (*cp)) 4455 while (!notinname (*cp))
4458 cp++; 4456 cp++;
4459 make_tag (name, cp - name, FALSE, 4457 make_tag (name, cp - name, false,
4460 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4458 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4461 } 4459 }
4462 } 4460 }
@@ -4487,7 +4485,7 @@ Cobol_paragraphs (FILE *inf)
4487 for (ep = bp; ISALNUM (*ep) || *ep == '-'; ep++) 4485 for (ep = bp; ISALNUM (*ep) || *ep == '-'; ep++)
4488 continue; 4486 continue;
4489 if (*ep++ == '.') 4487 if (*ep++ == '.')
4490 make_tag (bp, ep - bp, TRUE, 4488 make_tag (bp, ep - bp, true,
4491 lb.buffer, ep - lb.buffer + 1, lineno, linecharno); 4489 lb.buffer, ep - lb.buffer + 1, lineno, linecharno);
4492 } 4490 }
4493} 4491}
@@ -4516,7 +4514,7 @@ Makefile_targets (FILE *inf)
4516 while (--bp > namestart) 4514 while (--bp > namestart)
4517 if (!notinname (*bp)) 4515 if (!notinname (*bp))
4518 break; 4516 break;
4519 make_tag (namestart, bp - namestart + 1, TRUE, 4517 make_tag (namestart, bp - namestart + 1, true,
4520 lb.buffer, bp - lb.buffer + 2, lineno, linecharno); 4518 lb.buffer, bp - lb.buffer + 2, lineno, linecharno);
4521 } 4519 }
4522 } 4520 }
@@ -4540,7 +4538,7 @@ Pascal_functions (FILE *inf)
4540 int save_lineno, namelen, taglen; 4538 int save_lineno, namelen, taglen;
4541 char c, *name; 4539 char c, *name;
4542 4540
4543 bool /* each of these flags is TRUE if: */ 4541 bool /* each of these flags is true if: */
4544 incomment, /* point is inside a comment */ 4542 incomment, /* point is inside a comment */
4545 inquote, /* point is inside '..' string */ 4543 inquote, /* point is inside '..' string */
4546 get_tagname, /* point is after PROCEDURE/FUNCTION 4544 get_tagname, /* point is after PROCEDURE/FUNCTION
@@ -4558,11 +4556,11 @@ Pascal_functions (FILE *inf)
4558 *dbp = '\0'; 4556 *dbp = '\0';
4559 linebuffer_init (&tline); 4557 linebuffer_init (&tline);
4560 4558
4561 incomment = inquote = FALSE; 4559 incomment = inquote = false;
4562 found_tag = FALSE; /* have a proc name; check if extern */ 4560 found_tag = false; /* have a proc name; check if extern */
4563 get_tagname = FALSE; /* found "procedure" keyword */ 4561 get_tagname = false; /* found "procedure" keyword */
4564 inparms = FALSE; /* found '(' after "proc" */ 4562 inparms = false; /* found '(' after "proc" */
4565 verify_tag = FALSE; /* check if "extern" is ahead */ 4563 verify_tag = false; /* check if "extern" is ahead */
4566 4564
4567 4565
4568 while (!feof (inf)) /* long main loop to get next char */ 4566 while (!feof (inf)) /* long main loop to get next char */
@@ -4583,46 +4581,46 @@ Pascal_functions (FILE *inf)
4583 if (incomment) 4581 if (incomment)
4584 { 4582 {
4585 if (c == '}') /* within { } comments */ 4583 if (c == '}') /* within { } comments */
4586 incomment = FALSE; 4584 incomment = false;
4587 else if (c == '*' && *dbp == ')') /* within (* *) comments */ 4585 else if (c == '*' && *dbp == ')') /* within (* *) comments */
4588 { 4586 {
4589 dbp++; 4587 dbp++;
4590 incomment = FALSE; 4588 incomment = false;
4591 } 4589 }
4592 continue; 4590 continue;
4593 } 4591 }
4594 else if (inquote) 4592 else if (inquote)
4595 { 4593 {
4596 if (c == '\'') 4594 if (c == '\'')
4597 inquote = FALSE; 4595 inquote = false;
4598 continue; 4596 continue;
4599 } 4597 }
4600 else 4598 else
4601 switch (c) 4599 switch (c)
4602 { 4600 {
4603 case '\'': 4601 case '\'':
4604 inquote = TRUE; /* found first quote */ 4602 inquote = true; /* found first quote */
4605 continue; 4603 continue;
4606 case '{': /* found open { comment */ 4604 case '{': /* found open { comment */
4607 incomment = TRUE; 4605 incomment = true;
4608 continue; 4606 continue;
4609 case '(': 4607 case '(':
4610 if (*dbp == '*') /* found open (* comment */ 4608 if (*dbp == '*') /* found open (* comment */
4611 { 4609 {
4612 incomment = TRUE; 4610 incomment = true;
4613 dbp++; 4611 dbp++;
4614 } 4612 }
4615 else if (found_tag) /* found '(' after tag, i.e., parm-list */ 4613 else if (found_tag) /* found '(' after tag, i.e., parm-list */
4616 inparms = TRUE; 4614 inparms = true;
4617 continue; 4615 continue;
4618 case ')': /* end of parms list */ 4616 case ')': /* end of parms list */
4619 if (inparms) 4617 if (inparms)
4620 inparms = FALSE; 4618 inparms = false;
4621 continue; 4619 continue;
4622 case ';': 4620 case ';':
4623 if (found_tag && !inparms) /* end of proc or fn stmt */ 4621 if (found_tag && !inparms) /* end of proc or fn stmt */
4624 { 4622 {
4625 verify_tag = TRUE; 4623 verify_tag = true;
4626 break; 4624 break;
4627 } 4625 }
4628 continue; 4626 continue;
@@ -4636,23 +4634,23 @@ Pascal_functions (FILE *inf)
4636 { 4634 {
4637 if (nocase_tail ("extern")) /* superfluous, really! */ 4635 if (nocase_tail ("extern")) /* superfluous, really! */
4638 { 4636 {
4639 found_tag = FALSE; 4637 found_tag = false;
4640 verify_tag = FALSE; 4638 verify_tag = false;
4641 } 4639 }
4642 } 4640 }
4643 else if (lowcase (*dbp) == 'f') 4641 else if (lowcase (*dbp) == 'f')
4644 { 4642 {
4645 if (nocase_tail ("forward")) /* check for forward reference */ 4643 if (nocase_tail ("forward")) /* check for forward reference */
4646 { 4644 {
4647 found_tag = FALSE; 4645 found_tag = false;
4648 verify_tag = FALSE; 4646 verify_tag = false;
4649 } 4647 }
4650 } 4648 }
4651 if (found_tag && verify_tag) /* not external proc, so make tag */ 4649 if (found_tag && verify_tag) /* not external proc, so make tag */
4652 { 4650 {
4653 found_tag = FALSE; 4651 found_tag = false;
4654 verify_tag = FALSE; 4652 verify_tag = false;
4655 make_tag (name, namelen, TRUE, 4653 make_tag (name, namelen, true,
4656 tline.buffer, taglen, save_lineno, save_lcno); 4654 tline.buffer, taglen, save_lineno, save_lcno);
4657 continue; 4655 continue;
4658 } 4656 }
@@ -4678,8 +4676,8 @@ Pascal_functions (FILE *inf)
4678 taglen = cp - lb.buffer + 1; 4676 taglen = cp - lb.buffer + 1;
4679 4677
4680 dbp = cp; /* set dbp to e-o-token */ 4678 dbp = cp; /* set dbp to e-o-token */
4681 get_tagname = FALSE; 4679 get_tagname = false;
4682 found_tag = TRUE; 4680 found_tag = true;
4683 continue; 4681 continue;
4684 4682
4685 /* And proceed to check for "extern". */ 4683 /* And proceed to check for "extern". */
@@ -4691,11 +4689,11 @@ Pascal_functions (FILE *inf)
4691 { 4689 {
4692 case 'p': 4690 case 'p':
4693 if (nocase_tail ("rocedure")) /* c = 'p', dbp has advanced */ 4691 if (nocase_tail ("rocedure")) /* c = 'p', dbp has advanced */
4694 get_tagname = TRUE; 4692 get_tagname = true;
4695 continue; 4693 continue;
4696 case 'f': 4694 case 'f':
4697 if (nocase_tail ("unction")) 4695 if (nocase_tail ("unction"))
4698 get_tagname = TRUE; 4696 get_tagname = true;
4699 continue; 4697 continue;
4700 } 4698 }
4701 } 4699 }
@@ -4824,7 +4822,7 @@ PS_functions (FILE *inf)
4824 *ep != '\0' && *ep != ' ' && *ep != '{'; 4822 *ep != '\0' && *ep != ' ' && *ep != '{';
4825 ep++) 4823 ep++)
4826 continue; 4824 continue;
4827 make_tag (bp, ep - bp, TRUE, 4825 make_tag (bp, ep - bp, true,
4828 lb.buffer, ep - lb.buffer + 1, lineno, linecharno); 4826 lb.buffer, ep - lb.buffer + 1, lineno, linecharno);
4829 } 4827 }
4830 else if (LOOKING_AT (bp, "defineps")) 4828 else if (LOOKING_AT (bp, "defineps"))
@@ -4954,14 +4952,14 @@ TeX_commands (FILE *inf)
4954 for (key = TEX_toktab; key->buffer != NULL; key++) 4952 for (key = TEX_toktab; key->buffer != NULL; key++)
4955 if (strneq (cp, key->buffer, key->len)) 4953 if (strneq (cp, key->buffer, key->len))
4956 { 4954 {
4957 register char *p; 4955 char *p;
4958 int namelen, linelen; 4956 int namelen, linelen;
4959 bool opgrp = FALSE; 4957 bool opgrp = false;
4960 4958
4961 cp = skip_spaces (cp + key->len); 4959 cp = skip_spaces (cp + key->len);
4962 if (*cp == TEX_opgrp) 4960 if (*cp == TEX_opgrp)
4963 { 4961 {
4964 opgrp = TRUE; 4962 opgrp = true;
4965 cp++; 4963 cp++;
4966 } 4964 }
4967 for (p = cp; 4965 for (p = cp;
@@ -4977,7 +4975,7 @@ TeX_commands (FILE *inf)
4977 p++; 4975 p++;
4978 linelen = p - lb.buffer + 1; 4976 linelen = p - lb.buffer + 1;
4979 } 4977 }
4980 make_tag (cp, namelen, TRUE, 4978 make_tag (cp, namelen, true,
4981 lb.buffer, linelen, lineno, linecharno); 4979 lb.buffer, linelen, lineno, linecharno);
4982 goto tex_next_line; /* We only tag a line once */ 4980 goto tex_next_line; /* We only tag a line once */
4983 } 4981 }
@@ -5081,7 +5079,7 @@ Texinfo_nodes (FILE *inf)
5081 start = cp; 5079 start = cp;
5082 while (*cp != '\0' && *cp != ',') 5080 while (*cp != '\0' && *cp != ',')
5083 cp++; 5081 cp++;
5084 make_tag (start, cp - start, TRUE, 5082 make_tag (start, cp - start, true,
5085 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 5083 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
5086 } 5084 }
5087} 5085}
@@ -5097,10 +5095,10 @@ Texinfo_nodes (FILE *inf)
5097static void 5095static void
5098HTML_labels (FILE *inf) 5096HTML_labels (FILE *inf)
5099{ 5097{
5100 bool getnext = FALSE; /* next text outside of HTML tags is a tag */ 5098 bool getnext = false; /* next text outside of HTML tags is a tag */
5101 bool skiptag = FALSE; /* skip to the end of the current HTML tag */ 5099 bool skiptag = false; /* skip to the end of the current HTML tag */
5102 bool intag = FALSE; /* inside an html tag, looking for ID= */ 5100 bool intag = false; /* inside an html tag, looking for ID= */
5103 bool inanchor = FALSE; /* when INTAG, is an anchor, look for NAME= */ 5101 bool inanchor = false; /* when INTAG, is an anchor, look for NAME= */
5104 char *end; 5102 char *end;
5105 5103
5106 5104
@@ -5116,7 +5114,7 @@ HTML_labels (FILE *inf)
5116 if (*dbp == '>') 5114 if (*dbp == '>')
5117 { 5115 {
5118 dbp += 1; 5116 dbp += 1;
5119 skiptag = FALSE; 5117 skiptag = false;
5120 continue; /* look on the same line */ 5118 continue; /* look on the same line */
5121 } 5119 }
5122 break; /* go to next line */ 5120 break; /* go to next line */
@@ -5132,7 +5130,7 @@ HTML_labels (FILE *inf)
5132 if (*dbp == '>') 5130 if (*dbp == '>')
5133 { 5131 {
5134 dbp += 1; 5132 dbp += 1;
5135 intag = FALSE; 5133 intag = false;
5136 continue; /* look on the same line */ 5134 continue; /* look on the same line */
5137 } 5135 }
5138 if ((inanchor && LOOKING_AT_NOCASE (dbp, "name=")) 5136 if ((inanchor && LOOKING_AT_NOCASE (dbp, "name="))
@@ -5151,9 +5149,9 @@ HTML_labels (FILE *inf)
5151 token_name.buffer[end - dbp] = '\0'; 5149 token_name.buffer[end - dbp] = '\0';
5152 5150
5153 dbp = end; 5151 dbp = end;
5154 intag = FALSE; /* we found what we looked for */ 5152 intag = false; /* we found what we looked for */
5155 skiptag = TRUE; /* skip to the end of the tag */ 5153 skiptag = true; /* skip to the end of the tag */
5156 getnext = TRUE; /* then grab the text */ 5154 getnext = true; /* then grab the text */
5157 continue; /* look on the same line */ 5155 continue; /* look on the same line */
5158 } 5156 }
5159 dbp += 1; 5157 dbp += 1;
@@ -5166,17 +5164,17 @@ HTML_labels (FILE *inf)
5166 break; /* go to next line */ 5164 break; /* go to next line */
5167 if (*dbp == '<') 5165 if (*dbp == '<')
5168 { 5166 {
5169 intag = TRUE; 5167 intag = true;
5170 inanchor = (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])); 5168 inanchor = (lowcase (dbp[1]) == 'a' && !intoken (dbp[2]));
5171 continue; /* look on the same line */ 5169 continue; /* look on the same line */
5172 } 5170 }
5173 5171
5174 for (end = dbp + 1; *end != '\0' && *end != '<'; end++) 5172 for (end = dbp + 1; *end != '\0' && *end != '<'; end++)
5175 continue; 5173 continue;
5176 make_tag (token_name.buffer, token_name.len, TRUE, 5174 make_tag (token_name.buffer, token_name.len, true,
5177 dbp, end - dbp, lineno, linecharno); 5175 dbp, end - dbp, lineno, linecharno);
5178 linebuffer_setlen (&token_name, 0); /* no name in buffer */ 5176 linebuffer_setlen (&token_name, 0); /* no name in buffer */
5179 getnext = FALSE; 5177 getnext = false;
5180 break; /* go to next line */ 5178 break; /* go to next line */
5181 } 5179 }
5182 5180
@@ -5186,10 +5184,10 @@ HTML_labels (FILE *inf)
5186 dbp++; 5184 dbp++;
5187 if (*dbp == '\0') 5185 if (*dbp == '\0')
5188 break; /* go to next line */ 5186 break; /* go to next line */
5189 intag = TRUE; 5187 intag = true;
5190 if (lowcase (dbp[1]) == 'a' && !intoken (dbp[2])) 5188 if (lowcase (dbp[1]) == 'a' && !intoken (dbp[2]))
5191 { 5189 {
5192 inanchor = TRUE; 5190 inanchor = true;
5193 continue; /* look on the same line */ 5191 continue; /* look on the same line */
5194 } 5192 }
5195 else if (LOOKING_AT_NOCASE (dbp, "<title>") 5193 else if (LOOKING_AT_NOCASE (dbp, "<title>")
@@ -5197,8 +5195,8 @@ HTML_labels (FILE *inf)
5197 || LOOKING_AT_NOCASE (dbp, "<h2>") 5195 || LOOKING_AT_NOCASE (dbp, "<h2>")
5198 || LOOKING_AT_NOCASE (dbp, "<h3>")) 5196 || LOOKING_AT_NOCASE (dbp, "<h3>"))
5199 { 5197 {
5200 intag = FALSE; 5198 intag = false;
5201 getnext = TRUE; 5199 getnext = true;
5202 continue; /* look on the same line */ 5200 continue; /* look on the same line */
5203 } 5201 }
5204 dbp += 1; 5202 dbp += 1;
@@ -5303,7 +5301,7 @@ prolog_pr (char *s, char *last)
5303 || len != strlen (last) 5301 || len != strlen (last)
5304 || !strneq (s, last, len))) 5302 || !strneq (s, last, len)))
5305 { 5303 {
5306 make_tag (s, len, TRUE, s, pos, lineno, linecharno); 5304 make_tag (s, len, true, s, pos, lineno, linecharno);
5307 return len; 5305 return len;
5308 } 5306 }
5309 else 5307 else
@@ -5459,7 +5457,7 @@ erlang_func (char *s, char *last)
5459 || len != (int)strlen (last) 5457 || len != (int)strlen (last)
5460 || !strneq (s, last, len))) 5458 || !strneq (s, last, len)))
5461 { 5459 {
5462 make_tag (s, len, TRUE, s, pos, lineno, linecharno); 5460 make_tag (s, len, true, s, pos, lineno, linecharno);
5463 return len; 5461 return len;
5464 } 5462 }
5465 5463
@@ -5486,7 +5484,7 @@ erlang_attribute (char *s)
5486 { 5484 {
5487 int len = erlang_atom (skip_spaces (cp)); 5485 int len = erlang_atom (skip_spaces (cp));
5488 if (len > 0) 5486 if (len > 0)
5489 make_tag (cp, len, TRUE, s, cp + len - s, lineno, linecharno); 5487 make_tag (cp, len, true, s, cp + len - s, lineno, linecharno);
5490 } 5488 }
5491 return; 5489 return;
5492} 5490}
@@ -5539,7 +5537,7 @@ scan_separators (char *name)
5539{ 5537{
5540 char sep = name[0]; 5538 char sep = name[0];
5541 char *copyto = name; 5539 char *copyto = name;
5542 bool quoted = FALSE; 5540 bool quoted = false;
5543 5541
5544 for (++name; *name != '\0'; ++name) 5542 for (++name; *name != '\0'; ++name)
5545 { 5543 {
@@ -5567,10 +5565,10 @@ scan_separators (char *name)
5567 } 5565 }
5568 break; 5566 break;
5569 } 5567 }
5570 quoted = FALSE; 5568 quoted = false;
5571 } 5569 }
5572 else if (*name == '\\') 5570 else if (*name == '\\')
5573 quoted = TRUE; 5571 quoted = true;
5574 else if (*name == sep) 5572 else if (*name == sep)
5575 break; 5573 break;
5576 else 5574 else
@@ -5664,10 +5662,10 @@ add_regex (char *regexp_pattern, language *lang)
5664 struct re_pattern_buffer *patbuf; 5662 struct re_pattern_buffer *patbuf;
5665 regexp *rp; 5663 regexp *rp;
5666 bool 5664 bool
5667 force_explicit_name = TRUE, /* do not use implicit tag names */ 5665 force_explicit_name = true, /* do not use implicit tag names */
5668 ignore_case = FALSE, /* case is significant */ 5666 ignore_case = false, /* case is significant */
5669 multi_line = FALSE, /* matches are done one line at a time */ 5667 multi_line = false, /* matches are done one line at a time */
5670 single_line = FALSE; /* dot does not match newline */ 5668 single_line = false; /* dot does not match newline */
5671 5669
5672 5670
5673 if (strlen (regexp_pattern) < 3) 5671 if (strlen (regexp_pattern) < 3)
@@ -5703,17 +5701,17 @@ add_regex (char *regexp_pattern, language *lang)
5703 case 'N': 5701 case 'N':
5704 if (modifiers == name) 5702 if (modifiers == name)
5705 error ("forcing explicit tag name but no name, ignoring"); 5703 error ("forcing explicit tag name but no name, ignoring");
5706 force_explicit_name = TRUE; 5704 force_explicit_name = true;
5707 break; 5705 break;
5708 case 'i': 5706 case 'i':
5709 ignore_case = TRUE; 5707 ignore_case = true;
5710 break; 5708 break;
5711 case 's': 5709 case 's':
5712 single_line = TRUE; 5710 single_line = true;
5713 /* FALLTHRU */ 5711 /* FALLTHRU */
5714 case 'm': 5712 case 'm':
5715 multi_line = TRUE; 5713 multi_line = true;
5716 need_filebuf = TRUE; 5714 need_filebuf = true;
5717 break; 5715 break;
5718 default: 5716 default:
5719 error ("invalid regexp modifier `%c', ignoring", modifiers[0]); 5717 error ("invalid regexp modifier `%c', ignoring", modifiers[0]);
@@ -5757,7 +5755,7 @@ add_regex (char *regexp_pattern, language *lang)
5757 p_head->lang = lang; 5755 p_head->lang = lang;
5758 p_head->pat = patbuf; 5756 p_head->pat = patbuf;
5759 p_head->name = savestr (name); 5757 p_head->name = savestr (name);
5760 p_head->error_signaled = FALSE; 5758 p_head->error_signaled = false;
5761 p_head->force_explicit_name = force_explicit_name; 5759 p_head->force_explicit_name = force_explicit_name;
5762 p_head->ignore_case = ignore_case; 5760 p_head->ignore_case = ignore_case;
5763 p_head->multi_line = multi_line; 5761 p_head->multi_line = multi_line;
@@ -5871,7 +5869,7 @@ regex_tag_multiline (void)
5871 { 5869 {
5872 error ("regexp stack overflow while matching \"%s\"", 5870 error ("regexp stack overflow while matching \"%s\"",
5873 rp->pattern); 5871 rp->pattern);
5874 rp->error_signaled = TRUE; 5872 rp->error_signaled = true;
5875 } 5873 }
5876 break; 5874 break;
5877 case -1: 5875 case -1:
@@ -5884,7 +5882,7 @@ regex_tag_multiline (void)
5884 { 5882 {
5885 error ("regexp matches the empty string: \"%s\"", 5883 error ("regexp matches the empty string: \"%s\"",
5886 rp->pattern); 5884 rp->pattern);
5887 rp->error_signaled = TRUE; 5885 rp->error_signaled = true;
5888 } 5886 }
5889 match = -3; /* exit from while loop */ 5887 match = -3; /* exit from while loop */
5890 break; 5888 break;
@@ -5901,10 +5899,10 @@ regex_tag_multiline (void)
5901 name = substitute (buffer, rp->name, &rp->regs); 5899 name = substitute (buffer, rp->name, &rp->regs);
5902 if (rp->force_explicit_name) 5900 if (rp->force_explicit_name)
5903 /* Force explicit tag name, if a name is there. */ 5901 /* Force explicit tag name, if a name is there. */
5904 pfnote (name, TRUE, buffer + linecharno, 5902 pfnote (name, true, buffer + linecharno,
5905 charno - linecharno + 1, lineno, linecharno); 5903 charno - linecharno + 1, lineno, linecharno);
5906 else 5904 else
5907 make_tag (name, strlen (name), TRUE, buffer + linecharno, 5905 make_tag (name, strlen (name), true, buffer + linecharno,
5908 charno - linecharno + 1, lineno, linecharno); 5906 charno - linecharno + 1, lineno, linecharno);
5909 break; 5907 break;
5910 } 5908 }
@@ -5923,9 +5921,9 @@ nocase_tail (const char *cp)
5923 if (*cp == '\0' && !intoken (dbp[len])) 5921 if (*cp == '\0' && !intoken (dbp[len]))
5924 { 5922 {
5925 dbp += len; 5923 dbp += len;
5926 return TRUE; 5924 return true;
5927 } 5925 }
5928 return FALSE; 5926 return false;
5929} 5927}
5930 5928
5931static void 5929static void
@@ -5938,7 +5936,7 @@ get_tag (register char *bp, char **namepp)
5938 /* Go till you get to white space or a syntactic break */ 5936 /* Go till you get to white space or a syntactic break */
5939 for (cp = bp + 1; !notinname (*cp); cp++) 5937 for (cp = bp + 1; !notinname (*cp); cp++)
5940 continue; 5938 continue;
5941 make_tag (bp, cp - bp, TRUE, 5939 make_tag (bp, cp - bp, true,
5942 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 5940 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
5943 } 5941 }
5944 5942
@@ -6073,7 +6071,7 @@ readline (linebuffer *lbp, FILE *stream)
6073 char *taggedfname; /* name of original file as given */ 6071 char *taggedfname; /* name of original file as given */
6074 char *name; /* temp var */ 6072 char *name; /* temp var */
6075 6073
6076 discard_until_line_directive = FALSE; /* found it */ 6074 discard_until_line_directive = false; /* found it */
6077 name = lbp->buffer + start; 6075 name = lbp->buffer + start;
6078 *endp = '\0'; 6076 *endp = '\0';
6079 canonicalize_filename (name); 6077 canonicalize_filename (name);
@@ -6121,7 +6119,7 @@ readline (linebuffer *lbp, FILE *stream)
6121 for (fdp = fdhead; fdp != NULL; fdp = fdp->next) 6119 for (fdp = fdhead; fdp != NULL; fdp = fdp->next)
6122 if (streq (fdp->infabsname, taggedabsname)) 6120 if (streq (fdp->infabsname, taggedabsname))
6123 { 6121 {
6124 discard_until_line_directive = TRUE; 6122 discard_until_line_directive = true;
6125 free (taggedfname); 6123 free (taggedfname);
6126 break; 6124 break;
6127 } 6125 }
@@ -6137,9 +6135,9 @@ readline (linebuffer *lbp, FILE *stream)
6137 fdhead->infabsname = savestr (curfdp->infabsname); 6135 fdhead->infabsname = savestr (curfdp->infabsname);
6138 fdhead->infabsdir = savestr (curfdp->infabsdir); 6136 fdhead->infabsdir = savestr (curfdp->infabsdir);
6139 fdhead->taggedfname = taggedfname; 6137 fdhead->taggedfname = taggedfname;
6140 fdhead->usecharno = FALSE; 6138 fdhead->usecharno = false;
6141 fdhead->prop = NULL; 6139 fdhead->prop = NULL;
6142 fdhead->written = FALSE; 6140 fdhead->written = false;
6143 curfdp = fdhead; 6141 curfdp = fdhead;
6144 } 6142 }
6145 } 6143 }
@@ -6162,7 +6160,7 @@ readline (linebuffer *lbp, FILE *stream)
6162 return; 6160 return;
6163 } 6161 }
6164 /* End of file. */ 6162 /* End of file. */
6165 discard_until_line_directive = FALSE; 6163 discard_until_line_directive = false;
6166 return; 6164 return;
6167 } 6165 }
6168 } /* if #line directives should be considered */ 6166 } /* if #line directives should be considered */
@@ -6192,7 +6190,7 @@ readline (linebuffer *lbp, FILE *stream)
6192 { 6190 {
6193 error ("regexp stack overflow while matching \"%s\"", 6191 error ("regexp stack overflow while matching \"%s\"",
6194 rp->pattern); 6192 rp->pattern);
6195 rp->error_signaled = TRUE; 6193 rp->error_signaled = true;
6196 } 6194 }
6197 break; 6195 break;
6198 case -1: 6196 case -1:
@@ -6203,7 +6201,7 @@ readline (linebuffer *lbp, FILE *stream)
6203 if (!rp->error_signaled) 6201 if (!rp->error_signaled)
6204 { 6202 {
6205 error ("regexp matches the empty string: \"%s\"", rp->pattern); 6203 error ("regexp matches the empty string: \"%s\"", rp->pattern);
6206 rp->error_signaled = TRUE; 6204 rp->error_signaled = true;
6207 } 6205 }
6208 break; 6206 break;
6209 default: 6207 default:
@@ -6215,9 +6213,9 @@ readline (linebuffer *lbp, FILE *stream)
6215 name = substitute (lbp->buffer, rp->name, &rp->regs); 6213 name = substitute (lbp->buffer, rp->name, &rp->regs);
6216 if (rp->force_explicit_name) 6214 if (rp->force_explicit_name)
6217 /* Force explicit tag name, if a name is there. */ 6215 /* Force explicit tag name, if a name is there. */
6218 pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno); 6216 pfnote (name, true, lbp->buffer, match, lineno, linecharno);
6219 else 6217 else
6220 make_tag (name, strlen (name), TRUE, 6218 make_tag (name, strlen (name), true,
6221 lbp->buffer, match, lineno, linecharno); 6219 lbp->buffer, match, lineno, linecharno);
6222 break; 6220 break;
6223 } 6221 }
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index 3208a895aa2..b308256a662 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -37,12 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
37#define DEFAULT_GROUPING 0x01 37#define DEFAULT_GROUPING 0x01
38#define DEFAULT_BASE 16 38#define DEFAULT_BASE 16
39 39
40#undef TRUE 40int base = DEFAULT_BASE;
41#undef FALSE 41bool un_flag = false, iso_flag = false, endian = true;
42#define TRUE (1)
43#define FALSE (0)
44
45int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
46int group_by = DEFAULT_GROUPING; 42int group_by = DEFAULT_GROUPING;
47char *progname; 43char *progname;
48 44
@@ -83,7 +79,7 @@ main (int argc, char **argv)
83 } 79 }
84 else if (!strcmp (*argv, "-un") || !strcmp (*argv, "-de")) 80 else if (!strcmp (*argv, "-un") || !strcmp (*argv, "-de"))
85 { 81 {
86 un_flag = TRUE; 82 un_flag = true;
87 --argc; argv++; 83 --argc; argv++;
88 } 84 }
89 else if (!strcmp (*argv, "-hex")) 85 else if (!strcmp (*argv, "-hex"))
@@ -93,7 +89,7 @@ main (int argc, char **argv)
93 } 89 }
94 else if (!strcmp (*argv, "-iso")) 90 else if (!strcmp (*argv, "-iso"))
95 { 91 {
96 iso_flag = TRUE; 92 iso_flag = true;
97 --argc; argv++; 93 --argc; argv++;
98 } 94 }
99 else if (!strcmp (*argv, "-oct")) 95 else if (!strcmp (*argv, "-oct"))
@@ -103,12 +99,12 @@ main (int argc, char **argv)
103 } 99 }
104 else if (!strcmp (*argv, "-big-endian")) 100 else if (!strcmp (*argv, "-big-endian"))
105 { 101 {
106 endian = 1; 102 endian = true;
107 --argc; argv++; 103 --argc; argv++;
108 } 104 }
109 else if (!strcmp (*argv, "-little-endian")) 105 else if (!strcmp (*argv, "-little-endian"))
110 { 106 {
111 endian = 0; 107 endian = false;
112 --argc; argv++; 108 --argc; argv++;
113 } 109 }
114 else if (!strcmp (*argv, "-group-by-8-bits")) 110 else if (!strcmp (*argv, "-group-by-8-bits"))
@@ -129,7 +125,7 @@ main (int argc, char **argv)
129 else if (!strcmp (*argv, "-group-by-64-bits")) 125 else if (!strcmp (*argv, "-group-by-64-bits"))
130 { 126 {
131 group_by = 0x07; 127 group_by = 0x07;
132 endian = 0; 128 endian = false;
133 --argc; argv++; 129 --argc; argv++;
134 } 130 }
135 else 131 else
diff --git a/lib-src/pop.c b/lib-src/pop.c
index a269144c915..ea89ad47ea0 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -124,7 +124,7 @@ static char *find_crlf (char *, int);
124#endif 124#endif
125 125
126char pop_error[ERROR_MAX]; 126char pop_error[ERROR_MAX];
127int pop_debug = 0; 127bool pop_debug = false;
128 128
129/* 129/*
130 * Function: pop_open (char *host, char *username, char *password, 130 * Function: pop_open (char *host, char *username, char *password,
@@ -269,8 +269,8 @@ pop_open (char *host, char *username, char *password, int flags)
269 server->data = 0; 269 server->data = 0;
270 server->buffer_index = 0; 270 server->buffer_index = 0;
271 server->buffer_size = GETLINE_MIN; 271 server->buffer_size = GETLINE_MIN;
272 server->in_multi = 0; 272 server->in_multi = false;
273 server->trash_started = 0; 273 server->trash_started = false;
274 274
275 if (getok (server)) 275 if (getok (server))
276 return (0); 276 return (0);
@@ -686,7 +686,7 @@ pop_multi_first (popserver server, const char *command, char **response)
686 else if (0 == strncmp (*response, "+OK", 3)) 686 else if (0 == strncmp (*response, "+OK", 3))
687 { 687 {
688 for (*response += 3; **response == ' '; (*response)++) /* empty */; 688 for (*response += 3; **response == ' '; (*response)++) /* empty */;
689 server->in_multi = 1; 689 server->in_multi = true;
690 return (0); 690 return (0);
691 } 691 }
692 else 692 else
@@ -728,7 +728,7 @@ pop_multi_next (popserver server, char **line)
728 if (! fromserver[1]) 728 if (! fromserver[1])
729 { 729 {
730 *line = 0; 730 *line = 0;
731 server->in_multi = 0; 731 server->in_multi = false;
732 return (0); 732 return (0);
733 } 733 }
734 else 734 else
@@ -1546,7 +1546,7 @@ pop_trash (popserver server)
1546 /* avoid recursion; sendline can call pop_trash */ 1546 /* avoid recursion; sendline can call pop_trash */
1547 if (server->trash_started) 1547 if (server->trash_started)
1548 return; 1548 return;
1549 server->trash_started = 1; 1549 server->trash_started = true;
1550 1550
1551 sendline (server, "RSET"); 1551 sendline (server, "RSET");
1552 sendline (server, "QUIT"); 1552 sendline (server, "QUIT");
diff --git a/lib-src/pop.h b/lib-src/pop.h
index dbc7c8dbe64..ac5f315bdeb 100644
--- a/lib-src/pop.h
+++ b/lib-src/pop.h
@@ -27,15 +27,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27 /* size when it needs to grow */ 27 /* size when it needs to grow */
28 28
29extern char pop_error[]; 29extern char pop_error[];
30extern int pop_debug; 30extern bool pop_debug;
31 31
32struct _popserver 32struct _popserver
33{ 33{
34 int file, data; 34 int file, data;
35 char *buffer; 35 char *buffer;
36 int buffer_size, buffer_index; 36 int buffer_size, buffer_index;
37 int in_multi; 37 bool_bf in_multi : 1;
38 int trash_started; 38 bool_bf trash_started : 1;
39}; 39};
40 40
41typedef struct _popserver *popserver; 41typedef struct _popserver *popserver;
@@ -73,4 +73,3 @@ extern int pop_last (popserver server);
73extern int pop_reset (popserver server); 73extern int pop_reset (popserver server);
74extern int pop_quit (popserver server); 74extern int pop_quit (popserver server);
75extern void pop_close (popserver); 75extern void pop_close (popserver);
76
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 27bf65db84b..d68ed24b887 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,8 @@
12013-12-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use bool for boolean, focusing on headers.
4 * xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
5
12013-11-14 Paul Eggert <eggert@cs.ucla.edu> 62013-11-14 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * lwlib.c (safe_strdup): Prefer tail calls. 8 * lwlib.c (safe_strdup): Prefer tail calls.
diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h
index 9bbbd89dc41..5acfbb44acf 100644
--- a/lwlib/xlwmenuP.h
+++ b/lwlib/xlwmenuP.h
@@ -83,8 +83,8 @@ typedef struct _XlwMenu_part
83 int horizontal; 83 int horizontal;
84 84
85 /* True means top_shadow_color and/or bottom_shadow_color must be freed. */ 85 /* True means top_shadow_color and/or bottom_shadow_color must be freed. */
86 unsigned free_top_shadow_color_p : 1; 86 bool_bf free_top_shadow_color_p : 1;
87 unsigned free_bottom_shadow_color_p : 1; 87 bool_bf free_bottom_shadow_color_p : 1;
88 88
89 /* State of the XlwMenu */ 89 /* State of the XlwMenu */
90 int top_depth; 90 int top_depth;
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