2019-06-16 Tom Tromey <tom@tromey.com>
+ * valops.c (value_cast, value_slice): Remove unnecessary cast.
+ * breakpoint.c (stopin_command, stopat_command)
+ (until_break_command, decode_location_default): Remove unnecessary
+ cast.
+ * utils.c (subset_compare): Remove unnecessary cast.
+ * ada-lang.c (ada_update_initial_language): Remove unnecessary
+ cast.
+ * linespec.c (decode_line_with_last_displayed): Remove unnecessary
+ cast.
+ * infcmd.c (path_command): Remove unnecessary cast.
+ * coffread.c (decode_type): Remove unnecessary cast.
+ * xcoffread.c (read_xcoff_symtab): Remove unnecessary cast.
+ * mipsread.c (mipscoff_symfile_read): Remove unnecessary cast.
+ * tui/tui-stack.c (tui_show_locator_content)
+ (tui_show_frame_info): Remove unnecessary cast.
+ * tui/tui-win.c (tui_scroll_forward_command)
+ (tui_scroll_backward_command, tui_set_focus, tui_set_win_height)
+ (parse_scrolling_args): Remove unnecessary cast.
+ * tui/tui-data.c (init_win_info, tui_del_window)
+ (tui_free_window, tui_del_data_windows, tui_free_data_content)
+ (free_content_elements): Remove unnecessary cast.
+ * tui/tui-windata.c (tui_first_data_item_displayed): Remove
+ unnecessary cast.
+ * tui/tui-source.c (tui_set_source_content)
+ (tui_vertical_source_scroll): Remove unnecessary cast.
+ * tui/tui-layout.c (tui_default_win_height): Remove unnecessary
+ cast.
+ * tui/tui-io.c (tui_initialize_io): Remove unnecessary cast.
+ * tui/tui-regs.c (tui_display_registers_from)
+ (tui_display_register): Remove unnecessary cast.
+ * tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win)
+ (tui_unhighlight_win, tui_highlight_win, tui_make_window)
+ (make_visible): Remove unnecessary cast.
+ * tui/tui-winsource.c (tui_erase_source_content)
+ (tui_update_breakpoint_info, tui_set_exec_info_content): Remove
+ unnecessary cast.
+ * ax-gdb.c (agent_command_1): Remove unnecessary cast.
+ * cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast.
+ * stabsread.c (read_type, read_array_type, read_range_type):
+ Remove unnecessary cast.
+ * mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast.
+ (parse_symbol, parse_type, upgrade_type, parse_external)
+ (parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove
+ unnecessary cast.
+ * gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
+
+2019-06-16 Tom Tromey <tom@tromey.com>
+
* tui/tui-data.c (tui_alloc_generic_win_info)
(tui_alloc_win_info, tui_add_content_elements): Remove NULL
checks.
enum language
ada_update_initial_language (enum language lang)
{
- if (lookup_minimal_symbol ("adainit", (const char *) NULL,
- (struct objfile *) NULL).minsym != NULL)
+ if (lookup_minimal_symbol ("adainit", NULL, NULL).minsym != NULL)
return language_ada;
return lang;
event_location_up location
= new_linespec_location (&exp, symbol_name_match_type::WILD);
decode_line_full (location.get (), DECODE_LINE_FUNFIRSTLINE, NULL,
- (struct symtab *) NULL, 0, &canonical,
+ NULL, 0, &canonical,
NULL, NULL);
exp = skip_spaces (exp);
if (exp[0] == ',')
{
int badInput = 0;
- if (arg == (char *) NULL)
+ if (arg == NULL)
badInput = 1;
else if (*arg != '*')
{
{
int badInput = 0;
- if (arg == (char *) NULL || *arg == '*') /* no line number */
+ if (arg == NULL || *arg == '*') /* no line number */
badInput = 1;
else
{
get_last_displayed_symtab (),
get_last_displayed_line ())
: decode_line_1 (location.get (), DECODE_LINE_FUNFIRSTLINE,
- NULL, (struct symtab *) NULL, 0));
+ NULL, NULL, 0));
if (sals.size () != 1)
error (_("Couldn't get information on specified line."));
struct linespec_result canonical;
decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, search_pspace,
- (struct symtab *) NULL, 0,
- &canonical, multiple_symbols_all,
+ NULL, 0, &canonical, multiple_symbols_all,
b->filter);
/* We should get 0 or 1 resulting SALs. */
uiout->field_string ("name", list->name);
uiout->text (": ");
if (list->type == show_cmd)
- do_show_command ((char *) NULL, from_tty, list);
+ do_show_command (NULL, from_tty, list);
else
cmd_func (list, NULL, from_tty);
}
base_type = decode_type (cs, new_c_type, aux, objfile);
index_type = objfile_type (objfile)->builtin_int;
range_type
- = create_static_range_type ((struct type *) NULL,
- index_type, 0, n - 1);
+ = create_static_range_type (NULL, index_type, 0, n - 1);
type =
- create_array_type ((struct type *) NULL,
- base_type, range_type);
+ create_array_type (NULL, base_type, range_type);
}
return type;
}
/* Set size to 0 to prevent further attempts to read the invalid
section. */
*size = 0;
- return (const gdb_byte *) NULL;
+ return NULL;
}
descriptor->data = data;
current_inferior ()->environment.set (path_var_name, exec_path);
xfree (exec_path);
if (from_tty)
- path_info ((char *) NULL, from_tty);
+ path_info (NULL, from_tty);
}
\f
? decode_line_1 (location.get (), flags, NULL,
get_last_displayed_symtab (),
get_last_displayed_line ())
- : decode_line_1 (location.get (), flags, NULL,
- (struct symtab *) NULL, 0));
+ : decode_line_1 (location.get (), flags, NULL, NULL, 0));
if (*string)
error (_("Junk at end of line specification: %s"), string);
init_header_files ();
/* Make sure all the FDR information is swapped in. */
- if (info->fdr == (FDR *) NULL)
+ if (info->fdr == NULL)
{
char *fdr_src;
char *fdr_end;
long svalue = sh->value;
int bitsize;
- if (ext_sh == (char *) NULL)
+ if (ext_sh == NULL)
name = debug_info->ssext + sh->iss;
else
name = debug_info->ss + cur_fdr->issBase + sh->iss;
/* Create a new type or use the pending type. */
pend = is_pending_symbol (cur_fdr, ext_sh);
- if (pend == (struct mdebug_pending *) NULL)
+ if (pend == NULL)
{
t = new_type (NULL);
add_pending (cur_fdr, ext_sh, t);
/* Parse the type or use the pending type. */
pend = is_pending_symbol (cur_fdr, ext_sh);
- if (pend == (struct mdebug_pending *) NULL)
+ if (pend == NULL)
{
- t = parse_type (cur_fd, ax, sh->index, (int *) NULL, bigend, name);
+ t = parse_type (cur_fd, ax, sh->index, NULL, bigend, name);
add_pending (cur_fdr, ext_sh, t);
}
else
int width = AUX_GET_WIDTH (bigend, ax);
/* Inhibit core dumps if TIR is corrupted. */
- if (bs == (int *) NULL)
+ if (bs == NULL)
{
/* Alpha cc -migrate encodes char and unsigned char types
as short and unsigned short types with a field width of 8.
xref_fh = get_rfd (fd, rf);
xref_fd = xref_fh - debug_info->fdr;
tp = parse_type (xref_fd, debug_info->external_aux + xref_fh->iauxBase,
- rn->index, (int *) NULL, xref_fh->fBigendian, sym_name);
+ rn->index, NULL, xref_fh->fBigendian, sym_name);
}
/* All these types really point to some (common) MIPS type
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
- if (tp == (struct type *) NULL)
+ if (tp == NULL)
tp = init_type (mdebugread_objfile, type_code, 0, NULL);
/* DEC c89 produces cross references to qualified aggregate types,
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
- if (tp == (struct type *) NULL)
+ if (tp == NULL)
tp = init_type (mdebugread_objfile, type_code, 0, NULL);
/* Make sure that TYPE_CODE(tp) has an expected type code.
/* Try to cross reference this type, it should succeed. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
- if (tp == (struct type *) NULL)
+ if (tp == NULL)
{
complaint (_("unable to cross ref btTypedef for %s"), sym_name);
tp = basic_type (btInt, mdebugread_objfile);
indx = parse_type (fh - debug_info->fdr,
debug_info->external_aux + fh->iauxBase,
- id, (int *) NULL, bigend, sym_name);
+ id, NULL, bigend, sym_name);
/* The bounds type should be an integer type, but might be anything
else due to corrupt aux entries. */
ax++;
rf = AUX_GET_WIDTH (bigend, ax); /* bit size of array element */
- range = create_static_range_type ((struct type *) NULL, indx,
- lower, upper);
+ range = create_static_range_type (NULL, indx, lower, upper);
- t = create_array_type ((struct type *) NULL, *tpp, range);
+ t = create_array_type (NULL, *tpp, range);
/* We used to fill in the supplied array element bitsize
here if the TYPE_LENGTH of the target type was zero.
/* Note that the case of a symbol with indexNil must be handled
anyways by parse_symbol(). */
- parse_symbol (&es->asym, ax, (char *) NULL,
+ parse_symbol (&es->asym, ax, NULL,
bigend, section_offsets, objfile);
break;
default:
fh = f_idx + debug_info->fdr;
pst = fdr_to_pst[f_idx].pst;
- if (pst == (struct partial_symtab *) NULL)
+ if (pst == NULL)
continue;
/* This should catch stabs-in-ecoff. */
continue;
/* Do not add to dependeny list if psymtab was empty. */
- if (fdr_to_pst[rh].pst == (struct partial_symtab *) NULL)
+ if (fdr_to_pst[rh].pst == NULL)
continue;
pst->dependencies[pst->number_of_dependencies++]
= fdr_to_pst[rh].pst;
mdebugread_objfile = objfile;
cur_fd = FDR_IDX (pst);
fh = ((cur_fd == -1)
- ? (FDR *) NULL
+ ? NULL
: debug_info->fdr + cur_fd);
cur_fdr = fh;
/* See comment in parse_partial_symbols about the @stabs sentinel. */
processing_gcc_compilation = 0;
- if (fh != (FDR *) NULL && fh->csym >= 2)
+ if (fh != NULL && fh->csym >= 2)
{
SYMR sh;
*tpp = parse_type (xref_fd,
debug_info->external_aux + fh->iauxBase,
sh.index,
- (int *) NULL,
+ NULL,
fh->fBigendian,
debug_info->ss + fh->issBase + sh.iss);
add_pending (fh, esh, *tpp);
*tpp = parse_type (xref_fd,
debug_info->external_aux + fh->iauxBase,
sh.index,
- (int *) NULL,
+ NULL,
fh->fBigendian,
debug_info->ss + fh->issBase + sh.iss);
}
process it and define symbols accordingly. */
if (!((*ecoff_backend (abfd)->debug_swap.read_debug_info)
- (abfd, (asection *) NULL, &ecoff_data (abfd)->debug_info)))
+ (abfd, NULL, &ecoff_data (abfd)->debug_info)))
error (_("Error reading symbol table: %s"), bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (reader, objfile, &ecoff_backend (abfd)->debug_swap,
case 'S': /* Set type */
type1 = read_type (pp, objfile);
- type = create_set_type ((struct type *) NULL, type1);
+ type = create_set_type (NULL, type1);
if (typenums[0] != -1)
*dbx_lookup_type (typenums, objfile) = type;
break;
}
range_type =
- create_static_range_type ((struct type *) NULL, index_type, lower, upper);
+ create_static_range_type (NULL, index_type, lower, upper);
type = create_array_type (type, element_type, range_type);
return type;
}
result_type
- = create_static_range_type ((struct type *) NULL, index_type, n2, n3);
+ = create_static_range_type (NULL, index_type, n2, n3);
return (result_type);
}
{
case SRC_WIN:
case DISASSEM_WIN:
- win_info->detail.source_info.execution_info
- = (struct tui_gen_win_info *) NULL;
+ win_info->detail.source_info.execution_info = NULL;
win_info->detail.source_info.has_locator = FALSE;
win_info->detail.source_info.horizontal_offset = 0;
win_info->detail.source_info.gdbarch = NULL;
case SRC_WIN:
case DISASSEM_WIN:
generic_win = tui_locator_win_info_ptr ();
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (generic_win != NULL)
{
tui_delete_win (generic_win->handle);
generic_win->handle = NULL;
win_info->detail.source_info.fullname = NULL;
}
generic_win = win_info->detail.source_info.execution_info;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (generic_win != NULL)
{
tui_delete_win (generic_win->handle);
generic_win->handle = NULL;
default:
break;
}
- if (win_info->generic.handle != (WINDOW *) NULL)
+ if (win_info->generic.handle != NULL)
{
tui_delete_win (win_info->generic.handle);
win_info->generic.handle = NULL;
win_info->detail.source_info.fullname = NULL;
}
generic_win = win_info->detail.source_info.execution_info;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (generic_win != NULL)
{
tui_delete_win (generic_win->handle);
generic_win->handle = NULL;
default:
break;
}
- if (win_info->generic.handle != (WINDOW *) NULL)
+ if (win_info->generic.handle != NULL)
{
tui_delete_win (win_info->generic.handle);
win_info->generic.handle = NULL;
struct tui_gen_win_info *generic_win
= &content[i]->which_element.data_window;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (generic_win != NULL)
{
tui_delete_win (generic_win->handle);
generic_win->handle = NULL;
struct tui_gen_win_info *generic_win
= &content[i]->which_element.data_window;
- if (generic_win != (struct tui_gen_win_info *) NULL)
+ if (generic_win != NULL)
{
tui_delete_win (generic_win->handle);
generic_win->handle = NULL;
struct tui_win_element *element;
element = content[i];
- if (element != (struct tui_win_element *) NULL)
+ if (element != NULL)
{
switch (type)
{
if (tui_rl_outstream == 0)
error (_("Cannot redirect readline output"));
- setvbuf (tui_rl_outstream, (char*) NULL, _IOLBF, 0);
+ setvbuf (tui_rl_outstream, NULL, _IOLBF, 0);
#ifdef O_NONBLOCK
(void) fcntl (tui_readline_pipe[0], F_SETFL, O_NONBLOCK);
{
int h;
- if (tui_win_list[type] != (struct tui_win_info *) NULL)
+ if (tui_win_list[type] != NULL)
h = tui_win_list[type]->generic.height;
else
{
data_item_win = &display_info->regs_content[i]
->which_element.data_window;
data_element_ptr = &data_item_win->content[0]->which_element.data;
- if (data_item_win->handle != (WINDOW*) NULL
+ if (data_item_win->handle != NULL
&& (data_item_win->height != 1
|| data_item_win->width != item_win_width
|| data_item_win->origin.x != (item_win_width * j) + 1
data_item_win->handle = 0;
}
- if (data_item_win->handle == (WINDOW *) NULL)
+ if (data_item_win->handle == NULL)
{
data_item_win->height = 1;
data_item_win->width = item_win_width;
tui_display_register (struct tui_data_element *data,
struct tui_gen_win_info *win_info)
{
- if (win_info->handle != (WINDOW *) NULL)
+ if (win_info->handle != NULL)
{
int i;
{
enum tui_status ret = TUI_FAILURE;
- if (s != (struct symtab *) NULL)
+ if (s != NULL)
{
int line_width, nlines;
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)
+ if (cursal.symtab == NULL)
s = find_pc_line_symtab (get_frame_pc (get_selected_frame (NULL)));
else
s = cursal.symtab;
locator = tui_locator_win_info_ptr ();
- if (locator != NULL && locator->handle != (WINDOW *) NULL)
+ if (locator != NULL && locator->handle != NULL)
{
struct tui_win_element *element;
else
{
if (find_pc_partial_function (get_frame_pc (fi),
- (const char **) NULL,
- &low, NULL) == 0)
+ NULL, &low, NULL) == 0)
{
/* There is no symbol available for current PC. There is no
safe way how to "disassemble backwards". */
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg == NULL)
- parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
+ parse_scrolling_args (arg, &win_to_scroll, NULL);
else
parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
tui_scroll (FORWARD_SCROLL, win_to_scroll, num_to_scroll);
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg == NULL)
- parse_scrolling_args (arg, &win_to_scroll, (int *) NULL);
+ parse_scrolling_args (arg, &win_to_scroll, NULL);
else
parse_scrolling_args (arg, &win_to_scroll, &num_to_scroll);
tui_scroll (BACKWARD_SCROLL, win_to_scroll, num_to_scroll);
else
win_info = tui_partial_win_by_name (buf_ptr);
- if (win_info == (struct tui_win_info *) NULL
- || !win_info->generic.is_visible)
+ if (win_info == NULL || !win_info->generic.is_visible)
warning (_("Invalid window specified. \n\
The window name specified must be valid and visible.\n"));
else
wname[i] = tolower (wname[i]);
win_info = tui_partial_win_by_name (wname);
- if (win_info == (struct tui_win_info *) NULL
- || !win_info->generic.is_visible)
+ if (win_info == NULL || !win_info->generic.is_visible)
warning (_("Invalid window specified. \n\
The window name specified must be valid and visible.\n"));
else
*win_to_scroll = tui_partial_win_by_name (wname);
- if (*win_to_scroll == (struct tui_win_info *) NULL
+ if (*win_to_scroll == NULL
|| !(*win_to_scroll)->generic.is_visible)
error (_("Invalid window specified. \n\
The window name specified must be valid and visible.\n"));
data_item_win
= &TUI_DATA_WIN->generic.content[i]->which_element.data_window;
- if (data_item_win->handle != (WINDOW *) NULL
+ if (data_item_win->handle != NULL
&& data_item_win->is_visible)
element_no = i;
}
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)
+ && data_item_win_ptr->handle != NULL)
wrefresh (data_item_win_ptr->handle);
}
}
}
else
{
- if (win_info->handle != (WINDOW *) NULL)
+ if (win_info->handle != NULL)
wrefresh (win_info->handle);
}
void
tui_delete_win (WINDOW *window)
{
- if (window != (WINDOW *) NULL)
+ if (window != NULL)
delwin (window);
return;
tui_unhighlight_win (struct tui_win_info *win_info)
{
if (win_info != NULL
- && win_info->generic.handle != (WINDOW *) NULL)
+ && win_info->generic.handle != NULL)
{
box_win ((struct tui_gen_win_info *) win_info, NO_HILITE);
wrefresh (win_info->generic.handle);
{
if (win_info != NULL
&& win_info->can_highlight
- && win_info->generic.handle != (WINDOW *) NULL)
+ && win_info->generic.handle != NULL)
{
box_win ((struct tui_gen_win_info *) win_info, HILITE);
wrefresh (win_info->generic.handle);
win_info->origin.y,
win_info->origin.x);
win_info->handle = handle;
- if (handle != (WINDOW *) NULL)
+ if (handle != NULL)
{
if (box_it == BOX_WINDOW)
box_win (win_info, NO_HILITE);
}
else if (!visible
&& win_info->is_visible
- && win_info->handle != (WINDOW *) NULL)
+ && win_info->handle != NULL)
{
win_info->is_visible = FALSE;
tui_delete_win (win_info->handle);
int x_pos;
int half_width = (win_info->generic.width - 2) / 2;
- if (win_info->generic.handle != (WINDOW *) NULL)
+ if (win_info->generic.handle != NULL)
{
werase (win_info->generic.handle);
tui_check_and_display_highlight_if_needed (win_info);
those that we already hit. */
mode = 0;
for (bp = breakpoint_chain;
- bp != (struct breakpoint *) NULL;
+ bp != NULL;
bp = bp->next)
{
struct bp_location *loc;
{
enum tui_status ret = TUI_SUCCESS;
- if (win_info->detail.source_info.execution_info
- != (struct tui_gen_win_info *) NULL)
+ if (win_info->detail.source_info.execution_info != NULL)
{
struct tui_gen_win_info *exec_info_ptr
= win_info->detail.source_info.execution_info;
{
int match;
- if (template_string != (char *) NULL && string_to_compare != (char *) NULL
+ if (template_string != NULL && string_to_compare != NULL
&& strlen (string_to_compare) <= strlen (template_string))
match =
(startswith (template_string, string_to_compare));
"divide object size in cast"));
/* FIXME-type-allocation: need a way to free this type when
we are done with it. */
- range_type = create_static_range_type ((struct type *) NULL,
+ range_type = create_static_range_type (NULL,
TYPE_TARGET_TYPE (range_type),
low_bound,
new_length + low_bound - 1);
deprecated_set_value_type (arg2,
- create_array_type ((struct type *) NULL,
+ create_array_type (NULL,
element_type,
range_type));
return arg2;
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
- slice_range_type = create_static_range_type ((struct type *) NULL,
+ slice_range_type = create_static_range_type (NULL,
TYPE_TARGET_TYPE (range_type),
lowbound,
lowbound + length - 1);
LONGEST offset
= (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
- slice_type = create_array_type ((struct type *) NULL,
+ slice_type = create_array_type (NULL,
element_type,
slice_range_type);
TYPE_CODE (slice_type) = TYPE_CODE (array_type);
pst_symtab_language = deduce_language_from_filename (filestring);
start_stabs ();
- start_symtab (objfile, filestring, (char *) NULL, file_start_addr,
+ start_symtab (objfile, filestring, NULL, file_start_addr,
pst_symtab_language);
record_debugformat (debugfmt);
symnum = ((struct symloc *) pst->read_symtab_private)->first_symnum;
}
start_stabs ();
- start_symtab (objfile, "_globals_", (char *) NULL,
- (CORE_ADDR) 0, pst_symtab_language);
+ start_symtab (objfile, "_globals_", NULL,
+ 0, pst_symtab_language);
record_debugformat (debugfmt);
cur_src_end_addr = first_object_file_end;
/* Done with all files, everything from here on is globals. */
/* Give all csects for this source file the same
name. */
start_symtab (objfile, filestring, NULL,
- (CORE_ADDR) 0, pst_symtab_language);
+ 0, pst_symtab_language);
record_debugformat (debugfmt);
}
filestring = cs->c_name;
start_stabs ();
- start_symtab (objfile, filestring, (char *) NULL, (CORE_ADDR) 0,
- pst_symtab_language);
+ start_symtab (objfile, filestring, NULL, 0, pst_symtab_language);
record_debugformat (debugfmt);
last_csect_name = 0;