diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-16 14:14:10 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-06-25 07:48:32 -0600 |
commit | 6a0ee02c22b78b6d49fda99b6f2f9154d0cb0a47 (patch) | |
tree | d8274a31daa2b0395ac13a5337eea4e57a7cfe6e | |
parent | 63901aeccf923abaca02c8a58b1141d3859d7247 (diff) | |
download | binutils-6a0ee02c22b78b6d49fda99b6f2f9154d0cb0a47.zip binutils-6a0ee02c22b78b6d49fda99b6f2f9154d0cb0a47.tar.gz binutils-6a0ee02c22b78b6d49fda99b6f2f9154d0cb0a47.tar.bz2 |
Remove an unneeded NULL check
show_source_or_disasm_and_command will either create or reset the
source window, so the final NULL check is not necessary. This patch
removes it.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_or_disasm_and_command): Remove
NULL check.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/tui/tui-layout.c | 44 |
2 files changed, 26 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b529085..0e2c74e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-layout.c (show_source_or_disasm_and_command): Remove + NULL check. + +2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-data.h (struct tui_data_window, struct tui_cmd_window): Inline constructor. Add initializers for members. * tui/tui-data.c (tui_data_window, tui_cmd_window): Remove diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 72ec924..de78c6c 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -945,30 +945,28 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type) tui_make_visible (&(*win_info_ptr)->generic); tui_make_visible (base->execution_info); } - if ((*win_info_ptr) != NULL) - { - base->m_has_locator = true; - tui_make_visible (locator); - tui_show_locator_content (); - tui_show_source_content (*win_info_ptr); - if (TUI_CMD_WIN == NULL) - { - tui_win_list[CMD_WIN] = make_command_window (cmd_height, - src_height); - tui_refresh_win (&TUI_CMD_WIN->generic); - } - else - { - init_gen_win_info (&TUI_CMD_WIN->generic, - TUI_CMD_WIN->generic.type, - TUI_CMD_WIN->generic.height, - TUI_CMD_WIN->generic.width, - TUI_CMD_WIN->generic.origin.x, - TUI_CMD_WIN->generic.origin.y); - TUI_CMD_WIN->can_highlight = FALSE; - tui_make_visible (&TUI_CMD_WIN->generic); - } + base->m_has_locator = true; + tui_make_visible (locator); + tui_show_locator_content (); + tui_show_source_content (*win_info_ptr); + + if (TUI_CMD_WIN == NULL) + { + tui_win_list[CMD_WIN] = make_command_window (cmd_height, + src_height); + tui_refresh_win (&TUI_CMD_WIN->generic); + } + else + { + init_gen_win_info (&TUI_CMD_WIN->generic, + TUI_CMD_WIN->generic.type, + TUI_CMD_WIN->generic.height, + TUI_CMD_WIN->generic.width, + TUI_CMD_WIN->generic.origin.x, + TUI_CMD_WIN->generic.origin.y); + TUI_CMD_WIN->can_highlight = FALSE; + tui_make_visible (&TUI_CMD_WIN->generic); } tui_set_current_layout_to (layout_type); } |