aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-08-27 17:33:56 -0700
committerPaul Eggert2012-08-27 17:33:56 -0700
commit59ea14cde3090fe0bef42d646682b3801859be14 (patch)
treefc45ed91028b2720c2e1e8ebda4ee6e5c4684d51
parent95072a9468d22a66a22481722bc2f46ce30863d2 (diff)
downloademacs-59ea14cde3090fe0bef42d646682b3801859be14.tar.gz
emacs-59ea14cde3090fe0bef42d646682b3801859be14.zip
* dispnew.c: Use bool for boolean.
(frame_garbaged, display_completed, delayed_size_change) (fonts_changed_p, add_window_display_history) (add_frame_display_history, verify_row_hash) (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p) (row_equal_p, realloc_glyph_pool) (allocate_matrices_for_frame_redisplay) (showing_window_margins_p) (adjust_frame_glyphs_for_frame_redisplay) (build_frame_matrix_from_leaf_window, make_current) (mirrored_line_dance, mirror_line_dance, update_frame) (update_window_tree, update_single_window) (check_current_matrix_flags, update_window, update_text_area) (update_window_line, set_window_update_flags, scrolling_window) (update_frame_1, scrolling, buffer_posn_from_coords) (do_pending_window_change, change_frame_size) (change_frame_size_1, sit_for): Use bool for boolean. (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows, and remove last int (actually boolean) argument, which was always 0. All callers changed. * dispextern.h, frame.h, lisp.h: Reflect above API changes. * dispextern.h (struct composition_it): Use bool for boolean. (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'. (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf. * dired.c (file_name_completion): Use bool for boolean. (This was missed in an earlier change.)
-rw-r--r--src/ChangeLog30
-rw-r--r--src/dired.c8
-rw-r--r--src/dispextern.h30
-rw-r--r--src/dispnew.c271
-rw-r--r--src/frame.h2
-rw-r--r--src/lisp.h2
-rw-r--r--src/xdisp.c12
7 files changed, 189 insertions, 166 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2861a2f0f89..531d20ffca0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,33 @@
12012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2
3 * dispnew.c: Use bool for boolean.
4 (frame_garbaged, display_completed, delayed_size_change)
5 (fonts_changed_p, add_window_display_history)
6 (add_frame_display_history, verify_row_hash)
7 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8 (row_equal_p, realloc_glyph_pool)
9 (allocate_matrices_for_frame_redisplay)
10 (showing_window_margins_p)
11 (adjust_frame_glyphs_for_frame_redisplay)
12 (build_frame_matrix_from_leaf_window, make_current)
13 (mirrored_line_dance, mirror_line_dance, update_frame)
14 (update_window_tree, update_single_window)
15 (check_current_matrix_flags, update_window, update_text_area)
16 (update_window_line, set_window_update_flags, scrolling_window)
17 (update_frame_1, scrolling, buffer_posn_from_coords)
18 (do_pending_window_change, change_frame_size)
19 (change_frame_size_1, sit_for):
20 Use bool for boolean.
21 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
22 and remove last int (actually boolean) argument, which was always 0.
23 All callers changed.
24 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
25 * dispextern.h (struct composition_it): Use bool for boolean.
26 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
27 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
28 * dired.c (file_name_completion):
29 Use bool for boolean. (This was missed in an earlier change.)
30
12012-08-27 Martin Rudalics <rudalics@gmx.at> 312012-08-27 Martin Rudalics <rudalics@gmx.at>
2 32
3 * window.c (Fset_window_configuration): Revert first part of 33 * window.c (Fset_window_configuration): Revert first part of
diff --git a/src/dired.c b/src/dired.c
index 206f370ed63..fa293258107 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -460,7 +460,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
460 Lisp_Object encoded_file; 460 Lisp_Object encoded_file;
461 Lisp_Object encoded_dir; 461 Lisp_Object encoded_dir;
462 struct stat st; 462 struct stat st;
463 int directoryp; 463 bool directoryp;
464 /* If not INCLUDEALL, exclude files in completion-ignored-extensions as 464 /* If not INCLUDEALL, exclude files in completion-ignored-extensions as
465 well as "." and "..". Until shown otherwise, assume we can't exclude 465 well as "." and "..". Until shown otherwise, assume we can't exclude
466 anything. */ 466 anything. */
@@ -530,7 +530,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
530 if (file_name_completion_stat (encoded_dir, dp, &st) < 0) 530 if (file_name_completion_stat (encoded_dir, dp, &st) < 0)
531 continue; 531 continue;
532 532
533 directoryp = S_ISDIR (st.st_mode); 533 directoryp = S_ISDIR (st.st_mode) != 0;
534 tem = Qnil; 534 tem = Qnil;
535 /* If all_flag is set, always include all. 535 /* If all_flag is set, always include all.
536 It would not actually be helpful to the user to ignore any possible 536 It would not actually be helpful to the user to ignore any possible
@@ -718,7 +718,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
718 /* This tests that the current file is an exact match 718 /* This tests that the current file is an exact match
719 but BESTMATCH is not (it is too long). */ 719 but BESTMATCH is not (it is too long). */
720 if ((matchsize == SCHARS (name) 720 if ((matchsize == SCHARS (name)
721 && matchsize + !!directoryp < SCHARS (bestmatch)) 721 && matchsize + directoryp < SCHARS (bestmatch))
722 || 722 ||
723 /* If there is no exact match ignoring case, 723 /* If there is no exact match ignoring case,
724 prefer a match that does not change the case 724 prefer a match that does not change the case
@@ -730,7 +730,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
730 either both or neither are exact. */ 730 either both or neither are exact. */
731 (((matchsize == SCHARS (name)) 731 (((matchsize == SCHARS (name))
732 == 732 ==
733 (matchsize + !!directoryp == SCHARS (bestmatch))) 733 (matchsize + directoryp == SCHARS (bestmatch)))
734 && (cmp = Fcompare_strings (name, zero, 734 && (cmp = Fcompare_strings (name, zero,
735 make_number (SCHARS (file)), 735 make_number (SCHARS (file)),
736 file, zero, 736 file, zero,
diff --git a/src/dispextern.h b/src/dispextern.h
index 6fe5e249836..1140d98f8a7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -671,7 +671,7 @@ struct glyph_matrix
671 671
672 /* Values of BEGV and ZV as of last redisplay. Set in 672 /* Values of BEGV and ZV as of last redisplay. Set in
673 mark_window_display_accurate_1. */ 673 mark_window_display_accurate_1. */
674 int begv, zv; 674 ptrdiff_t begv, zv;
675}; 675};
676 676
677 677
@@ -1126,11 +1126,11 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int);
1126 ((ROW)->phys_height - (ROW)->phys_ascent \ 1126 ((ROW)->phys_height - (ROW)->phys_ascent \
1127 > (ROW)->height - (ROW)->ascent) 1127 > (ROW)->height - (ROW)->ascent)
1128 1128
1129/* Non-zero means that fonts have been loaded since the last glyph 1129/* True means that fonts have been loaded since the last glyph
1130 matrix adjustments. The function redisplay_internal adjusts glyph 1130 matrix adjustments. The function redisplay_internal adjusts glyph
1131 matrices when this flag is non-zero. */ 1131 matrices when this flag is true. */
1132 1132
1133extern int fonts_changed_p; 1133extern bool fonts_changed_p;
1134 1134
1135/* A glyph for a space. */ 1135/* A glyph for a space. */
1136 1136
@@ -1149,7 +1149,7 @@ extern int updated_area;
1149/* Non-zero means last display completed. Zero means it was 1149/* Non-zero means last display completed. Zero means it was
1150 preempted. */ 1150 preempted. */
1151 1151
1152extern int display_completed; 1152extern bool display_completed;
1153 1153
1154 1154
1155 1155
@@ -1415,7 +1415,7 @@ struct glyph_string
1415 && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \ 1415 && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \
1416 && WINDOW_TOTAL_LINES (W) > 1) 1416 && WINDOW_TOTAL_LINES (W) > 1)
1417 1417
1418/* Value is non-zero if window W wants a header line. */ 1418/* Value is true if window W wants a header line. */
1419 1419
1420#define WINDOW_WANTS_HEADER_LINE_P(W) \ 1420#define WINDOW_WANTS_HEADER_LINE_P(W) \
1421 (!MINI_WINDOW_P ((W)) \ 1421 (!MINI_WINDOW_P ((W)) \
@@ -1856,7 +1856,6 @@ struct bidi_it {
1856 int resolved_level; /* final resolved level of this character */ 1856 int resolved_level; /* final resolved level of this character */
1857 int invalid_levels; /* how many PDFs to ignore */ 1857 int invalid_levels; /* how many PDFs to ignore */
1858 int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */ 1858 int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */
1859 int prev_was_pdf; /* if non-zero, previous char was PDF */
1860 struct bidi_saved_info prev; /* info about previous character */ 1859 struct bidi_saved_info prev; /* info about previous character */
1861 struct bidi_saved_info last_strong; /* last-seen strong directional char */ 1860 struct bidi_saved_info last_strong; /* last-seen strong directional char */
1862 struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ 1861 struct bidi_saved_info next_for_neutral; /* surrounding characters for... */
@@ -1879,6 +1878,7 @@ struct bidi_it {
1879 struct bidi_string_data string; /* string to reorder */ 1878 struct bidi_string_data string; /* string to reorder */
1880 bidi_dir_t paragraph_dir; /* current paragraph direction */ 1879 bidi_dir_t paragraph_dir; /* current paragraph direction */
1881 ptrdiff_t separator_limit; /* where paragraph separator should end */ 1880 ptrdiff_t separator_limit; /* where paragraph separator should end */
1881 unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */
1882 unsigned first_elt : 1; /* if non-zero, examine current char first */ 1882 unsigned first_elt : 1; /* if non-zero, examine current char first */
1883 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ 1883 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */
1884 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ 1884 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */
@@ -2085,10 +2085,10 @@ struct composition_it
2085 ptrdiff_t lookback; 2085 ptrdiff_t lookback;
2086 /* If non-negative, number of glyphs of the glyph-string. */ 2086 /* If non-negative, number of glyphs of the glyph-string. */
2087 int nglyphs; 2087 int nglyphs;
2088 /* Nonzero iff the composition is created while buffer is scanned in 2088 /* True iff the composition is created while buffer is scanned in
2089 reverse order, and thus the grapheme clusters must be rendered 2089 reverse order, and thus the grapheme clusters must be rendered
2090 from the last to the first. */ 2090 from the last to the first. */
2091 int reversed_p; 2091 bool reversed_p;
2092 2092
2093 /** The following members contain information about the current 2093 /** The following members contain information about the current
2094 grapheme cluster. */ 2094 grapheme cluster. */
@@ -3304,7 +3304,7 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part,
3304extern void redraw_frame (struct frame *); 3304extern void redraw_frame (struct frame *);
3305extern void cancel_line (int, struct frame *); 3305extern void cancel_line (int, struct frame *);
3306extern void init_desired_glyphs (struct frame *); 3306extern void init_desired_glyphs (struct frame *);
3307extern int update_frame (struct frame *, int, int); 3307extern bool update_frame (struct frame *, bool, bool);
3308extern void bitch_at_user (void); 3308extern void bitch_at_user (void);
3309void adjust_glyphs (struct frame *); 3309void adjust_glyphs (struct frame *);
3310void free_glyphs (struct frame *); 3310void free_glyphs (struct frame *);
@@ -3320,13 +3320,13 @@ void rotate_matrix (struct glyph_matrix *, int, int, int);
3320void increment_matrix_positions (struct glyph_matrix *, 3320void increment_matrix_positions (struct glyph_matrix *,
3321 int, int, ptrdiff_t, ptrdiff_t); 3321 int, int, ptrdiff_t, ptrdiff_t);
3322void blank_row (struct window *, struct glyph_row *, int); 3322void blank_row (struct window *, struct glyph_row *, int);
3323void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int); 3323void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
3324void clear_glyph_row (struct glyph_row *); 3324void clear_glyph_row (struct glyph_row *);
3325void prepare_desired_row (struct glyph_row *); 3325void prepare_desired_row (struct glyph_row *);
3326void set_window_update_flags (struct window *, int); 3326void set_window_update_flags (struct window *, bool);
3327void update_single_window (struct window *, int); 3327void update_single_window (struct window *, bool);
3328void do_pending_window_change (int); 3328void do_pending_window_change (bool);
3329void change_frame_size (struct frame *, int, int, int, int, int); 3329void change_frame_size (struct frame *, int, int, bool, bool, bool);
3330void init_display (void); 3330void init_display (void);
3331void syms_of_display (void); 3331void syms_of_display (void);
3332extern Lisp_Object Qredisplay_dont_pause; 3332extern Lisp_Object Qredisplay_dont_pause;
diff --git a/src/dispnew.c b/src/dispnew.c
index ce7c4ebcb4c..f37b872274a 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -88,7 +88,7 @@ static void update_frame_line (struct frame *, int);
88static int required_matrix_height (struct window *); 88static int required_matrix_height (struct window *);
89static int required_matrix_width (struct window *); 89static int required_matrix_width (struct window *);
90static void adjust_frame_glyphs (struct frame *); 90static void adjust_frame_glyphs (struct frame *);
91static void change_frame_size_1 (struct frame *, int, int, int, int, int); 91static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
92static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); 92static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
93static void fill_up_frame_row_with_spaces (struct glyph_row *, int); 93static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
94static void build_frame_matrix_from_window_tree (struct glyph_matrix *, 94static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
@@ -98,20 +98,20 @@ static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
98static void adjust_frame_message_buffer (struct frame *); 98static void adjust_frame_message_buffer (struct frame *);
99static void adjust_decode_mode_spec_buffer (struct frame *); 99static void adjust_decode_mode_spec_buffer (struct frame *);
100static void fill_up_glyph_row_with_spaces (struct glyph_row *); 100static void fill_up_glyph_row_with_spaces (struct glyph_row *);
101static void clear_window_matrices (struct window *, int); 101static void clear_window_matrices (struct window *, bool);
102static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int); 102static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int);
103static int scrolling_window (struct window *, int); 103static int scrolling_window (struct window *, bool);
104static int update_window_line (struct window *, int, int *); 104static bool update_window_line (struct window *, int, bool *);
105static void mirror_make_current (struct window *, int); 105static void mirror_make_current (struct window *, int);
106#ifdef GLYPH_DEBUG 106#ifdef GLYPH_DEBUG
107static void check_matrix_pointers (struct glyph_matrix *, 107static void check_matrix_pointers (struct glyph_matrix *,
108 struct glyph_matrix *); 108 struct glyph_matrix *);
109#endif 109#endif
110static void mirror_line_dance (struct window *, int, int, int *, char *); 110static void mirror_line_dance (struct window *, int, int, int *, char *);
111static int update_window_tree (struct window *, int); 111static bool update_window_tree (struct window *, bool);
112static int update_window (struct window *, int); 112static bool update_window (struct window *, bool);
113static int update_frame_1 (struct frame *, int, int); 113static bool update_frame_1 (struct frame *, bool, bool);
114static int scrolling (struct frame *); 114static bool scrolling (struct frame *);
115static void set_window_cursor_after_update (struct window *); 115static void set_window_cursor_after_update (struct window *);
116static void adjust_frame_glyphs_for_window_redisplay (struct frame *); 116static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
117static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); 117static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
@@ -122,14 +122,14 @@ static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
122static EMACS_TIME preemption_period; 122static EMACS_TIME preemption_period;
123static EMACS_TIME preemption_next_check; 123static EMACS_TIME preemption_next_check;
124 124
125/* Nonzero upon entry to redisplay means do not assume anything about 125/* True upon entry to redisplay means do not assume anything about
126 current contents of actual terminal frame; clear and redraw it. */ 126 current contents of actual terminal frame; clear and redraw it. */
127 127
128int frame_garbaged; 128bool frame_garbaged;
129 129
130/* Nonzero means last display completed. Zero means it was preempted. */ 130/* True means last display completed. False means it was preempted. */
131 131
132int display_completed; 132bool display_completed;
133 133
134Lisp_Object Qdisplay_table, Qredisplay_dont_pause; 134Lisp_Object Qdisplay_table, Qredisplay_dont_pause;
135 135
@@ -146,13 +146,13 @@ Lisp_Object selected_frame;
146 146
147struct frame *last_nonminibuf_frame; 147struct frame *last_nonminibuf_frame;
148 148
149/* 1 means SIGWINCH happened when not safe. */ 149/* True means SIGWINCH happened when not safe. */
150 150
151static int delayed_size_change; 151static bool delayed_size_change;
152 152
153/* 1 means glyph initialization has been completed at startup. */ 153/* 1 means glyph initialization has been completed at startup. */
154 154
155static int glyphs_initialized_initially_p; 155static bool glyphs_initialized_initially_p;
156 156
157/* Updated window if != 0. Set by update_window. */ 157/* Updated window if != 0. Set by update_window. */
158 158
@@ -178,15 +178,15 @@ static int glyph_pool_count;
178 178
179static struct frame *frame_matrix_frame; 179static struct frame *frame_matrix_frame;
180 180
181/* Non-zero means that fonts have been loaded since the last glyph 181/* True means that fonts have been loaded since the last glyph
182 matrix adjustments. Redisplay must stop, and glyph matrices must 182 matrix adjustments. Redisplay must stop, and glyph matrices must
183 be adjusted when this flag becomes non-zero during display. The 183 be adjusted when this flag becomes true during display. The
184 reason fonts can be loaded so late is that fonts of fontsets are 184 reason fonts can be loaded so late is that fonts of fontsets are
185 loaded on demand. Another reason is that a line contains many 185 loaded on demand. Another reason is that a line contains many
186 characters displayed by zero width or very narrow glyphs of 186 characters displayed by zero width or very narrow glyphs of
187 variable-width fonts. */ 187 variable-width fonts. */
188 188
189int fonts_changed_p; 189bool fonts_changed_p;
190 190
191/* Convert vpos and hpos from frame to window and vice versa. 191/* Convert vpos and hpos from frame to window and vice versa.
192 This may only be used for terminal frames. */ 192 This may only be used for terminal frames. */
@@ -222,16 +222,14 @@ static int history_idx;
222 history. */ 222 history. */
223 223
224static uprintmax_t history_tick; 224static uprintmax_t history_tick;
225
226static void add_frame_display_history (struct frame *, int);
227 225
228/* Add to the redisplay history how window W has been displayed. 226/* Add to the redisplay history how window W has been displayed.
229 MSG is a trace containing the information how W's glyph matrix 227 MSG is a trace containing the information how W's glyph matrix
230 has been constructed. PAUSED_P non-zero means that the update 228 has been constructed. PAUSED_P means that the update
231 has been interrupted for pending input. */ 229 has been interrupted for pending input. */
232 230
233static void 231static void
234add_window_display_history (struct window *w, const char *msg, int paused_p) 232add_window_display_history (struct window *w, const char *msg, bool paused_p)
235{ 233{
236 char *buf; 234 char *buf;
237 235
@@ -254,11 +252,11 @@ add_window_display_history (struct window *w, const char *msg, int paused_p)
254 252
255 253
256/* Add to the redisplay history that frame F has been displayed. 254/* Add to the redisplay history that frame F has been displayed.
257 PAUSED_P non-zero means that the update has been interrupted for 255 PAUSED_P means that the update has been interrupted for
258 pending input. */ 256 pending input. */
259 257
260static void 258static void
261add_frame_display_history (struct frame *f, int paused_p) 259add_frame_display_history (struct frame *f, bool paused_p)
262{ 260{
263 char *buf; 261 char *buf;
264 262
@@ -395,10 +393,10 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
395 return n; 393 return n;
396} 394}
397 395
398/* Return non-zero if ROW's hash value is correct, zero if not. 396/* Return true if ROW's hash value is correct.
399 Optimized away if ENABLE_CHECKING is not defined. */ 397 Optimized away if ENABLE_CHECKING is not defined. */
400 398
401static int 399static bool
402verify_row_hash (struct glyph_row *row) 400verify_row_hash (struct glyph_row *row)
403{ 401{
404 return row->hash == row_hash (row); 402 return row->hash == row_hash (row);
@@ -431,9 +429,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
431{ 429{
432 int i; 430 int i;
433 int new_rows; 431 int new_rows;
434 int marginal_areas_changed_p = 0; 432 bool marginal_areas_changed_p = 0;
435 int header_line_changed_p = 0; 433 bool header_line_changed_p = 0;
436 int header_line_p = 0; 434 bool header_line_p = 0;
437 int left = -1, right = -1; 435 int left = -1, right = -1;
438 int window_width = -1, window_height = -1; 436 int window_width = -1, window_height = -1;
439 437
@@ -736,30 +734,28 @@ increment_matrix_positions (struct glyph_matrix *matrix, int start, int end,
736} 734}
737 735
738 736
739/* Enable a range of rows in glyph matrix MATRIX. START and END are 737/* Clear the enable_p flags in a range of rows in glyph matrix MATRIX.
740 the row indices of the first and last + 1 row to enable. If 738 START and END are the row indices of the first and last + 1 row to clear. */
741 ENABLED_P is non-zero, enabled_p flags in rows will be set to 1. */
742 739
743void 740void
744enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p) 741clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
745{ 742{
746 eassert (start <= end); 743 eassert (start <= end);
747 eassert (start >= 0 && start < matrix->nrows); 744 eassert (start >= 0 && start < matrix->nrows);
748 eassert (end >= 0 && end <= matrix->nrows); 745 eassert (end >= 0 && end <= matrix->nrows);
749 746
750 for (; start < end; ++start) 747 for (; start < end; ++start)
751 matrix->rows[start].enabled_p = enabled_p != 0; 748 matrix->rows[start].enabled_p = 0;
752} 749}
753 750
754 751
755/* Clear MATRIX. 752/* Clear MATRIX.
756 753
757 This empties all rows in MATRIX by setting the enabled_p flag for 754 Empty all rows in MATRIX by clearing their enabled_p flags.
758 all rows of the matrix to zero. The function prepare_desired_row 755 The function prepare_desired_row will eventually really clear a row
759 will eventually really clear a row when it sees one with a zero 756 when it sees one with a false enabled_p flag.
760 enabled_p flag.
761 757
762 Resets update hints to defaults value. The only update hint 758 Reset update hints to default values. The only update hint
763 currently present is the flag MATRIX->no_scrolling_p. */ 759 currently present is the flag MATRIX->no_scrolling_p. */
764 760
765void 761void
@@ -767,7 +763,7 @@ clear_glyph_matrix (struct glyph_matrix *matrix)
767{ 763{
768 if (matrix) 764 if (matrix)
769 { 765 {
770 enable_glyph_matrix_rows (matrix, 0, matrix->nrows, 0); 766 clear_glyph_matrix_rows (matrix, 0, matrix->nrows);
771 matrix->no_scrolling_p = 0; 767 matrix->no_scrolling_p = 0;
772 } 768 }
773} 769}
@@ -853,11 +849,11 @@ clear_desired_matrices (register struct frame *f)
853} 849}
854 850
855 851
856/* Clear matrices in window tree rooted in W. If DESIRED_P is 852/* Clear matrices in window tree rooted in W. If DESIRED_P,
857 non-zero clear desired matrices, otherwise clear current matrices. */ 853 clear desired matrices, otherwise clear current matrices. */
858 854
859static void 855static void
860clear_window_matrices (struct window *w, int desired_p) 856clear_window_matrices (struct window *w, bool desired_p)
861{ 857{
862 while (w) 858 while (w)
863 { 859 {
@@ -1109,12 +1105,12 @@ assign_row (struct glyph_row *to, struct glyph_row *from)
1109/* Test whether the glyph memory of the glyph row WINDOW_ROW, which is 1105/* Test whether the glyph memory of the glyph row WINDOW_ROW, which is
1110 a row in a window matrix, is a slice of the glyph memory of the 1106 a row in a window matrix, is a slice of the glyph memory of the
1111 glyph row FRAME_ROW which is a row in a frame glyph matrix. Value 1107 glyph row FRAME_ROW which is a row in a frame glyph matrix. Value
1112 is non-zero if the glyph memory of WINDOW_ROW is part of the glyph 1108 is true if the glyph memory of WINDOW_ROW is part of the glyph
1113 memory of FRAME_ROW. */ 1109 memory of FRAME_ROW. */
1114 1110
1115#ifdef GLYPH_DEBUG 1111#ifdef GLYPH_DEBUG
1116 1112
1117static int 1113static bool
1118glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) 1114glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row)
1119{ 1115{
1120 struct glyph *window_glyph_start = window_row->glyphs[0]; 1116 struct glyph *window_glyph_start = window_row->glyphs[0];
@@ -1161,7 +1157,7 @@ prepare_desired_row (struct glyph_row *row)
1161{ 1157{
1162 if (!row->enabled_p) 1158 if (!row->enabled_p)
1163 { 1159 {
1164 int rp = row->reversed_p; 1160 bool rp = row->reversed_p;
1165 1161
1166 clear_glyph_row (row); 1162 clear_glyph_row (row);
1167 row->enabled_p = 1; 1163 row->enabled_p = 1;
@@ -1260,12 +1256,11 @@ line_draw_cost (struct glyph_matrix *matrix, int vpos)
1260} 1256}
1261 1257
1262 1258
1263/* Test two glyph rows A and B for equality. Value is non-zero if A 1259/* Return true if the glyph rows A and B have equal contents.
1264 and B have equal contents. MOUSE_FACE_P non-zero means compare the 1260 MOUSE_FACE_P means compare the mouse_face_p flags of A and B, too. */
1265 mouse_face_p flags of A and B, too. */
1266 1261
1267static inline int 1262static inline bool
1268row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p) 1263row_equal_p (struct glyph_row *a, struct glyph_row *b, bool mouse_face_p)
1269{ 1264{
1270 eassert (verify_row_hash (a)); 1265 eassert (verify_row_hash (a));
1271 eassert (verify_row_hash (b)); 1266 eassert (verify_row_hash (b));
@@ -1380,14 +1375,14 @@ free_glyph_pool (struct glyph_pool *pool)
1380 is changed from a large value to a smaller one. But, if someone 1375 is changed from a large value to a smaller one. But, if someone
1381 does it once, we can expect that he will do it again. 1376 does it once, we can expect that he will do it again.
1382 1377
1383 Value is non-zero if the pool changed in a way which makes 1378 Return true if the pool changed in a way which makes
1384 re-adjusting window glyph matrices necessary. */ 1379 re-adjusting window glyph matrices necessary. */
1385 1380
1386static int 1381static bool
1387realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) 1382realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim)
1388{ 1383{
1389 ptrdiff_t needed; 1384 ptrdiff_t needed;
1390 int changed_p; 1385 bool changed_p;
1391 1386
1392 changed_p = (pool->glyphs == 0 1387 changed_p = (pool->glyphs == 0
1393 || matrix_dim.height != pool->nrows 1388 || matrix_dim.height != pool->nrows
@@ -1561,7 +1556,7 @@ check_matrix_invariants (struct window *w)
1561 1556
1562 X and Y are column/row within the frame glyph matrix where 1557 X and Y are column/row within the frame glyph matrix where
1563 sub-matrices for the window tree rooted at WINDOW must be 1558 sub-matrices for the window tree rooted at WINDOW must be
1564 allocated. DIM_ONLY_P non-zero means that the caller of this 1559 allocated. DIM_ONLY_P means that the caller of this
1565 function is only interested in the result matrix dimension, and 1560 function is only interested in the result matrix dimension, and
1566 matrix adjustments should not be performed. 1561 matrix adjustments should not be performed.
1567 1562
@@ -1638,7 +1633,7 @@ check_matrix_invariants (struct window *w)
1638 1633
1639static struct dim 1634static struct dim
1640allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, 1635allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1641 int dim_only_p, int *window_change_flags) 1636 bool dim_only_p, int *window_change_flags)
1642{ 1637{
1643 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); 1638 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
1644 int x0 = x, y0 = y; 1639 int x0 = x, y0 = y;
@@ -1646,7 +1641,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1646 struct dim total; 1641 struct dim total;
1647 struct dim dim; 1642 struct dim dim;
1648 struct window *w; 1643 struct window *w;
1649 int in_horz_combination_p; 1644 bool in_horz_combination_p;
1650 1645
1651 /* What combination is WINDOW part of? Compute this once since the 1646 /* What combination is WINDOW part of? Compute this once since the
1652 result is the same for all windows in the `next' chain. The 1647 result is the same for all windows in the `next' chain. The
@@ -1704,7 +1699,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1704 /* Actually change matrices, if allowed. Do not consider 1699 /* Actually change matrices, if allowed. Do not consider
1705 CHANGED_LEAF_MATRIX computed above here because the pool 1700 CHANGED_LEAF_MATRIX computed above here because the pool
1706 may have been changed which we don't now here. We trust 1701 may have been changed which we don't now here. We trust
1707 that we only will be called with DIM_ONLY_P != 0 when 1702 that we only will be called with DIM_ONLY_P when
1708 necessary. */ 1703 necessary. */
1709 if (!dim_only_p) 1704 if (!dim_only_p)
1710 { 1705 {
@@ -1919,9 +1914,9 @@ adjust_frame_glyphs (struct frame *f)
1919 f->glyphs_initialized_p = 1; 1914 f->glyphs_initialized_p = 1;
1920} 1915}
1921 1916
1922/* Return 1 if any window in the tree has nonzero window margins. See 1917/* Return true if any window in the tree has nonzero window margins. See
1923 the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */ 1918 the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */
1924static int 1919static bool
1925showing_window_margins_p (struct window *w) 1920showing_window_margins_p (struct window *w)
1926{ 1921{
1927 while (w) 1922 while (w)
@@ -2052,7 +2047,7 @@ static void
2052adjust_frame_glyphs_for_frame_redisplay (struct frame *f) 2047adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
2053{ 2048{
2054 struct dim matrix_dim; 2049 struct dim matrix_dim;
2055 int pool_changed_p; 2050 bool pool_changed_p;
2056 int window_change_flags; 2051 int window_change_flags;
2057 int top_window_y; 2052 int top_window_y;
2058 2053
@@ -2468,7 +2463,7 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window
2468 desired frame matrix built. W is a leaf window whose desired or 2463 desired frame matrix built. W is a leaf window whose desired or
2469 current matrix is to be added to FRAME_MATRIX. W's flag 2464 current matrix is to be added to FRAME_MATRIX. W's flag
2470 must_be_updated_p determines which matrix it contributes to 2465 must_be_updated_p determines which matrix it contributes to
2471 FRAME_MATRIX. If must_be_updated_p is non-zero, W's desired matrix 2466 FRAME_MATRIX. If W->must_be_updated_p, W's desired matrix
2472 is added to FRAME_MATRIX, otherwise W's current matrix is added. 2467 is added to FRAME_MATRIX, otherwise W's current matrix is added.
2473 Adding a desired matrix means setting up used counters and such in 2468 Adding a desired matrix means setting up used counters and such in
2474 frame rows, while adding a current window matrix to FRAME_MATRIX 2469 frame rows, while adding a current window matrix to FRAME_MATRIX
@@ -2519,7 +2514,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w
2519 { 2514 {
2520 struct glyph_row *frame_row = frame_matrix->rows + frame_y; 2515 struct glyph_row *frame_row = frame_matrix->rows + frame_y;
2521 struct glyph_row *window_row = window_matrix->rows + window_y; 2516 struct glyph_row *window_row = window_matrix->rows + window_y;
2522 int current_row_p = window_matrix == w->current_matrix; 2517 bool current_row_p = window_matrix == w->current_matrix;
2523 2518
2524 /* Fill up the frame row with spaces up to the left margin of the 2519 /* Fill up the frame row with spaces up to the left margin of the
2525 window row. */ 2520 window row. */
@@ -2692,7 +2687,7 @@ make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_
2692{ 2687{
2693 struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); 2688 struct glyph_row *current_row = MATRIX_ROW (current_matrix, row);
2694 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); 2689 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row);
2695 int mouse_face_p = current_row->mouse_face_p; 2690 bool mouse_face_p = current_row->mouse_face_p;
2696 2691
2697 /* Do current_row = desired_row. This exchanges glyph pointers 2692 /* Do current_row = desired_row. This exchanges glyph pointers
2698 between both rows, and does a structure assignment otherwise. */ 2693 between both rows, and does a structure assignment otherwise. */
@@ -2789,7 +2784,7 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
2789 /* Assign new rows, maybe clear lines. */ 2784 /* Assign new rows, maybe clear lines. */
2790 for (i = 0; i < nlines; ++i) 2785 for (i = 0; i < nlines; ++i)
2791 { 2786 {
2792 int enabled_before_p = new_rows[i].enabled_p; 2787 bool enabled_before_p = new_rows[i].enabled_p;
2793 2788
2794 eassert (i + unchanged_at_top < matrix->nrows); 2789 eassert (i + unchanged_at_top < matrix->nrows);
2795 eassert (unchanged_at_top + copy_from[i] < matrix->nrows); 2790 eassert (unchanged_at_top + copy_from[i] < matrix->nrows);
@@ -2897,7 +2892,8 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2897 /* W is a leaf window, and we are working on its current 2892 /* W is a leaf window, and we are working on its current
2898 matrix m. */ 2893 matrix m. */
2899 struct glyph_matrix *m = w->current_matrix; 2894 struct glyph_matrix *m = w->current_matrix;
2900 int i, sync_p = 0; 2895 int i;
2896 bool sync_p = 0;
2901 struct glyph_row *old_rows; 2897 struct glyph_row *old_rows;
2902 2898
2903 /* Make a copy of the original rows of matrix m. */ 2899 /* Make a copy of the original rows of matrix m. */
@@ -2919,22 +2915,19 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2919 int window_from = frame_from - m->matrix_y; 2915 int window_from = frame_from - m->matrix_y;
2920 2916
2921 /* Is assigned line inside window? */ 2917 /* Is assigned line inside window? */
2922 int from_inside_window_p 2918 bool from_inside_window_p
2923 = window_from >= 0 && window_from < m->matrix_h; 2919 = window_from >= 0 && window_from < m->matrix_h;
2924 2920
2925 /* Is assigned to line inside window? */ 2921 /* Is assigned to line inside window? */
2926 int to_inside_window_p 2922 bool to_inside_window_p
2927 = window_to >= 0 && window_to < m->matrix_h; 2923 = window_to >= 0 && window_to < m->matrix_h;
2928 2924
2929 if (from_inside_window_p && to_inside_window_p) 2925 if (from_inside_window_p && to_inside_window_p)
2930 { 2926 {
2931 /* Enabled setting before assignment. */
2932 int enabled_before_p;
2933
2934 /* Do the assignment. The enabled_p flag is saved 2927 /* Do the assignment. The enabled_p flag is saved
2935 over the assignment because the old redisplay did 2928 over the assignment because the old redisplay did
2936 that. */ 2929 that. */
2937 enabled_before_p = m->rows[window_to].enabled_p; 2930 bool enabled_before_p = m->rows[window_to].enabled_p;
2938 m->rows[window_to] = old_rows[window_from]; 2931 m->rows[window_to] = old_rows[window_from];
2939 m->rows[window_to].enabled_p = enabled_before_p; 2932 m->rows[window_to].enabled_p = enabled_before_p;
2940 2933
@@ -3155,17 +3148,16 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
3155 3148
3156/* Update frame F based on the data in desired matrices. 3149/* Update frame F based on the data in desired matrices.
3157 3150
3158 If FORCE_P is non-zero, don't let redisplay be stopped by detecting 3151 If FORCE_P, don't let redisplay be stopped by detecting pending input.
3159 pending input. If INHIBIT_HAIRY_ID_P is non-zero, don't try 3152 If INHIBIT_HAIRY_ID_P, don't try scrolling.
3160 scrolling.
3161 3153
3162 Value is non-zero if redisplay was stopped due to pending input. */ 3154 Value is true if redisplay was stopped due to pending input. */
3163 3155
3164int 3156bool
3165update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) 3157update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3166{ 3158{
3167 /* 1 means display has been paused because of pending input. */ 3159 /* True means display has been paused because of pending input. */
3168 int paused_p; 3160 bool paused_p;
3169 struct window *root_window = XWINDOW (f->root_window); 3161 struct window *root_window = XWINDOW (f->root_window);
3170 3162
3171 if (redisplay_dont_pause) 3163 if (redisplay_dont_pause)
@@ -3283,13 +3275,13 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p)
3283 Window-based updates 3275 Window-based updates
3284 ************************************************************************/ 3276 ************************************************************************/
3285 3277
3286/* Perform updates in window tree rooted at W. FORCE_P non-zero means 3278/* Perform updates in window tree rooted at W.
3287 don't stop updating when input is pending. */ 3279 If FORCE_P, don't stop updating if input is pending. */
3288 3280
3289static int 3281static bool
3290update_window_tree (struct window *w, int force_p) 3282update_window_tree (struct window *w, bool force_p)
3291{ 3283{
3292 int paused_p = 0; 3284 bool paused_p = 0;
3293 3285
3294 while (w && !paused_p) 3286 while (w && !paused_p)
3295 { 3287 {
@@ -3307,11 +3299,11 @@ update_window_tree (struct window *w, int force_p)
3307} 3299}
3308 3300
3309 3301
3310/* Update window W if its flag must_be_updated_p is non-zero. If 3302/* Update window W if its flag must_be_updated_p is set.
3311 FORCE_P is non-zero, don't stop updating if input is pending. */ 3303 If FORCE_P, don't stop updating if input is pending. */
3312 3304
3313void 3305void
3314update_single_window (struct window *w, int force_p) 3306update_single_window (struct window *w, bool force_p)
3315{ 3307{
3316 if (w->must_be_updated_p) 3308 if (w->must_be_updated_p)
3317 { 3309 {
@@ -3460,7 +3452,7 @@ redraw_overlapping_rows (struct window *w, int yb)
3460static void 3452static void
3461check_current_matrix_flags (struct window *w) 3453check_current_matrix_flags (struct window *w)
3462{ 3454{
3463 int last_seen_p = 0; 3455 bool last_seen_p = 0;
3464 int i, yb = window_text_bottom_y (w); 3456 int i, yb = window_text_bottom_y (w);
3465 3457
3466 for (i = 0; i < w->current_matrix->nrows - 1; ++i) 3458 for (i = 0; i < w->current_matrix->nrows - 1; ++i)
@@ -3476,14 +3468,14 @@ check_current_matrix_flags (struct window *w)
3476#endif /* GLYPH_DEBUG */ 3468#endif /* GLYPH_DEBUG */
3477 3469
3478 3470
3479/* Update display of window W. FORCE_P non-zero means that we should 3471/* Update display of window W.
3480 not stop when detecting pending input. */ 3472 If FORCE_P, don't stop updating when input is pending. */
3481 3473
3482static int 3474static bool
3483update_window (struct window *w, int force_p) 3475update_window (struct window *w, bool force_p)
3484{ 3476{
3485 struct glyph_matrix *desired_matrix = w->desired_matrix; 3477 struct glyph_matrix *desired_matrix = w->desired_matrix;
3486 int paused_p; 3478 bool paused_p;
3487#if !PERIODIC_PREEMPTION_CHECKING 3479#if !PERIODIC_PREEMPTION_CHECKING
3488 int preempt_count = baud_rate / 2400 + 1; 3480 int preempt_count = baud_rate / 2400 + 1;
3489#endif 3481#endif
@@ -3506,7 +3498,8 @@ update_window (struct window *w, int force_p)
3506 struct glyph_row *row, *end; 3498 struct glyph_row *row, *end;
3507 struct glyph_row *mode_line_row; 3499 struct glyph_row *mode_line_row;
3508 struct glyph_row *header_line_row; 3500 struct glyph_row *header_line_row;
3509 int yb, changed_p = 0, mouse_face_overwritten_p = 0; 3501 int yb;
3502 bool changed_p = 0, mouse_face_overwritten_p = 0;
3510#if ! PERIODIC_PREEMPTION_CHECKING 3503#if ! PERIODIC_PREEMPTION_CHECKING
3511 int n_updated = 0; 3504 int n_updated = 0;
3512#endif 3505#endif
@@ -3693,15 +3686,15 @@ update_marginal_area (struct window *w, int area, int vpos)
3693 3686
3694 3687
3695/* Update the display of the text area of row VPOS in window W. 3688/* Update the display of the text area of row VPOS in window W.
3696 Value is non-zero if display has changed. */ 3689 Value is true if display has changed. */
3697 3690
3698static int 3691static bool
3699update_text_area (struct window *w, int vpos) 3692update_text_area (struct window *w, int vpos)
3700{ 3693{
3701 struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); 3694 struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
3702 struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); 3695 struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
3703 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); 3696 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
3704 int changed_p = 0; 3697 bool changed_p = 0;
3705 3698
3706 /* Let functions in xterm.c know what area subsequent X positions 3699 /* Let functions in xterm.c know what area subsequent X positions
3707 will be relative to. */ 3700 will be relative to. */
@@ -3751,9 +3744,9 @@ update_text_area (struct window *w, int vpos)
3751 int stop, i, x; 3744 int stop, i, x;
3752 struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; 3745 struct glyph *current_glyph = current_row->glyphs[TEXT_AREA];
3753 struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; 3746 struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA];
3754 int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; 3747 bool overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p;
3755 int desired_stop_pos = desired_row->used[TEXT_AREA]; 3748 int desired_stop_pos = desired_row->used[TEXT_AREA];
3756 int abort_skipping = 0; 3749 bool abort_skipping = 0;
3757 3750
3758 /* If the desired row extends its face to the text area end, and 3751 /* If the desired row extends its face to the text area end, and
3759 unless the current row also does so at the same position, 3752 unless the current row also does so at the same position,
@@ -3773,7 +3766,7 @@ update_text_area (struct window *w, int vpos)
3773 in common. */ 3766 in common. */
3774 while (i < stop) 3767 while (i < stop)
3775 { 3768 {
3776 int can_skip_p = !abort_skipping; 3769 bool can_skip_p = !abort_skipping;
3777 3770
3778 /* Skip over glyphs that both rows have in common. These 3771 /* Skip over glyphs that both rows have in common. These
3779 don't have to be written. We can't skip if the last 3772 don't have to be written. We can't skip if the last
@@ -3847,7 +3840,7 @@ update_text_area (struct window *w, int vpos)
3847 int start_x = x, start_hpos = i; 3840 int start_x = x, start_hpos = i;
3848 struct glyph *start = desired_glyph; 3841 struct glyph *start = desired_glyph;
3849 int current_x = x; 3842 int current_x = x;
3850 int skip_first_p = !can_skip_p; 3843 bool skip_first_p = !can_skip_p;
3851 3844
3852 /* Find the next glyph that's equal again. */ 3845 /* Find the next glyph that's equal again. */
3853 while (i < stop 3846 while (i < stop
@@ -3938,16 +3931,15 @@ update_text_area (struct window *w, int vpos)
3938} 3931}
3939 3932
3940 3933
3941/* Update row VPOS in window W. Value is non-zero if display has been 3934/* Update row VPOS in window W. Value is true if display has been changed. */
3942 changed. */
3943 3935
3944static int 3936static bool
3945update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p) 3937update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p)
3946{ 3938{
3947 struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); 3939 struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
3948 struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); 3940 struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
3949 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); 3941 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
3950 int changed_p = 0; 3942 bool changed_p = 0;
3951 3943
3952 /* Set the row being updated. This is important to let xterm.c 3944 /* Set the row being updated. This is important to let xterm.c
3953 know what line height values are in effect. */ 3945 know what line height values are in effect. */
@@ -4095,7 +4087,7 @@ set_window_cursor_after_update (struct window *w)
4095 tree rooted at W. */ 4087 tree rooted at W. */
4096 4088
4097void 4089void
4098set_window_update_flags (struct window *w, int on_p) 4090set_window_update_flags (struct window *w, bool on_p)
4099{ 4091{
4100 while (w) 4092 while (w)
4101 { 4093 {
@@ -4198,7 +4190,7 @@ add_row_entry (struct glyph_row *row)
4198 4190
4199 4191
4200/* Try to reuse part of the current display of W by scrolling lines. 4192/* Try to reuse part of the current display of W by scrolling lines.
4201 HEADER_LINE_P non-zero means W has a header line. 4193 HEADER_LINE_P means W has a header line.
4202 4194
4203 The algorithm is taken from Communications of the ACM, Apr78 "A 4195 The algorithm is taken from Communications of the ACM, Apr78 "A
4204 Technique for Isolating Differences Between Files." It should take 4196 Technique for Isolating Differences Between Files." It should take
@@ -4224,7 +4216,7 @@ add_row_entry (struct glyph_row *row)
4224 1 if we did scroll. */ 4216 1 if we did scroll. */
4225 4217
4226static int 4218static int
4227scrolling_window (struct window *w, int header_line_p) 4219scrolling_window (struct window *w, bool header_line_p)
4228{ 4220{
4229 struct glyph_matrix *desired_matrix = w->desired_matrix; 4221 struct glyph_matrix *desired_matrix = w->desired_matrix;
4230 struct glyph_matrix *current_matrix = w->current_matrix; 4222 struct glyph_matrix *current_matrix = w->current_matrix;
@@ -4237,7 +4229,7 @@ scrolling_window (struct window *w, int header_line_p)
4237 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); 4229 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
4238 4230
4239 /* Skip over rows equal at the start. */ 4231 /* Skip over rows equal at the start. */
4240 for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i) 4232 for (i = header_line_p; i < current_matrix->nrows - 1; ++i)
4241 { 4233 {
4242 struct glyph_row *d = MATRIX_ROW (desired_matrix, i); 4234 struct glyph_row *d = MATRIX_ROW (desired_matrix, i);
4243 struct glyph_row *c = MATRIX_ROW (current_matrix, i); 4235 struct glyph_row *c = MATRIX_ROW (current_matrix, i);
@@ -4496,7 +4488,7 @@ scrolling_window (struct window *w, int header_line_p)
4496 for (j = nruns - 1; j > i; --j) 4488 for (j = nruns - 1; j > i; --j)
4497 { 4489 {
4498 struct run *p = runs[j]; 4490 struct run *p = runs[j];
4499 int truncated_p = 0; 4491 bool truncated_p = 0;
4500 4492
4501 if (p->nrows > 0 4493 if (p->nrows > 0
4502 && p->desired_y < r->desired_y + r->height 4494 && p->desired_y < r->desired_y + r->height
@@ -4559,7 +4551,7 @@ scrolling_window (struct window *w, int header_line_p)
4559 for (j = 0; j < r->nrows; ++j) 4551 for (j = 0; j < r->nrows; ++j)
4560 { 4552 {
4561 struct glyph_row *from, *to; 4553 struct glyph_row *from, *to;
4562 int to_overlapped_p; 4554 bool to_overlapped_p;
4563 4555
4564 to = MATRIX_ROW (current_matrix, r->desired_vpos + j); 4556 to = MATRIX_ROW (current_matrix, r->desired_vpos + j);
4565 from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); 4557 from = MATRIX_ROW (desired_matrix, r->desired_vpos + j);
@@ -4594,20 +4586,19 @@ scrolling_window (struct window *w, int header_line_p)
4594 4586
4595/* Update the desired frame matrix of frame F. 4587/* Update the desired frame matrix of frame F.
4596 4588
4597 FORCE_P non-zero means that the update should not be stopped by 4589 FORCE_P means that the update should not be stopped by pending input.
4598 pending input. INHIBIT_HAIRY_ID_P non-zero means that scrolling 4590 INHIBIT_HAIRY_ID_P means that scrolling should not be tried.
4599 should not be tried.
4600 4591
4601 Value is non-zero if update was stopped due to pending input. */ 4592 Value is true if update was stopped due to pending input. */
4602 4593
4603static int 4594static bool
4604update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) 4595update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p)
4605{ 4596{
4606 /* Frame matrices to work on. */ 4597 /* Frame matrices to work on. */
4607 struct glyph_matrix *current_matrix = f->current_matrix; 4598 struct glyph_matrix *current_matrix = f->current_matrix;
4608 struct glyph_matrix *desired_matrix = f->desired_matrix; 4599 struct glyph_matrix *desired_matrix = f->desired_matrix;
4609 int i; 4600 int i;
4610 int pause_p; 4601 bool pause_p;
4611 int preempt_count = baud_rate / 2400 + 1; 4602 int preempt_count = baud_rate / 2400 + 1;
4612 4603
4613 eassert (current_matrix && desired_matrix); 4604 eassert (current_matrix && desired_matrix);
@@ -4699,7 +4690,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
4699 } 4690 }
4700 } 4691 }
4701 4692
4702 pause_p = (i < FRAME_LINES (f) - 1) ? i : 0; 4693 pause_p = 0 < i && i < FRAME_LINES (f) - 1;
4703 4694
4704 /* Now just clean up termcap drivers and set cursor, etc. */ 4695 /* Now just clean up termcap drivers and set cursor, etc. */
4705 if (!pause_p) 4696 if (!pause_p)
@@ -4809,7 +4800,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
4809 4800
4810/* Do line insertions/deletions on frame F for frame-based redisplay. */ 4801/* Do line insertions/deletions on frame F for frame-based redisplay. */
4811 4802
4812static int 4803static bool
4813scrolling (struct frame *frame) 4804scrolling (struct frame *frame)
4814{ 4805{
4815 int unchanged_at_top, unchanged_at_bottom; 4806 int unchanged_at_top, unchanged_at_bottom;
@@ -4952,10 +4943,10 @@ update_frame_line (struct frame *f, int vpos)
4952 struct glyph_matrix *desired_matrix = f->desired_matrix; 4943 struct glyph_matrix *desired_matrix = f->desired_matrix;
4953 struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); 4944 struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos);
4954 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); 4945 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos);
4955 int must_write_whole_line_p; 4946 bool must_write_whole_line_p;
4956 int write_spaces_p = FRAME_MUST_WRITE_SPACES (f); 4947 bool write_spaces_p = FRAME_MUST_WRITE_SPACES (f);
4957 int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background 4948 bool colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background
4958 != FACE_TTY_DEFAULT_BG_COLOR); 4949 != FACE_TTY_DEFAULT_BG_COLOR);
4959 4950
4960 if (colored_spaces_p) 4951 if (colored_spaces_p)
4961 write_spaces_p = 1; 4952 write_spaces_p = 1;
@@ -5289,7 +5280,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5289 /* start_display takes into account the header-line row, but IT's 5280 /* start_display takes into account the header-line row, but IT's
5290 vpos still counts from the glyph row that includes the window's 5281 vpos still counts from the glyph row that includes the window's
5291 start position. Adjust for a possible header-line row. */ 5282 start position. Adjust for a possible header-line row. */
5292 it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; 5283 it.vpos += WINDOW_WANTS_HEADER_LINE_P (w);
5293 5284
5294 x0 = *x; 5285 x0 = *x;
5295 5286
@@ -5613,12 +5604,12 @@ window_change_signal (int signalnum) /* If we don't have an argument, */
5613#endif /* SIGWINCH */ 5604#endif /* SIGWINCH */
5614 5605
5615 5606
5616/* Do any change in frame size that was requested by a signal. SAFE 5607/* Do any change in frame size that was requested by a signal.
5617 non-zero means this function is called from a place where it is 5608 SAFE means this function is called from a place where it is
5618 safe to change frame sizes while a redisplay is in progress. */ 5609 safe to change frame sizes while a redisplay is in progress. */
5619 5610
5620void 5611void
5621do_pending_window_change (int safe) 5612do_pending_window_change (bool safe)
5622{ 5613{
5623 /* If window_change_signal should have run before, run it now. */ 5614 /* If window_change_signal should have run before, run it now. */
5624 if (redisplaying_p && !safe) 5615 if (redisplaying_p && !safe)
@@ -5645,16 +5636,17 @@ do_pending_window_change (int safe)
5645/* Change the frame height and/or width. Values may be given as zero to 5636/* Change the frame height and/or width. Values may be given as zero to
5646 indicate no change is to take place. 5637 indicate no change is to take place.
5647 5638
5648 If DELAY is non-zero, then assume we're being called from a signal 5639 If DELAY, assume we're being called from a signal handler, and
5649 handler, and queue the change for later - perhaps the next 5640 queue the change for later - perhaps the next redisplay.
5650 redisplay. Since this tries to resize windows, we can't call it 5641 Since this tries to resize windows, we can't call it
5651 from a signal handler. 5642 from a signal handler.
5652 5643
5653 SAFE non-zero means this function is called from a place where it's 5644 SAFE means this function is called from a place where it's
5654 safe to change frame sizes while a redisplay is in progress. */ 5645 safe to change frame sizes while a redisplay is in progress. */
5655 5646
5656void 5647void
5657change_frame_size (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) 5648change_frame_size (struct frame *f, int newheight, int newwidth,
5649 bool pretend, bool delay, bool safe)
5658{ 5650{
5659 Lisp_Object tail, frame; 5651 Lisp_Object tail, frame;
5660 5652
@@ -5673,7 +5665,8 @@ change_frame_size (register struct frame *f, int newheight, int newwidth, int pr
5673} 5665}
5674 5666
5675static void 5667static void
5676change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe) 5668change_frame_size_1 (struct frame *f, int newheight, int newwidth,
5669 bool pretend, bool delay, bool safe)
5677{ 5670{
5678 int new_frame_total_cols; 5671 int new_frame_total_cols;
5679 ptrdiff_t count = SPECPDL_INDEX (); 5672 ptrdiff_t count = SPECPDL_INDEX ();
@@ -5929,13 +5922,13 @@ additional wait period, in milliseconds; this is for backwards compatibility.
5929 5922
5930 TIMEOUT is number of seconds to wait (float or integer), 5923 TIMEOUT is number of seconds to wait (float or integer),
5931 or t to wait forever. 5924 or t to wait forever.
5932 READING is 1 if reading input. 5925 READING is true if reading input.
5933 If DO_DISPLAY is >0 display process output while waiting. 5926 If DO_DISPLAY is >0 display process output while waiting.
5934 If DO_DISPLAY is >1 perform an initial redisplay before waiting. 5927 If DO_DISPLAY is >1 perform an initial redisplay before waiting.
5935*/ 5928*/
5936 5929
5937Lisp_Object 5930Lisp_Object
5938sit_for (Lisp_Object timeout, int reading, int do_display) 5931sit_for (Lisp_Object timeout, bool reading, int do_display)
5939{ 5932{
5940 intmax_t sec; 5933 intmax_t sec;
5941 int nsec; 5934 int nsec;
diff --git a/src/frame.h b/src/frame.h
index 58b957519c9..9421aa45414 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -34,7 +34,7 @@ INLINE_HEADER_BEGIN
34/* Miscellanea. */ 34/* Miscellanea. */
35 35
36/* Nonzero means there is at least one garbaged frame. */ 36/* Nonzero means there is at least one garbaged frame. */
37extern int frame_garbaged; 37extern bool frame_garbaged;
38 38
39 39
40/* The structure representing a frame. */ 40/* The structure representing a frame. */
diff --git a/src/lisp.h b/src/lisp.h
index 127177e44c7..49a2832d686 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2766,7 +2766,7 @@ _Noreturn void __executable_start (void);
2766#endif 2766#endif
2767extern Lisp_Object selected_frame; 2767extern Lisp_Object selected_frame;
2768extern Lisp_Object Vwindow_system; 2768extern Lisp_Object Vwindow_system;
2769extern Lisp_Object sit_for (Lisp_Object, int, int); 2769extern Lisp_Object sit_for (Lisp_Object, bool, int);
2770extern void init_display (void); 2770extern void init_display (void);
2771extern void syms_of_display (void); 2771extern void syms_of_display (void);
2772 2772
diff --git a/src/xdisp.c b/src/xdisp.c
index 18e537e9385..8289c003031 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -15380,7 +15380,7 @@ set_vertical_scroll_bar (struct window *w)
15380 selected_window is redisplayed. 15380 selected_window is redisplayed.
15381 15381
15382 We can return without actually redisplaying the window if 15382 We can return without actually redisplaying the window if
15383 fonts_changed_p is nonzero. In that case, redisplay_internal will 15383 fonts_changed_p. In that case, redisplay_internal will
15384 retry. */ 15384 retry. */
15385 15385
15386static void 15386static void
@@ -16224,7 +16224,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16224 } 16224 }
16225#endif /* HAVE_WINDOW_SYSTEM */ 16225#endif /* HAVE_WINDOW_SYSTEM */
16226 16226
16227 /* We go to this label, with fonts_changed_p nonzero, 16227 /* We go to this label, with fonts_changed_p set,
16228 if it is necessary to try again using larger glyph matrices. 16228 if it is necessary to try again using larger glyph matrices.
16229 We have to redeem the scroll bar even in this case, 16229 We have to redeem the scroll bar even in this case,
16230 because the loop in redisplay_internal expects that. */ 16230 because the loop in redisplay_internal expects that. */
@@ -17705,15 +17705,15 @@ try_window_id (struct window *w)
17705 { 17705 {
17706 rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos, 17706 rotate_matrix (current_matrix, first_unchanged_at_end_vpos + dvpos,
17707 bottom_vpos, dvpos); 17707 bottom_vpos, dvpos);
17708 enable_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos, 17708 clear_glyph_matrix_rows (current_matrix, bottom_vpos + dvpos,
17709 bottom_vpos, 0); 17709 bottom_vpos);
17710 } 17710 }
17711 else if (dvpos > 0) 17711 else if (dvpos > 0)
17712 { 17712 {
17713 rotate_matrix (current_matrix, first_unchanged_at_end_vpos, 17713 rotate_matrix (current_matrix, first_unchanged_at_end_vpos,
17714 bottom_vpos, dvpos); 17714 bottom_vpos, dvpos);
17715 enable_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos, 17715 clear_glyph_matrix_rows (current_matrix, first_unchanged_at_end_vpos,
17716 first_unchanged_at_end_vpos + dvpos, 0); 17716 first_unchanged_at_end_vpos + dvpos);
17717 } 17717 }
17718 17718
17719 /* For frame-based redisplay, make sure that current frame and window 17719 /* For frame-based redisplay, make sure that current frame and window