/* Setup for loop. */
optab = i386_optab;
- core_optab = (templates *) xmalloc (sizeof (templates));
+ core_optab = XNEW (templates);
core_optab->start = optab;
while (1)
}
if (optab->name == NULL)
break;
- core_optab = (templates *) xmalloc (sizeof (templates));
+ core_optab = XNEW (templates);
core_optab->start = optab;
}
}
/* Allocate and copy string. The trailing NUL shouldn't
be necessary, but be safe. */
- tmpbuf = (char *) xmalloc (first + second + 2);
+ tmpbuf = XNEWVEC (char, first + second + 2);
memcpy (tmpbuf, input_line_pointer, first);
if (second != 0 && *past_reloc != ' ')
/* Replace the relocation token with ' ', so that
/* Allocate and copy string. The trailing NUL shouldn't
be necessary, but be safe. */
- tmpbuf = (char *) xmalloc (first + second + 2);
+ tmpbuf = XNEWVEC (char, first + second + 2);
memcpy (tmpbuf, input_line_pointer, first);
if (second != 0 && *past_reloc != ' ')
/* Replace the relocation token with ' ', so that
char *n, *t;
const char *s;
- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
+ n = XNEWVEC (char, strlen (i386_comment_chars) + 1);
t = n;
for (s = i386_comment_chars; *s != '\0'; s++)
if (*s != '/')
code = BFD_RELOC_X86_64_GOTPC64;
}
- rel = (arelent *) xmalloc (sizeof (arelent));
- rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ rel = XNEW (arelent);
+ rel->sym_ptr_ptr = XNEW (asymbol *);
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;