aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 14:10:25 -0600
committerTom Tromey <tom@tromey.com>2019-06-16 14:10:25 -0600
commit431b3eadc4f842231d404e7e995ae5c1dbd28414 (patch)
tree316b95dfb23476a648ad6a645ef424be670aa690 /gdb
parentd04b44a16cdfde95de487bcedd541c6e71d82676 (diff)
downloadgdb-431b3eadc4f842231d404e7e995ae5c1dbd28414.zip
gdb-431b3eadc4f842231d404e7e995ae5c1dbd28414.tar.gz
gdb-431b3eadc4f842231d404e7e995ae5c1dbd28414.tar.bz2
Don't cast a tui_win_info directly to tui_gen_win_info
I found a few spots that directly cast a tui_win_info to a tui_gen_win_info. However, I think it's a bit better here to take the address of the "generic" member. As far as I know, nothing relies on being able to downcast here, so this gives us the freedom to rearrange the structure. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win) (make_all_visible): Use address of member.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tui/tui-wingeneral.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f16d847..cfc8e3d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-06-16 Tom Tromey <tom@tromey.com>
+ * tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win)
+ (make_all_visible): Use address of member.
+
+2019-06-16 Tom Tromey <tom@tromey.com>
+
* tui/tui-data.c (tui_clear_win_detail, init_win_info)
(tui_free_window, free_content, free_content_elements): Remove
unnecessary cast.
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index b474aa0..cacc0b8 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -112,7 +112,7 @@ tui_unhighlight_win (struct tui_win_info *win_info)
if (win_info != NULL
&& win_info->generic.handle != NULL)
{
- box_win ((struct tui_gen_win_info *) win_info, NO_HILITE);
+ box_win (&win_info->generic, NO_HILITE);
wrefresh (win_info->generic.handle);
tui_set_win_highlight (win_info, 0);
}
@@ -126,7 +126,7 @@ tui_highlight_win (struct tui_win_info *win_info)
&& win_info->can_highlight
&& win_info->generic.handle != NULL)
{
- box_win ((struct tui_gen_win_info *) win_info, HILITE);
+ box_win (&win_info->generic, HILITE);
wrefresh (win_info->generic.handle);
tui_set_win_highlight (win_info, 1);
}
@@ -227,7 +227,7 @@ make_all_visible (int visible)
if (tui_win_is_source_type ((tui_win_list[i])->generic.type))
make_visible ((tui_win_list[i])->detail.source_info.execution_info,
visible);
- make_visible ((struct tui_gen_win_info *) tui_win_list[i], visible);
+ make_visible (&tui_win_list[i]->generic, visible);
}
}