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-stack.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-stack.c')
-rw-r--r-- | gdb/tui/tui-stack.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 13dd0b2..2870d70 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -253,7 +253,7 @@ tui_show_locator_content (void) { struct tui_win_element *element; - element = (struct tui_win_element *) locator->content[0]; + element = locator->content[0]; string = tui_make_status_line (&element->which_element.locator); wmove (locator->handle, 0, 0); @@ -287,8 +287,7 @@ tui_set_locator_fullname (const char *fullname) return; } - element = &((struct tui_win_element *) - locator->content[0])->which_element.locator; + element = &locator->content[0]->which_element.locator; element->full_name[0] = 0; strcat_to_buf (element->full_name, MAX_LOCATOR_ELEMENT_LEN, fullname); } @@ -307,12 +306,11 @@ tui_set_locator_info (struct gdbarch *gdbarch, /* Allocate the locator content if necessary. */ if (locator->content_size <= 0) { - locator->content = (void **) tui_alloc_content (1, locator->type); + locator->content = tui_alloc_content (1, locator->type); locator->content_size = 1; } - element = &((struct tui_win_element *) - locator->content[0])->which_element.locator; + element = &locator->content[0]->which_element.locator; element->proc_name[0] = (char) 0; strcat_to_buf (element->proc_name, MAX_LOCATOR_ELEMENT_LEN, procname); element->line_no = lineno; @@ -369,8 +367,7 @@ tui_show_frame_info (struct frame_info *fi) win_info = (tui_source_windows ())->list[i]; - item = &((struct tui_win_element *) - locator->content[0])->which_element; + item = &locator->content[0]->which_element; if (win_info == TUI_SRC_WIN) { start_line = (item->locator.line_no - |