From: Tom Tromey Date: Sun, 16 Jun 2019 16:23:10 +0000 (-0600) Subject: Remove an unnecessary NULL check from the TUI X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec328aa512ee09ab326d59b417836bb950083230;p=binutils-gdb.git Remove an unnecessary NULL check from the TUI In init_and_make_win, opaque_win_info can't be NULL after a new window is allocated. This patch removes an unnecessary NULL check. gdb/ChangeLog 2019-06-25 Tom Tromey * tui/tui-layout.c (init_and_make_win): Remove NULL check. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d01d1184d92..45415df087c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-06-25 Tom Tromey + + * tui/tui-layout.c (init_and_make_win): Remove NULL check. + 2019-06-25 Tom Tromey * tui/tui-data.h (struct tui_win_info): Make constructor diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index bcae819e518..695c56012c1 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -842,18 +842,16 @@ init_and_make_win (void *opaque_win_info, else generic = &((struct tui_win_info *) opaque_win_info)->generic; - if (opaque_win_info != NULL) + init_gen_win_info (generic, win_type, height, width, origin_x, origin_y); + if (!tui_win_is_auxillary (win_type)) { - init_gen_win_info (generic, win_type, height, width, origin_x, origin_y); - if (!tui_win_is_auxillary (win_type)) - { - if (generic->type == CMD_WIN) - ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE; - else - ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE; - } - tui_make_window (generic, box_it); + if (generic->type == CMD_WIN) + ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE; + else + ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE; } + tui_make_window (generic, box_it); + return opaque_win_info; }