aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-disasm.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-disasm.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-disasm.c')
-rw-r--r--gdb/tui/tui-disasm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 821a4f1..f86c216 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -192,8 +192,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
TUI_DISASM_WIN->detail.source_info.gdbarch = gdbarch;
TUI_DISASM_WIN->detail.source_info.start_line_or_addr.loa = LOA_ADDRESS;
TUI_DISASM_WIN->detail.source_info.start_line_or_addr.u.addr = pc;
- cur_pc = (CORE_ADDR) (((struct tui_win_element *)
- locator->content[0])->which_element.locator.addr);
+ cur_pc = locator->content[0]->which_element.locator.addr;
max_lines = TUI_DISASM_WIN->generic.height - 2; /* Account for
hilite. */
@@ -232,7 +231,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
struct tui_source_element *src;
int cur_len;
- element = (struct tui_win_element *) TUI_DISASM_WIN->generic.content[i];
+ element = TUI_DISASM_WIN->generic.content[i];
src = &element->which_element.source;
strcpy (line, asm_lines[i].addr_string);
cur_len = strlen (line);
@@ -334,8 +333,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
CORE_ADDR addr;
locator = tui_locator_win_info_ptr ();
- element = &((struct tui_win_element *)
- locator->content[0])->which_element.locator;
+ element = &locator->content[0]->which_element.locator;
if (element->addr == 0)
{