gdb/tui: Don't cast between window types.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 6 Jul 2015 15:56:42 +0000 (16:56 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 6 Jul 2015 18:13:02 +0000 (19:13 +0100)
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.

gdb/ChangeLog
gdb/tui/tui-win.c

index 5b626edb7fb54996bebf93924c01626a9084853c..dd39d1b5cec2f26ce8d20c896ff3ad93e93ae883 100644 (file)
@@ -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.
index feb360b02189307962df0e993436dff824d3da24..629d54d8a45b1c0bab21af64a4df5348a4eca762 100644 (file)
@@ -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);