diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2015-04-24 08:26:50 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2015-04-27 21:19:53 -0400 |
commit | 63ed81829ea8819bc96b288f95230876b0060b14 (patch) | |
tree | 13e7bb1443d4efb3511a469efd9b0bcafdd1d4f5 /gdb/tui/tui-data.c | |
parent | d84f2dd3257a3062637059e4f8a85ee22d94865b (diff) | |
download | gdb-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-data.c')
-rw-r--r-- | gdb/tui/tui-data.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c index 43bcec2..44c1feb 100644 --- a/gdb/tui/tui-data.c +++ b/gdb/tui/tui-data.c @@ -490,11 +490,9 @@ init_content_element (struct tui_win_element *element, case DATA_WIN: tui_init_generic_part (&element->which_element.data_window); element->which_element.data_window.type = DATA_ITEM_WIN; - ((struct tui_gen_win_info *) - &element->which_element.data_window)->content = - (void **) tui_alloc_content (1, DATA_ITEM_WIN); - ((struct tui_gen_win_info *) - & element->which_element.data_window)->content_size = 1; + element->which_element.data_window.content = + tui_alloc_content (1, DATA_ITEM_WIN); + element->which_element.data_window.content_size = 1; break; case CMD_WIN: element->which_element.command.line = (char *) NULL; @@ -635,8 +633,7 @@ tui_add_content_elements (struct tui_gen_win_info *win_info, if (win_info->content == NULL) { - win_info->content = (void **) tui_alloc_content (num_elements, - win_info->type); + win_info->content = tui_alloc_content (num_elements, win_info->type); index_start = 0; } else |