Remove more unnecessary casts of NULL
I found a few more spots that unnecessarily cast NULL to a pointer type. My earlier search included a "*" in the cast, but these use a typedef to a pointer type instead. This patch removes these casts. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * tui/tui-data.c (tui_clear_win_detail, init_win_info) (tui_free_window, free_content, free_content_elements): Remove unnecessary cast. * tui/tui-windata.c (tui_display_all_data): Remove unnecessary cast. * tui/tui-regs.c (tui_show_register_group) (tui_display_registers_from, tui_display_reg_element_at_line): Remove unnecessary cast.
This commit is contained in:
parent
bf5142e7fe
commit
d04b44a16c
@ -1,3 +1,14 @@
|
||||
2019-06-16 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* tui/tui-data.c (tui_clear_win_detail, init_win_info)
|
||||
(tui_free_window, free_content, free_content_elements): Remove
|
||||
unnecessary cast.
|
||||
* tui/tui-windata.c (tui_display_all_data): Remove unnecessary
|
||||
cast.
|
||||
* tui/tui-regs.c (tui_show_register_group)
|
||||
(tui_display_registers_from, tui_display_reg_element_at_line):
|
||||
Remove unnecessary cast.
|
||||
|
||||
2019-06-16 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
||||
* linux-nat.c (normal_mask): Delete.
|
||||
|
@ -198,11 +198,9 @@ tui_clear_win_detail (struct tui_win_info *win_info)
|
||||
wmove (win_info->generic.handle, 0, 0);
|
||||
break;
|
||||
case DATA_WIN:
|
||||
win_info->detail.data_display_info.data_content =
|
||||
(tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.data_content = NULL;
|
||||
win_info->detail.data_display_info.data_content_count = 0;
|
||||
win_info->detail.data_display_info.regs_content =
|
||||
(tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.regs_content = NULL;
|
||||
win_info->detail.data_display_info.regs_content_count = 0;
|
||||
win_info->detail.data_display_info.regs_column_count = 1;
|
||||
win_info->detail.data_display_info.display_regs = FALSE;
|
||||
@ -516,9 +514,9 @@ init_win_info (struct tui_win_info *win_info)
|
||||
win_info->detail.source_info.fullname = NULL;
|
||||
break;
|
||||
case DATA_WIN:
|
||||
win_info->detail.data_display_info.data_content = (tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.data_content = NULL;
|
||||
win_info->detail.data_display_info.data_content_count = 0;
|
||||
win_info->detail.data_display_info.regs_content = (tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.regs_content = NULL;
|
||||
win_info->detail.data_display_info.regs_content_count = 0;
|
||||
win_info->detail.data_display_info.regs_column_count = 1;
|
||||
win_info->detail.data_display_info.display_regs = FALSE;
|
||||
@ -686,13 +684,11 @@ tui_free_window (struct tui_win_info *win_info)
|
||||
{
|
||||
tui_free_data_content (win_info->detail.data_display_info.regs_content,
|
||||
win_info->detail.data_display_info.regs_content_count);
|
||||
win_info->detail.data_display_info.regs_content =
|
||||
(tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.regs_content = NULL;
|
||||
win_info->detail.data_display_info.regs_content_count = 0;
|
||||
tui_free_data_content (win_info->detail.data_display_info.data_content,
|
||||
win_info->detail.data_display_info.data_content_count);
|
||||
win_info->detail.data_display_info.data_content =
|
||||
(tui_win_content) NULL;
|
||||
win_info->detail.data_display_info.data_content = NULL;
|
||||
win_info->detail.data_display_info.data_content_count = 0;
|
||||
win_info->detail.data_display_info.regs_column_count = 1;
|
||||
win_info->detail.data_display_info.display_regs = FALSE;
|
||||
@ -808,7 +804,7 @@ free_content (tui_win_content content,
|
||||
int content_size,
|
||||
enum tui_win_type win_type)
|
||||
{
|
||||
if (content != (tui_win_content) NULL)
|
||||
if (content != NULL)
|
||||
{
|
||||
free_content_elements (content, content_size, win_type);
|
||||
xfree (content);
|
||||
@ -823,7 +819,7 @@ free_content_elements (tui_win_content content,
|
||||
int content_size,
|
||||
enum tui_win_type type)
|
||||
{
|
||||
if (content != (tui_win_content) NULL)
|
||||
if (content != NULL)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -237,7 +237,7 @@ tui_show_register_group (struct reggroup *group,
|
||||
refresh_values_only = FALSE;
|
||||
}
|
||||
|
||||
if (display_info->regs_content != (tui_win_content) NULL)
|
||||
if (display_info->regs_content != NULL)
|
||||
{
|
||||
if (!refresh_values_only || allocated_here)
|
||||
{
|
||||
@ -299,7 +299,7 @@ tui_display_registers_from (int start_element_no)
|
||||
{
|
||||
struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
|
||||
|
||||
if (display_info->regs_content != (tui_win_content) NULL
|
||||
if (display_info->regs_content != NULL
|
||||
&& display_info->regs_content_count > 0)
|
||||
{
|
||||
int i = start_element_no;
|
||||
@ -398,8 +398,7 @@ static void
|
||||
tui_display_reg_element_at_line (int start_element_no,
|
||||
int start_line_no)
|
||||
{
|
||||
if (TUI_DATA_WIN->detail.data_display_info.regs_content
|
||||
!= (tui_win_content) NULL
|
||||
if (TUI_DATA_WIN->detail.data_display_info.regs_content != NULL
|
||||
&& TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
|
||||
{
|
||||
int element_no = start_element_no;
|
||||
|
@ -55,7 +55,7 @@ tui_first_data_item_displayed (void)
|
||||
|
||||
data_item_win
|
||||
= &TUI_DATA_WIN->generic.content[i]->which_element.data_window;
|
||||
if (data_item_win->handle != NULL
|
||||
if (data_item_win->handle != NULL
|
||||
&& data_item_win->is_visible)
|
||||
element_no = i;
|
||||
}
|
||||
@ -138,8 +138,7 @@ tui_display_all_data (void)
|
||||
tui_display_registers_from (0);
|
||||
|
||||
/* Then display the other data. */
|
||||
if (TUI_DATA_WIN->detail.data_display_info.data_content !=
|
||||
(tui_win_content) NULL
|
||||
if (TUI_DATA_WIN->detail.data_display_info.data_content != NULL
|
||||
&& TUI_DATA_WIN->detail.data_display_info.data_content_count > 0)
|
||||
{
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user