This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb/tui: Don't cast between window types.
- From: Andrew Burgess <aburgess at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 6 Jul 2015 18:14:38 -0000
- Subject: [binutils-gdb] gdb/tui: Don't cast between window types.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=10e9aaa3b8554f997db993c8158493a96030d4d5
commit 10e9aaa3b8554f997db993c8158493a96030d4d5
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date: Mon Jul 6 16:56:42 2015 +0100
gdb/tui: Don't cast between window types.
Instead of casting between structure types to get the 'tui_gen_win_info'
info from a 'tui_win_info' access the generic member variable. This is
inline with what is done throughout the rest of the tui code.
gdb/ChangeLog:
* tui/tui-win.c (tui_set_focus): Use structure member 'generic'
instead of casting the structure type.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/tui/tui-win.c | 3 +--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5b626ed..dd39d1b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * tui/tui-win.c (tui_set_focus): Use structure member 'generic'
+ instead of casting the structure type.
+
2015-07-06 Simon Marchi <simon.marchi@ericsson.com>
* valops.c (search_struct_field): Remove OFFSET parameter.
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index feb360b..629d54d 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1059,8 +1059,7 @@ The window name specified must be valid and visible.\n"));
tui_refresh_data_win ();
xfree (buf_ptr);
printf_filtered (_("Focus set to %s window.\n"),
- tui_win_name ((struct tui_gen_win_info *)
- tui_win_with_focus ()));
+ tui_win_name (&tui_win_with_focus ()->generic));
}
else
warning (_("Incorrect Number of Arguments.\n%s"), FOCUS_USAGE);