Remove NULL checks from box_win
box_win can't be called with a NULL window, or with an invisible window. So, the NULL checks in that function can be removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Assume win_info and win_info->handle cannot be NULL.
This commit is contained in:
parent
cdaa6eb439
commit
108e13abdf
2 changed files with 21 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2019-08-30 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-wingeneral.c (box_win): Assume win_info and
|
||||||
|
win_info->handle cannot be NULL.
|
||||||
|
|
||||||
2019-08-30 Tom Tromey <tom@tromey.com>
|
2019-08-30 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-regs.h (struct tui_data_item_window) <rerender,
|
* tui/tui-regs.h (struct tui_data_item_window) <rerender,
|
||||||
|
|
|
@ -58,30 +58,27 @@ static void
|
||||||
box_win (struct tui_win_info *win_info,
|
box_win (struct tui_win_info *win_info,
|
||||||
bool highlight_flag)
|
bool highlight_flag)
|
||||||
{
|
{
|
||||||
if (win_info && win_info->handle)
|
WINDOW *win;
|
||||||
{
|
int attrs;
|
||||||
WINDOW *win;
|
|
||||||
int attrs;
|
|
||||||
|
|
||||||
win = win_info->handle;
|
win = win_info->handle;
|
||||||
if (highlight_flag)
|
if (highlight_flag)
|
||||||
attrs = tui_active_border_attrs;
|
attrs = tui_active_border_attrs;
|
||||||
else
|
else
|
||||||
attrs = tui_border_attrs;
|
attrs = tui_border_attrs;
|
||||||
|
|
||||||
wattron (win, attrs);
|
wattron (win, attrs);
|
||||||
#ifdef HAVE_WBORDER
|
#ifdef HAVE_WBORDER
|
||||||
wborder (win, tui_border_vline, tui_border_vline,
|
wborder (win, tui_border_vline, tui_border_vline,
|
||||||
tui_border_hline, tui_border_hline,
|
tui_border_hline, tui_border_hline,
|
||||||
tui_border_ulcorner, tui_border_urcorner,
|
tui_border_ulcorner, tui_border_urcorner,
|
||||||
tui_border_llcorner, tui_border_lrcorner);
|
tui_border_llcorner, tui_border_lrcorner);
|
||||||
#else
|
#else
|
||||||
box (win, tui_border_vline, tui_border_hline);
|
box (win, tui_border_vline, tui_border_hline);
|
||||||
#endif
|
#endif
|
||||||
if (!win_info->title.empty ())
|
if (!win_info->title.empty ())
|
||||||
mvwaddstr (win, 0, 3, win_info->title.c_str ());
|
mvwaddstr (win, 0, 3, win_info->title.c_str ());
|
||||||
wattroff (win, attrs);
|
wattroff (win, attrs);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue