aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-regs.c
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-04-24 08:26:50 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-04-27 21:19:53 -0400
commit63ed81829ea8819bc96b288f95230876b0060b14 (patch)
tree13e7bb1443d4efb3511a469efd9b0bcafdd1d4f5 /gdb/tui/tui-regs.c
parentd84f2dd3257a3062637059e4f8a85ee22d94865b (diff)
downloadgdb-63ed81829ea8819bc96b288f95230876b0060b14.zip
gdb-63ed81829ea8819bc96b288f95230876b0060b14.tar.gz
gdb-63ed81829ea8819bc96b288f95230876b0060b14.tar.bz2
Make type-safe the 'content' field of struct tui_gen_win_info
The 'content' field of struct tui_gen_win_info currently has type void ** but the field always stores an object of type tui_win_content. Instead of unnecessarily casting to and from void ** we should just give the field the type tui_win_content in the first place. This patch does this and also eliminates all now-redundant casts involving the 'content' struct field that I could find. gdb/ChangeLog: * tui/tui-data.h (struct tui_win_element): Forward-declare. (tui_win_content): Move declaration. (struct tui_gen_win_info): Give 'content' field the type tui_win_content. * tui/tui-data.c (init_content_element): Remove redundant and erroneous casts. (tui_add_content_elements): Remove erroneous cast. * tui/tui-disasm.c (tui_set_disassem_content): Remove redundant casts. (tui_get_begin_asm_address): Likewise. * tui/tui-regs.c (tui_show_registers): Likewise. (tui_show_register_group): Likewise. (tui_display_registers_from): Likewise. (tui_check_register_values): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. (tui_set_source_content_nil): Likewise. (tui_source_is_displayed): Likewise. * tui/tui-stack.c (tui_show_locator_content): Likewise. (tui_set_locator_fullname): Likewise. (tui_set_locator_info): Likewise. (tui_show_frame_info): Likewise. * tui/tui-winsource.c (tui_clear_source_content): Likewise. (tui_show_source_line): Likewise. (tui_horizontal_source_scroll): Likewise. (tui_update_breakpoint_info): Likewise. (tui_set_exec_info_content): Likewise. (tui_show_exec_info_content): Likewise. (tui_alloc_source_buffer): Likewise. (tui_line_is_displayed): Likewise. (tui_addr_is_displayed): Likewise.
Diffstat (limited to 'gdb/tui/tui-regs.c')
-rw-r--r--gdb/tui/tui-regs.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index feb11ba..61918f8 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -171,7 +171,7 @@ tui_show_registers (struct reggroup *group)
data_item_win = &display_info->regs_content[i]
->which_element.data_window;
- win = (struct tui_win_element *) data_item_win->content[0];
+ win = data_item_win->content[0];
win->which_element.data.highlight = FALSE;
}
display_info->current_group = group;
@@ -274,8 +274,7 @@ tui_show_register_group (struct reggroup *group,
data_item_win =
&display_info->regs_content[pos]->which_element.data_window;
- data = &((struct tui_win_element *)
- data_item_win->content[0])->which_element.data;
+ data = &data_item_win->content[0]->which_element.data;
if (data)
{
if (!refresh_values_only)
@@ -322,8 +321,7 @@ tui_display_registers_from (int start_element_no)
data_item_win
= &display_info->regs_content[i]->which_element.data_window;
- data = &((struct tui_win_element *)
- data_item_win->content[0])->which_element.data;
+ data = &data_item_win->content[0]->which_element.data;
len = 0;
p = data->content;
if (p != 0)
@@ -365,8 +363,7 @@ tui_display_registers_from (int start_element_no)
/* Create the window if necessary. */
data_item_win = &display_info->regs_content[i]
->which_element.data_window;
- data_element_ptr = &((struct tui_win_element *)
- data_item_win->content[0])->which_element.data;
+ data_element_ptr = &data_item_win->content[0]->which_element.data;
if (data_item_win->handle != (WINDOW*) NULL
&& (data_item_win->height != 1
|| data_item_win->width != item_win_width
@@ -508,8 +505,7 @@ tui_check_register_values (struct frame_info *frame)
data_item_win_ptr = &display_info->regs_content[i]->
which_element.data_window;
- data = &((struct tui_win_element *)
- data_item_win_ptr->content[0])->which_element.data;
+ data = &data_item_win_ptr->content[0]->which_element.data;
was_hilighted = data->highlight;
tui_get_register (frame, data,