diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2015-08-31 21:32:11 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2015-09-04 16:50:41 +0100 |
commit | e65b52456bc3f60a176fece5e34e420c5a75bd16 (patch) | |
tree | a80435ebf6243e0db672f69c2c8db5c761f7eb6f /gdb/tui/tui-win.c | |
parent | b03e6ad9cd2064214c0fbff179c7e47c855315e3 (diff) | |
download | gdb-e65b52456bc3f60a176fece5e34e420c5a75bd16.zip gdb-e65b52456bc3f60a176fece5e34e420c5a75bd16.tar.gz gdb-e65b52456bc3f60a176fece5e34e420c5a75bd16.tar.bz2 |
gdb/tui: Remove casts of NULL during assignment.
In the following code:
struct symbol *wsym = (struct symbol *) NULL;
the cast of NULL is redundant, it adds noise, and is just one more thing
to change if the type of wsym ever changes. There are a relatively
small number of places in gdb where the above code pattern is used.
Usually the cast is removed like this:
struct symbol *wsym = NULL;
This commit updates all the places within the gdb/tui directory where we
cast NULL during assignment, removing the cast.
gdb/ChangeLog:
* tui/tui-data.c (win_with_focus): Remove cast of NULL pointer.
(tui_next_win): Likewise.
(tui_prev_win): Likewise.
(tui_partial_win_by_name): Likewise.
(tui_init_generic_part): Likewise.
(init_content_element): Likewise.
(tui_del_window): Likewise.
(tui_free_window): Likewise.
(tui_del_data_windows): Likewise.
(tui_free_data_content): Likewise.
* tui/tui-layout.c (make_source_or_disasm_window): Likewise.
* tui/tui-regs.c (tui_show_register_group): Likewise.
* tui/tui-win.c (tui_resize_all): Likewise.
(tui_set_focus): Likewise.
(tui_set_win_height): Likewise.
(make_invisible_and_set_new_height): Likewise.
* tui/tui-windata.c (tui_delete_data_content_windows): Likewise.
* tui/tui-wingeneral.c (make_visible): Likewise.
Diffstat (limited to 'gdb/tui/tui-win.c')
-rw-r--r-- | gdb/tui/tui-win.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 6768d35..d841a61 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -900,7 +900,7 @@ tui_resize_all (void) && !tui_win_list[win_type]->generic.is_visible) { tui_free_window (tui_win_list[win_type]); - tui_win_list[win_type] = (struct tui_win_info *) NULL; + tui_win_list[win_type] = NULL; } } /* Turn keypad back on, unless focus is in the command @@ -1048,7 +1048,7 @@ tui_set_focus (char *arg, int from_tty) { char *buf_ptr = (char *) xstrdup (arg); int i; - struct tui_win_info *win_info = (struct tui_win_info *) NULL; + struct tui_win_info *win_info = NULL; for (i = 0; (i < strlen (buf_ptr)); i++) buf_ptr[i] = tolower (arg[i]); @@ -1170,7 +1170,7 @@ tui_set_win_height (char *arg, int from_tty) { char *buf = xstrdup (arg); char *buf_ptr = buf; - char *wname = (char *) NULL; + char *wname = NULL; int new_height, i; struct tui_win_info *win_info; struct cleanup *old_chain; @@ -1457,7 +1457,7 @@ make_invisible_and_set_new_height (struct tui_win_info *win_info, &((struct tui_win_element *) win_info->generic.content[i])->which_element.data_window; tui_delete_win (gen_win_info->handle); - gen_win_info->handle = (WINDOW *) NULL; + gen_win_info->handle = NULL; } break; default: |