diff options
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r-- | gas/dwarf2dbg.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index c719a5a..27b2646 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -253,7 +253,7 @@ get_line_subseg (segT seg, subsegT subseg, bfd_boolean create_p) if (!create_p) return NULL; - s = (struct line_seg *) xmalloc (sizeof (*s)); + s = XNEW (struct line_seg); s->next = NULL; s->seg = seg; s->head = NULL; @@ -271,7 +271,7 @@ get_line_subseg (segT seg, subsegT subseg, bfd_boolean create_p) break; } - lss = (struct line_subseg *) xmalloc (sizeof (*lss)); + lss = XNEW (struct line_subseg); lss->next = *pss; lss->subseg = subseg; lss->head = NULL; @@ -291,7 +291,7 @@ dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc) struct line_subseg *lss; struct line_entry *e; - e = (struct line_entry *) xmalloc (sizeof (*e)); + e = XNEW (struct line_entry); e->next = NULL; e->label = label; e->loc = *loc; @@ -512,8 +512,7 @@ get_filenum (const char *filename, unsigned int num) if (dir >= dirs_allocated) { dirs_allocated = dir + 32; - dirs = (char **) - xrealloc (dirs, (dir + 32) * sizeof (const char *)); + dirs = XRESIZEVEC (char *, dirs, dirs_allocated); } dirs[dir] = (char *) xmalloc (dir_len + 1); @@ -543,8 +542,7 @@ get_filenum (const char *filename, unsigned int num) unsigned int old = files_allocated; files_allocated = i + 32; - files = (struct file_entry *) - xrealloc (files, (i + 32) * sizeof (struct file_entry)); + files = XRESIZEVEC (struct file_entry, files, files_allocated); memset (files + old, 0, (i + 32 - old) * sizeof (struct file_entry)); } |