replace XMALLOC with XNEW

This replaces XMALLOC with XNEW, and removes XMALLOC.  The only
non-mechanical bit here was remembering to edit gdbarch.sh.

2014-01-13  Tom Tromey  <tromey@redhat.com>

	* defs.h (XMALLOC): Remove.
	* avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC.
	* bfin-tdep.c (bfin_gdbarch_init): Likewise.
	* cli-out.c (struct ui_out *): Likewise.
	* cli/cli-dump.c (add_dump_command): Likewise.
	(add_dump_command): Likewise.
	* complaints.c (get_complaints): Likewise.
	(find_complaint): Likewise.
	* dwarf2-frame.c (execute_cfa_program): Likewise.
	* dwarf2read.c (abbrev_table_read_table): Likewise.
	* gdbarch.sh: Likewise.
	* gdbarch.c: Rebuild.
	* inf-ttrace.c (inf_ttrace_add_page): Likewise.
	* interps.c (interp_new): Likewise.
	* lm32-tdep.c (lm32_gdbarch_init): Likewise.
	* m32r-tdep.c (m32r_gdbarch_init): Likewise.
	* mi/mi-console.c (mi_console_file_new): Likewise.
	* mi/mi-interp.c (mi_interpreter_init): Likewise.
	* mi/mi-out.c (mi_out_new): Likewise.
	* mi/mi-parse.c (mi_parse): Likewise.
	* microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
	* moxie-tdep.c (moxie_gdbarch_init): Likewise.
	* observer.c (xalloc_observer_list_node): Likewise.
	* regcache.c (regcache_xmalloc_1): Likewise.
	* reggroups.c (reggroup_new): Likewise.
	(_initialize_reggroup): Likewise.
	* registry.c (register_data_with_cleanup): Likewise.
	* remote.c (remote_notif_stop_alloc_reply): Likewise.
	* ser-base.c (serial_ttystate): Likewise.
	* ser-mingw.c (make_pipe_state): Likewise.
	* ser-pipe.c (pipe_open): Likewise.
	* serial.c (serial_open): Likewise.
	* sh64-tdep.c (sh64_gdbarch_init): Likewise.
	* tui/tui-data.c (tui_alloc_generic_win_info): Likewise.
	(tui_alloc_win_info): Likewise.
	(tui_add_content_elements): Likewise.
	* tui/tui-file.c (tui_file_new): Likewise.
	* tui/tui-out.c (tui_out_new): Likewise.
	* ui-file.c (mem_file_new): Likewise.
	* ui-out.c (push_level): Likewise.
	(make_cleanup_ui_out_end): Likewise.
	(append_header_to_list): Likewise.
	(ui_out_new): Likewise.
	* user-regs.c (user_reg_add_builtin): Likewise.
This commit is contained in:
Tom Tromey 2013-12-28 15:31:23 -07:00
parent 41bf6acad7
commit 70ba0933ad
37 changed files with 108 additions and 62 deletions

View File

@ -1,3 +1,50 @@
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XMALLOC): Remove.
* avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC.
* bfin-tdep.c (bfin_gdbarch_init): Likewise.
* cli-out.c (struct ui_out *): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
(add_dump_command): Likewise.
* complaints.c (get_complaints): Likewise.
(find_complaint): Likewise.
* dwarf2-frame.c (execute_cfa_program): Likewise.
* dwarf2read.c (abbrev_table_read_table): Likewise.
* gdbarch.sh: Likewise.
* gdbarch.c: Rebuild.
* inf-ttrace.c (inf_ttrace_add_page): Likewise.
* interps.c (interp_new): Likewise.
* lm32-tdep.c (lm32_gdbarch_init): Likewise.
* m32r-tdep.c (m32r_gdbarch_init): Likewise.
* mi/mi-console.c (mi_console_file_new): Likewise.
* mi/mi-interp.c (mi_interpreter_init): Likewise.
* mi/mi-out.c (mi_out_new): Likewise.
* mi/mi-parse.c (mi_parse): Likewise.
* microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
* moxie-tdep.c (moxie_gdbarch_init): Likewise.
* observer.c (xalloc_observer_list_node): Likewise.
* regcache.c (regcache_xmalloc_1): Likewise.
* reggroups.c (reggroup_new): Likewise.
(_initialize_reggroup): Likewise.
* registry.c (register_data_with_cleanup): Likewise.
* remote.c (remote_notif_stop_alloc_reply): Likewise.
* ser-base.c (serial_ttystate): Likewise.
* ser-mingw.c (make_pipe_state): Likewise.
* ser-pipe.c (pipe_open): Likewise.
* serial.c (serial_open): Likewise.
* sh64-tdep.c (sh64_gdbarch_init): Likewise.
* tui/tui-data.c (tui_alloc_generic_win_info): Likewise.
(tui_alloc_win_info): Likewise.
(tui_add_content_elements): Likewise.
* tui/tui-file.c (tui_file_new): Likewise.
* tui/tui-out.c (tui_out_new): Likewise.
* ui-file.c (mem_file_new): Likewise.
* ui-out.c (push_level): Likewise.
(make_cleanup_ui_out_end): Likewise.
(append_header_to_list): Likewise.
(ui_out_new): Likewise.
* user-regs.c (user_reg_add_builtin): Likewise.
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XZALLOC): Remove.

View File

@ -1377,7 +1377,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
/* None found, create a new architecture from the information provided. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
tdep->call_length = call_length;

View File

@ -818,7 +818,7 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
}
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
tdep->bfin_abi = abi;

View File

@ -393,7 +393,7 @@ struct ui_out *
cli_out_new (struct ui_file *stream)
{
int flags = ui_source_list;
cli_out_data *data = XMALLOC (cli_out_data);
cli_out_data *data = XNEW (cli_out_data);
cli_out_data_ctor (data, stream);
return ui_out_new (&cli_ui_out_impl, data, flags);

View File

@ -396,7 +396,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
c = add_cmd (name, all_commands, NULL, descr, &dump_cmdlist);
c->completer = filename_completer;
d = XMALLOC (struct dump_context);
d = XNEW (struct dump_context);
d->func = func;
d->mode = FOPEN_WB;
set_cmd_context (c, d);
@ -404,7 +404,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
c = add_cmd (name, all_commands, NULL, descr, &append_cmdlist);
c->completer = filename_completer;
d = XMALLOC (struct dump_context);
d = XNEW (struct dump_context);
d->func = func;
d->mode = FOPEN_AB;
set_cmd_context (c, d);

View File

@ -112,7 +112,7 @@ get_complaints (struct complaints **c)
{
if ((*c) != NULL)
return (*c);
(*c) = XMALLOC (struct complaints);
(*c) = XNEW (struct complaints);
(*c)->root = &complaint_sentinel;
(*c)->series = ISOLATED_MESSAGE;
(*c)->explanation = NULL;
@ -140,7 +140,7 @@ find_complaint (struct complaints *complaints, const char *file,
}
/* Oops not seen before, fill in a new complaint. */
complaint = XMALLOC (struct complain);
complaint = XNEW (struct complain);
complaint->fmt = fmt;
complaint->file = file;
complaint->line = line;

View File

@ -556,7 +556,6 @@ extern int longest_to_int (LONGEST);
/* Utility macros to allocate typed memory. Avoids errors like:
struct foo *foo = xmalloc (sizeof struct bar); and memset (foo,
sizeof (struct foo), 0). */
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
#include "common-utils.h"

View File

@ -518,7 +518,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
{
struct dwarf2_frame_state_reg_info *new_rs;
new_rs = XMALLOC (struct dwarf2_frame_state_reg_info);
new_rs = XNEW (struct dwarf2_frame_state_reg_info);
*new_rs = fs->regs;
fs->regs.reg = dwarf2_frame_state_copy_regs (&fs->regs);
fs->regs.prev = new_rs;

View File

@ -14724,7 +14724,7 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
struct attr_abbrev *cur_attrs;
unsigned int allocated_attrs;
abbrev_table = XMALLOC (struct abbrev_table);
abbrev_table = XNEW (struct abbrev_table);
abbrev_table->offset = offset;
obstack_init (&abbrev_table->abbrev_obstack);
abbrev_table->abbrevs = obstack_alloc (&abbrev_table->abbrev_obstack,

View File

@ -505,7 +505,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
/* Create an obstack for allocating all the per-architecture memory,
then use that to allocate the architecture vector. */
struct obstack *obstack = XMALLOC (struct obstack);
struct obstack *obstack = XNEW (struct obstack);
obstack_init (obstack);
gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
memset (gdbarch, 0, sizeof (*gdbarch));
@ -4490,9 +4490,9 @@ gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
(*curr) = XMALLOC (struct gdbarch_data_registration);
(*curr) = XNEW (struct gdbarch_data_registration);
(*curr)->next = NULL;
(*curr)->data = XMALLOC (struct gdbarch_data);
(*curr)->data = XNEW (struct gdbarch_data);
(*curr)->data->index = gdbarch_data_registry.nr++;
(*curr)->data->pre_init = pre_init;
(*curr)->data->post_init = post_init;
@ -4661,7 +4661,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
bfd_arch_info->printable_name,
host_address_to_string (init));
/* Append it */
(*curr) = XMALLOC (struct gdbarch_registration);
(*curr) = XNEW (struct gdbarch_registration);
(*curr)->bfd_architecture = bfd_architecture;
(*curr)->init = init;
(*curr)->dump_tdep = dump_tdep;
@ -4805,7 +4805,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
/* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */
{
struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
struct gdbarch_list *this = XNEW (struct gdbarch_list);
this->next = rego->arches;
this->gdbarch = new_gdbarch;
rego->arches = this;

View File

@ -1645,7 +1645,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
/* Create an obstack for allocating all the per-architecture memory,
then use that to allocate the architecture vector. */
struct obstack *obstack = XMALLOC (struct obstack);
struct obstack *obstack = XNEW (struct obstack);
obstack_init (obstack);
gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
memset (gdbarch, 0, sizeof (*gdbarch));
@ -2005,9 +2005,9 @@ gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
(*curr) = XMALLOC (struct gdbarch_data_registration);
(*curr) = XNEW (struct gdbarch_data_registration);
(*curr)->next = NULL;
(*curr)->data = XMALLOC (struct gdbarch_data);
(*curr)->data = XNEW (struct gdbarch_data);
(*curr)->data->index = gdbarch_data_registry.nr++;
(*curr)->data->pre_init = pre_init;
(*curr)->data->post_init = post_init;
@ -2176,7 +2176,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
bfd_arch_info->printable_name,
host_address_to_string (init));
/* Append it */
(*curr) = XMALLOC (struct gdbarch_registration);
(*curr) = XNEW (struct gdbarch_registration);
(*curr)->bfd_architecture = bfd_architecture;
(*curr)->init = init;
(*curr)->dump_tdep = dump_tdep;
@ -2320,7 +2320,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
/* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */
{
struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
struct gdbarch_list *this = XNEW (struct gdbarch_list);
this->next = rego->arches;
this->gdbarch = new_gdbarch;
rego->arches = this;

View File

@ -195,7 +195,7 @@ inf_ttrace_add_page (pid_t pid, CORE_ADDR addr)
addr, 0, (uintptr_t)&prot) == -1)
perror_with_name (("ttrace"));
page = XMALLOC (struct inf_ttrace_page);
page = XNEW (struct inf_ttrace_page);
page->addr = addr;
page->prot = prot;
page->refcount = 0;

View File

@ -93,7 +93,7 @@ interp_new (const char *name, const struct interp_procs *procs)
{
struct interp *new_interp;
new_interp = XMALLOC (struct interp);
new_interp = XNEW (struct interp);
new_interp->name = xstrdup (name);
new_interp->data = NULL;

View File

@ -527,7 +527,7 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* None found, create a new architecture from the information provided. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
/* Type sizes. */

View File

@ -917,7 +917,7 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* Allocate space for the new architecture. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_read_pc (gdbarch, m32r_read_pc);

View File

@ -52,7 +52,7 @@ struct ui_file *
mi_console_file_new (struct ui_file *raw, const char *prefix, char quote)
{
struct ui_file *ui_file = ui_file_new ();
struct mi_console_file *mi_console = XMALLOC (struct mi_console_file);
struct mi_console_file *mi_console = XNEW (struct mi_console_file);
mi_console->magic = &mi_console_file_magic;
mi_console->raw = raw;

View File

@ -83,7 +83,7 @@ static int report_initial_inferior (struct inferior *inf, void *closure);
static void *
mi_interpreter_init (struct interp *interp, int top_level)
{
struct mi_interp *mi = XMALLOC (struct mi_interp);
struct mi_interp *mi = XNEW (struct mi_interp);
const char *name;
int mi_version;

View File

@ -411,7 +411,7 @@ mi_out_new (int mi_version)
{
int flags = 0;
mi_out_data *data = XMALLOC (mi_out_data);
mi_out_data *data = XNEW (mi_out_data);
data->suppress_field_separator = 0;
data->suppress_output = 0;
data->mi_version = mi_version;

View File

@ -237,7 +237,7 @@ struct mi_parse *
mi_parse (const char *cmd, char **token)
{
const char *chp;
struct mi_parse *parse = XMALLOC (struct mi_parse);
struct mi_parse *parse = XNEW (struct mi_parse);
struct cleanup *cleanup;
memset (parse, 0, sizeof (*parse));

View File

@ -676,7 +676,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* Allocate space for the new architecture. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_long_double_bit (gdbarch, 128);

View File

@ -1112,7 +1112,7 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* Allocate space for the new architecture. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
set_gdbarch_read_pc (gdbarch, moxie_read_pc);

View File

@ -89,9 +89,9 @@ struct observer_list
static struct observer_list *
xalloc_observer_list_node (void)
{
struct observer_list *node = XMALLOC (struct observer_list);
struct observer_list *node = XNEW (struct observer_list);
node->observer = XMALLOC (struct observer);
node->observer = XNEW (struct observer);
return node;
}

View File

@ -217,7 +217,7 @@ regcache_xmalloc_1 (struct gdbarch *gdbarch, struct address_space *aspace,
gdb_assert (gdbarch != NULL);
descr = regcache_descr (gdbarch);
regcache = XMALLOC (struct regcache);
regcache = XNEW (struct regcache);
regcache->descr = descr;
regcache->readonly_p = readonly_p;
if (readonly_p)

View File

@ -39,7 +39,7 @@ struct reggroup
struct reggroup *
reggroup_new (const char *name, enum reggroup_type type)
{
struct reggroup *group = XMALLOC (struct reggroup);
struct reggroup *group = XNEW (struct reggroup);
group->name = name;
group->type = type;
@ -277,13 +277,13 @@ _initialize_reggroup (void)
reggroups_data = gdbarch_data_register_post_init (reggroups_init);
/* The pre-defined list of groups. */
add_group (&default_groups, general_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, float_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, system_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, vector_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, all_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, save_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, restore_reggroup, XMALLOC (struct reggroup_el));
add_group (&default_groups, general_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, float_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, system_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, vector_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, all_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, save_reggroup, XNEW (struct reggroup_el));
add_group (&default_groups, restore_reggroup, XNEW (struct reggroup_el));
add_cmd ("reggroups", class_maintenance,
maintenance_print_reggroups, _("\

View File

@ -35,9 +35,9 @@ register_data_with_cleanup (struct registry_data_registry *registry,
curr = &(*curr)->next)
;
*curr = XMALLOC (struct registry_data_registration);
*curr = XNEW (struct registry_data_registration);
(*curr)->next = NULL;
(*curr)->data = XMALLOC (struct registry_data);
(*curr)->data = XNEW (struct registry_data);
(*curr)->data->index = registry->num_registrations++;
(*curr)->data->save = save;
(*curr)->data->free = free;

View File

@ -5408,7 +5408,7 @@ static struct notif_event *
remote_notif_stop_alloc_reply (void)
{
struct notif_event *r
= (struct notif_event *) XMALLOC (struct stop_reply);
= (struct notif_event *) XNEW (struct stop_reply);
r->dtr = stop_reply_dtr;

View File

@ -498,14 +498,14 @@ serial_ttystate
ser_base_get_tty_state (struct serial *scb)
{
/* Allocate a dummy. */
return (serial_ttystate) XMALLOC (int);
return (serial_ttystate) XNEW (int);
}
serial_ttystate
ser_base_copy_tty_state (struct serial *scb, serial_ttystate ttystate)
{
/* Allocate another dummy. */
return (serial_ttystate) XMALLOC (int);
return (serial_ttystate) XNEW (int);
}
int

View File

@ -788,7 +788,7 @@ struct pipe_state
static struct pipe_state *
make_pipe_state (void)
{
struct pipe_state *ps = XMALLOC (struct pipe_state);
struct pipe_state *ps = XNEW (struct pipe_state);
memset (ps, 0, sizeof (*ps));
ps->wait.read_event = INVALID_HANDLE_VALUE;

View File

@ -134,7 +134,7 @@ pipe_open (struct serial *scb, const char *name)
if (err_pdes[1] != -1)
close (err_pdes[1]);
/* :end chunk */
state = XMALLOC (struct pipe_state);
state = XNEW (struct pipe_state);
state->pid = pid;
scb->fd = pdes[0];
scb->error_fd = err_pdes[0];

View File

@ -211,7 +211,7 @@ serial_open (const char *name)
if (!ops)
return NULL;
scb = XMALLOC (struct serial);
scb = XNEW (struct serial);
scb->ops = ops;

View File

@ -2370,7 +2370,7 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* None found, create a new architecture from the information
provided. */
tdep = XMALLOC (struct gdbarch_tdep);
tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
/* Determine the ABI */

View File

@ -447,7 +447,7 @@ tui_alloc_generic_win_info (void)
{
struct tui_gen_win_info *win;
if ((win = XMALLOC (struct tui_gen_win_info)) != NULL)
if ((win = XNEW (struct tui_gen_win_info)) != NULL)
tui_init_generic_part (win);
return win;
@ -570,7 +570,7 @@ tui_alloc_win_info (enum tui_win_type type)
{
struct tui_win_info *win_info;
win_info = XMALLOC (struct tui_win_info);
win_info = XNEW (struct tui_win_info);
if (win_info != NULL)
{
win_info->generic.type = type;
@ -647,7 +647,7 @@ tui_add_content_elements (struct tui_gen_win_info *win_info,
{
for (i = index_start; (i < num_elements + index_start); i++)
{
if ((element_ptr = XMALLOC (struct tui_win_element)) != NULL)
if ((element_ptr = XNEW (struct tui_win_element)) != NULL)
{
win_info->content[i] = (void *) element_ptr;
init_content_element (element_ptr, win_info->type);

View File

@ -57,7 +57,7 @@ static int tui_file_magic;
static struct ui_file *
tui_file_new (void)
{
struct tui_stream *tui = XMALLOC (struct tui_stream);
struct tui_stream *tui = XNEW (struct tui_stream);
struct ui_file *file = ui_file_new ();
set_ui_file_data (file, tui, tui_file_delete);

View File

@ -150,7 +150,7 @@ tui_out_new (struct ui_file *stream)
{
int flags = 0;
tui_out_data *data = XMALLOC (tui_out_data);
tui_out_data *data = XNEW (tui_out_data);
/* Initialize base "class". */
cli_out_data_ctor (&data->base, stream);

View File

@ -393,7 +393,7 @@ static int mem_file_magic;
static struct ui_file *
mem_file_new (void)
{
struct mem_file *stream = XMALLOC (struct mem_file);
struct mem_file *stream = XNEW (struct mem_file);
struct ui_file *file = ui_file_new ();
set_ui_file_data (file, stream, mem_file_delete);

View File

@ -131,7 +131,7 @@ push_level (struct ui_out *uiout,
struct ui_out_level *current;
uiout->level++;
current = XMALLOC (struct ui_out_level);
current = XNEW (struct ui_out_level);
current->field_count = 0;
current->type = type;
VEC_safe_push (ui_out_level_p, uiout->levels, current);
@ -443,7 +443,7 @@ make_cleanup_ui_out_end (struct ui_out *uiout,
{
struct ui_out_end_cleanup_data *end_cleanup_data;
end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
end_cleanup_data = XNEW (struct ui_out_end_cleanup_data);
end_cleanup_data->uiout = uiout;
end_cleanup_data->type = type;
return make_cleanup (do_cleanup_end, end_cleanup_data);
@ -964,7 +964,7 @@ append_header_to_list (struct ui_out *uiout,
{
struct ui_out_hdr *temphdr;
temphdr = XMALLOC (struct ui_out_hdr);
temphdr = XNEW (struct ui_out_hdr);
temphdr->width = width;
temphdr->alignment = alignment;
/* We have to copy the column title as the original may be an
@ -1098,8 +1098,8 @@ struct ui_out *
ui_out_new (struct ui_out_impl *impl, void *data,
int flags)
{
struct ui_out *uiout = XMALLOC (struct ui_out);
struct ui_out_level *current = XMALLOC (struct ui_out_level);
struct ui_out *uiout = XNEW (struct ui_out);
struct ui_out_level *current = XNEW (struct ui_out_level);
uiout->data = data;
uiout->impl = impl;

View File

@ -85,7 +85,7 @@ user_reg_add_builtin (const char *name, user_reg_read_ftype *read,
const void *baton)
{
append_user_reg (&builtin_user_regs, name, read, baton,
XMALLOC (struct user_reg));
XNEW (struct user_reg));
}
/* Per-architecture user registers. Start with the builtin user