+2018-10-15 Tom Tromey <tom@tromey.com>
+
+ * tui/tui.c (strcat_to_buf): Remove casts.
+ * tui/tui-winsource.c (tui_show_source_line)
+ (tui_set_is_exec_point_at, tui_line_is_displayed): Remove casts.
+ * tui/tui-wingeneral.c (tui_refresh_win, box_win): Remove casts.
+ * tui/tui-windata.c (tui_first_data_item_displayed)
+ (tui_delete_data_content_windows, tui_erase_data_content)
+ (tui_display_all_data, tui_display_data_from)
+ (tui_refresh_data_win, tui_vertical_data_scroll): Remove casts.
+ * tui/tui-win.c (tui_set_win_height)
+ (make_invisible_and_set_new_height, parse_scrolling_args): Remove
+ casts.
+ * tui/tui-win.c (tui_resize_all): Remove casts.
+ (tui_scroll_backward_command, tui_set_focus)
+ (tui_set_tab_width_command): Likewise.
+ * tui/tui-source.c (tui_vertical_source_scroll): Remove cast.
+ * tui/tui-regs.c (tui_show_register_group): Remove cast.
+ * tui/tui-layout.c (tui_set_layout_by_name): Remove cast.
+ * tui/tui-disasm.c (tui_vertical_disassem_scroll): Remove cast.
+ * tui/tui-data.c (tui_partial_win_by_name, tui_free_win_content):
+ Remove casts.
+
2018-10-15 Simon Marchi <simon.marchi@ericsson.com>
* MAINTAINERS (Responsible Maintainers): Add Alan Hayward as
{
struct tui_win_info *win_info = NULL;
- if (name != (char *) NULL)
+ if (name != NULL)
{
int i = 0;
{
if (win_info->content != NULL)
{
- free_content ((tui_win_content) win_info->content,
+ free_content (win_info->content,
win_info->content_size,
win_info->type);
win_info->content = NULL;
struct tui_line_or_address val;
int dir;
- content = (tui_win_content) TUI_DISASM_WIN->generic.content;
+ content = TUI_DISASM_WIN->generic.content;
pc = content[0]->which_element.source.line_or_addr.u.addr;
num_to_scroll++;
{
enum tui_status status = TUI_SUCCESS;
- if (layout_name != (char *) NULL)
+ if (layout_name != NULL)
{
int i;
enum tui_layout_type new_layout = UNDEFINED_LAYOUT;
TUI_DATA_WIN->generic.content = NULL;
TUI_DATA_WIN->generic.content_size = 0;
tui_add_content_elements (&TUI_DATA_WIN->generic, nr_regs);
- display_info->regs_content
- = (tui_win_content) TUI_DATA_WIN->generic.content;
+ display_info->regs_content = TUI_DATA_WIN->generic.content;
display_info->regs_content_count = nr_regs;
}
{
struct tui_line_or_address l;
struct symtab *s;
- tui_win_content content = (tui_win_content) TUI_SRC_WIN->generic.content;
+ tui_win_content content = TUI_SRC_WIN->generic.content;
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (cursal.symtab == (struct symtab *) NULL)
{
case SRC_COMMAND:
case DISASSEM_COMMAND:
- first_win = (struct tui_win_info *) (tui_source_windows ())->list[0];
+ first_win = tui_source_windows ()->list[0];
first_win->generic.width += width_diff;
locator->width += width_diff;
/* Check for invalid heights. */
{
first_win = TUI_DATA_WIN;
first_win->generic.width += width_diff;
- second_win = (struct tui_win_info *)
- (tui_source_windows ())->list[0];
+ second_win = tui_source_windows ()->list[0];
second_win->generic.width += width_diff;
}
/* Change the first window's height/width. */
/* Make sure the curses mode is enabled. */
tui_enable ();
- if (arg == (char *) NULL)
+ if (arg == NULL)
parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
else
parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
/* Make sure the curses mode is enabled. */
tui_enable ();
- if (arg == (char *) NULL)
+ if (arg == NULL)
parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
else
parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
static void
tui_set_focus (const char *arg, int from_tty)
{
- if (arg != (char *) NULL)
+ if (arg != NULL)
{
- char *buf_ptr = (char *) xstrdup (arg);
+ char *buf_ptr = xstrdup (arg);
int i;
struct tui_win_info *win_info = NULL;
{
/* Make sure the curses mode is enabled. */
tui_enable ();
- if (arg != (char *) NULL)
+ if (arg != NULL)
{
int ts;
{
/* Make sure the curses mode is enabled. */
tui_enable ();
- if (arg != (char *) NULL)
+ if (arg != NULL)
{
std::string copy = arg;
char *buf = ©[0];
wname = buf_ptr;
buf_ptr = strchr (buf_ptr, ' ');
- if (buf_ptr != (char *) NULL)
+ if (buf_ptr != NULL)
{
*buf_ptr = (char) 0;
/* Delete all data item windows. */
for (i = 0; i < win_info->generic.content_size; i++)
{
- gen_win_info = (struct tui_gen_win_info *)
- &((struct tui_win_element *)
- win_info->generic.content[i])->which_element.data_window;
+ gen_win_info
+ = &win_info->generic.content[i]->which_element.data_window;
tui_delete_win (gen_win_info->handle);
gen_win_info->handle = NULL;
}
/* First set up the default window to scroll, in case there is no
window name arg. */
- if (arg != (char *) NULL)
+ if (arg != NULL)
{
char *buf_ptr;
num_str = buf_ptr;
buf_ptr = strchr (buf_ptr, ' ');
- if (buf_ptr != (char *) NULL)
+ if (buf_ptr != NULL)
{
*buf_ptr = (char) 0;
if (num_to_scroll)
}
/* Process the window name if one is specified. */
- if (buf_ptr != (char *) NULL)
+ if (buf_ptr != NULL)
{
const char *wname;
{
struct tui_gen_win_info *data_item_win;
- data_item_win = &((tui_win_content)
- TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
+ data_item_win
+ = &TUI_DATA_WIN->generic.content[i]->which_element.data_window;
if (data_item_win->handle != (WINDOW *) NULL
&& data_item_win->is_visible)
element_no = i;
for (i = 0; (i < TUI_DATA_WIN->generic.content_size); i++)
{
- data_item_win_ptr = &((tui_win_content)
- TUI_DATA_WIN->generic.content)[i]->which_element.data_window;
+ data_item_win_ptr
+ = &TUI_DATA_WIN->generic.content[i]->which_element.data_window;
tui_delete_win (data_item_win_ptr->handle);
data_item_win_ptr->handle = NULL;
data_item_win_ptr->is_visible = FALSE;
{
werase (TUI_DATA_WIN->generic.handle);
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
- if (prompt != (char *) NULL)
+ if (prompt != NULL)
{
int half_width = (TUI_DATA_WIN->generic.width - 2) / 2;
int x_pos;
tui_erase_data_content (NO_DATA_STRING);
else
{
- tui_erase_data_content ((char *) NULL);
+ tui_erase_data_content (NULL);
tui_delete_data_content_windows ();
tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
tui_display_registers_from (0);
if (first_line >= 0)
{
- tui_erase_data_content ((char *) NULL);
+ tui_erase_data_content (NULL);
if (!reuse_windows)
tui_delete_data_content_windows ();
tui_display_data_from_line (first_line);
void
tui_refresh_data_win (void)
{
- tui_erase_data_content ((char *) NULL);
+ tui_erase_data_content (NULL);
if (TUI_DATA_WIN->generic.content_size > 0)
{
int first_element = tui_first_data_item_displayed ();
first_line += num_to_scroll;
else
first_line -= num_to_scroll;
- tui_erase_data_content ((char *) NULL);
+ tui_erase_data_content (NULL);
tui_delete_data_content_windows ();
tui_display_data_from_line (first_line);
}
{
struct tui_gen_win_info *data_item_win_ptr;
- data_item_win_ptr = &((tui_win_content)
- win_info->content)[i]->which_element.data_window;
+ data_item_win_ptr = &win_info->content[i]->which_element.data_window;
if (data_item_win_ptr != NULL
&& data_item_win_ptr->handle != (WINDOW *) NULL)
wrefresh (data_item_win_ptr->handle);
box (win, tui_border_vline, tui_border_hline);
#endif
if (win_info->title)
- mvwaddstr (win, 0, 3, (char *) win_info->title);
+ mvwaddstr (win, 0, 3, win_info->title);
wattroff (win, attrs);
}
}
wattron (win_info->generic.handle, A_STANDOUT);
mvwaddstr (win_info->generic.handle, lineno, 1,
- (char *) line->which_element.source.line);
+ line->which_element.source.line);
if (line->which_element.source.is_exec_point)
wattroff (win_info->generic.handle, A_STANDOUT);
{
int changed = 0;
int i;
- tui_win_content content = (tui_win_content) win_info->generic.content;
+ tui_win_content content = win_info->generic.content;
i = 0;
while (i < win_info->generic.content_size)
= win_info->generic.content[i]
->which_element.source.line_or_addr.loa == LOA_LINE
&& win_info->generic.content[i]
- ->which_element.source.line_or_addr.u.line_no == (int) line;
+ ->which_element.source.line_or_addr.u.line_no == line;
i++;
}
strcat_to_buf (char *buf, int buflen,
const char *item_to_add)
{
- if (item_to_add != (char *) NULL && buf != (char *) NULL)
+ if (item_to_add != NULL && buf != NULL)
{
if ((strlen (buf) + strlen (item_to_add)) <= buflen)
strcat (buf, item_to_add);