patch 9.2.0378: Using int as bool type in win_T struct

Problem:  Several win_T fields are declared as "int" or "char" but are
          used strictly as boolean flags with TRUE/FALSE values.  The
          integer types obscure the boolean intent and are wider than
          needed.
Solution: Change the following win_T members to bool (stdbool.h) and
          update their assignments from TRUE/FALSE to true/false
          accordingly.

The following conversions have been done:
- int -> bool (10 members):
  w_set_curswant, w_botfill, w_old_botfill, w_do_win_fix_cursor,
  w_popup_fixed, w_border_highlight_isset, w_cline_folded,
  w_redr_status, w_arg_idx_invalid, w_has_scrollbar
- char -> bool (4 members):
  w_topline_was_set, w_ru_empty, w_fold_manual, w_foldinvalid

No existing code compares these members against TRUE/FALSE explicitly or
uses ++/-- / bitwise ops on them, so only plain assignments are
affected.

Excluded:
- w_locked (recursion counter with ++/--),
- w_want_scrollbar (may hold -1 from dict_get_bool),
- w_winbar_height (used in arithmetic and exposed as number via
  getwininfo()).

related: #20005
closes:  #20008

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2026-04-20 17:12:29 +00:00
committed by Christian Brabandt
parent 3c3050e648
commit 146d5da0d1
37 changed files with 157 additions and 155 deletions
+2 -2
View File
@@ -2747,11 +2747,11 @@ diff_set_topline(win_T *fromwin, win_T *towin)
}
// safety check (if diff info gets outdated strange things may happen)
towin->w_botfill = FALSE;
towin->w_botfill = false;
if (towin->w_topline > towin->w_buffer->b_ml.ml_line_count)
{
towin->w_topline = towin->w_buffer->b_ml.ml_line_count;
towin->w_botfill = TRUE;
towin->w_botfill = true;
}
if (towin->w_topline < 1)
{