From fc270c357a3301fec8cc161199242bb934203cf6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 28 Dec 2013 15:32:27 -0700 Subject: replace XCALLOC with XCNEWVEC or XCNEW This removes XCALLOC and replaces it either with XCNEWVEC, or, if the number of elements being requested was 1, with XCNEW. 2014-01-13 Tom Tromey * defs.h (XCALLOC): Remove. * bcache.c (bcache_xmalloc): Use XCNEW, not XCALLOC. (print_bcache_statistics): Use XCNEWVEC, not XCALLOC. * dwarf2loc.c (allocate_piece_closure): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_symfile_segments): Likewise. * gdbtypes.c (copy_type_recursive): Likewise. * i386-tdep.c (i386_gdbarch_init): Use XCNEW, not XCALLOC. * jit.c (jit_frame_sniffer): Use XCNEWVEC, not XCALLOC. * minsyms.c (prim_record_minimal_symbol_full): Use XCNEW, not XCALLOC. * mt-tdep.c (mt_gdbarch_init): Likewise. * opencl-lang.c (allocate_lval_closure): Use XCNEWVEC, not XCALLOC. * psymtab.c (psymbol_compare): Use XCNEW, not XCALLOC. * regcache.c (regcache_xmalloc_1): Use XCNEWVEC, not XCALLOC. * registry.c (registry_alloc_data): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Use XCNEW, not XCALLOC. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * serial.c (serial_fdopen_ops): Likewise. * solib-aix.c (solib_aix_get_section_offsets): Use XCNEWVEC, not XCALLOC. * spu-tdep.c (spu_gdbarch_init): Use XCNEW, not XCALLOC. * symfile.c (default_symfile_segments): Use XCNEW and XCNEWVEC, not XCALLOC. --- gdb/defs.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'gdb/defs.h') diff --git a/gdb/defs.h b/gdb/defs.h index a4770ef..a7ce88a 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -553,11 +553,6 @@ enum val_prettyformat 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 XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE))) - #include "common-utils.h" /* List of known OS ABIs. If you change this, make sure to update the -- cgit v1.1