}
static char *
-stack_push (stack *st, char *element)
+stack_push (stack *st, void *element)
{
if (st->pointer + st->element_size >= st->size)
{
if (S_GET_STORAGE_CLASS (symp) == C_BLOCK)
{
if (streq (S_GET_NAME (symp), ".bb"))
- stack_push (block_stack, (char *) &symp);
+ stack_push (block_stack, &symp);
else
{
symbolS *begin;
static bool
get_section_by_match (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf)
{
- struct elf_section_match *match = (struct elf_section_match *) inf;
+ struct elf_section_match *match = inf;
const char *gname = match->group_name;
const char *group_name = elf_group_name (sec);
old_sec = group_section_find (match_p, name, &group_idx);
else
old_sec = bfd_get_section_by_name_if (stdoutput, name, get_section_by_match,
- (void *) match_p);
+ match_p);
if (old_sec)
{
sec = old_sec;
else if ((symbol->flags & BSF_GLOBAL) && (symbol->flags & BSF_FUNCTION))
{
- struct evax_private_udata_struct *udata
- = (struct evax_private_udata_struct *)symbol->udata.p;
+ struct evax_private_udata_struct *udata = symbol->udata.p;
/* Fix up equates of function definitions. */
while (udata->enbsym == NULL)
{
bfd_mach_o_section *ms = bfd_mach_o_get_mach_o_section (sec);
unsigned bfd_align = bfd_section_alignment (sec);
- obj_mach_o_set_vma_data *p = (struct obj_mach_o_set_vma_data *)v_p;
+ obj_mach_o_set_vma_data *p = v_p;
unsigned sectype = (ms->flags & BFD_MACH_O_SECTION_TYPE_MASK);
unsigned zf;
memset (&d, 0, sizeof (d));
- bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, (char *) &d);
+ bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, &d);
if ((d.vma_pass = d.zerofill_seen) != 0)
- bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, (char *) &d);
+ bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, &d);
if ((d.vma_pass = d.gb_zerofill_seen) != 0)
- bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, (char *) &d);
+ bfd_map_over_sections (stdoutput, obj_mach_o_set_section_vma, &d);
}
static void
obj_mach_o_indirect_sym *isym;
obj_mach_o_indirect_sym *list = NULL;
obj_mach_o_indirect_sym *list_tail = NULL;
- unsigned long eltsiz =
- bfd_mach_o_section_get_entry_size (abfd, ms);
+ unsigned long eltsiz = bfd_mach_o_section_get_entry_size (abfd, ms);
for (isym = indirect_syms; isym != NULL; isym = isym->next)
{
{
int res;
char *ptr;
- struct obstack *stack = (struct obstack *) styler->state;
+ struct obstack *stack = styler->state;
va_list ap;
/* Calculate the required space. */
obstack_init (&content);
styler.apply_style = aarch64_apply_style;
- styler.state = (void *) &content;
+ styler.state = &content;
for (i = 0; i < AARCH64_MAX_OPND_NUM; ++i)
{
static void
arc_opcode_free (void *elt)
{
- string_tuple_t *tuple = (string_tuple_t *) elt;
+ string_tuple_t *tuple = elt;
struct arc_opcode_hash_entry *entry = (void *) tuple->value;
free (entry->opcode);
free (entry);
new_fix = fix_new_exp (frag, where, size, exp, pcrel, r_type);
else
new_fix = fix_new (frag, where, size, add_symbol, offset, pcrel, r_type);
- new_fix->tc_fix_data = (void *) hppa_fix;
+ new_fix->tc_fix_data = hppa_fix;
hppa_fix->fx_r_type = r_type;
hppa_fix->fx_r_field = r_field;
hppa_fix->fx_r_format = r_format;
if (fixp->fx_addsy == 0)
return &no_relocs;
- hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data;
+ hppa_fixp = fixp->tc_fix_data;
gas_assert (hppa_fixp != 0);
gas_assert (section != 0);
fixP->fx_done = 1;
/* There should be a HPPA specific fixup associated with the GAS fixup. */
- hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
+ hppa_fixP = fixP->tc_fix_data;
if (hppa_fixP == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
#endif
struct hppa_fix_struct *hppa_fix;
- hppa_fix = (struct hppa_fix_struct *) fixp->tc_fix_data;
+ hppa_fix = fixp->tc_fix_data;
#ifdef OBJ_ELF
/* LR/RR selectors are implicitly used for a number of different relocation
{
struct hppa_fix_struct *hppa_fixp;
- hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data;
+ hppa_fixp = fixp->tc_fix_data;
#ifdef OBJ_SOM
if (fixp->fx_r_type == (int) R_HPPA_ENTRY
|| fixp->fx_r_type == (int) R_HPPA_EXIT
hppa_fix->fx_r_format = 32;
hppa_fix->fx_arg_reloc = 0;
hppa_fix->segment = now_seg;
- new_fix->tc_fix_data = (void *) hppa_fix;
+ new_fix->tc_fix_data = hppa_fix;
new_fix->fx_r_type = (int) R_PARISC_GNU_VTENTRY;
}
}
hppa_fix->fx_r_format = 32;
hppa_fix->fx_arg_reloc = 0;
hppa_fix->segment = now_seg;
- new_fix->tc_fix_data = (void *) hppa_fix;
+ new_fix->tc_fix_data = hppa_fix;
new_fix->fx_r_type = (int) R_PARISC_GNU_VTINHERIT;
}
}
next_syms = syms->next;
input_line_pointer = (char *) ".\n";
pseudo_set (symbolP);
- free ((char *) syms);
+ free (syms);
}
input_line_pointer = save_input_line;
insn_templates *slot;
entry.template = &template;
+ template.name = mnemonic;
- memcpy ((void *)&entry.template->name, &mnemonic, sizeof (char *));
-
- slot = (insn_templates *) htab_find (mnemonic_htab, &entry);
+ slot = htab_find (mnemonic_htab, &entry);
if (slot)
return slot;
static int
eq_templates (const void *a, const void *b)
{
- insn_templates *ta = (insn_templates *)a;
- insn_templates *tb = (insn_templates *)b;
+ const insn_templates *ta = a;
+ const insn_templates *tb = b;
return strcasecmp (ta->template->name, tb->template->name) == 0;
}
static int
eq_scond (const void *a, const void *b)
{
- split_condition *ra = (split_condition *)a;
- split_condition *rb = (split_condition *)b;
+ const split_condition *ra = a;
+ const split_condition *rb = b;
return strcasecmp (ra->name, rb->name) == 0;
}
static int
cmp_greg_symbol_fixes (const void *parg, const void *qarg)
{
- const struct mmix_symbol_greg_fixes *p
- = (const struct mmix_symbol_greg_fixes *) parg;
- const struct mmix_symbol_greg_fixes *q
- = (const struct mmix_symbol_greg_fixes *) qarg;
+ const struct mmix_symbol_greg_fixes *p = parg;
+ const struct mmix_symbol_greg_fixes *q = qarg;
return p->offs > q->offs ? 1 : p->offs < q->offs ? -1 : 0;
}
{
/* Store current $x+arch into tc_segment_info. */
seg_info (now_seg)->tc_segment_info_data.arch_map_symbol = symbol;
- xfree ((void *) buff);
+ xfree (buff);
}
/* If .fill or other data filling directive generates zero sized data,
exp_dup->X_add_number = 0; /* Set addend of SUB_ULEB128 to zero. */
fix_new_exp (fragP, fragP->fr_fix, 0,
exp_dup, 0, BFD_RELOC_RISCV_SUB_ULEB128);
- free ((void *) exp_dup);
+ free (exp_dup);
}
}
static void
s3_number_to_chars_littleendian (void *p, valueT data, int n)
{
- char *buf = (char *) p;
+ char *buf = p;
switch (n)
{
static void
sh_count_relocs (bfd *abfd ATTRIBUTE_UNUSED, segT sec, void *data)
{
- struct sh_count_relocs *info = (struct sh_count_relocs *) data;
+ struct sh_count_relocs *info = data;
segment_info_type *seginfo;
symbolS *sym;
fixS *fix;
static int
cmp_reg_entry (const void *parg, const void *qarg)
{
- const struct priv_reg_entry *p = (const struct priv_reg_entry *) parg;
- const struct priv_reg_entry *q = (const struct priv_reg_entry *) qarg;
+ const struct priv_reg_entry *p = parg;
+ const struct priv_reg_entry *q = qarg;
if (p->name == q->name)
return 0;
static int
cmp_perc_entry (const void *parg, const void *qarg)
{
- const struct perc_entry *p = (const struct perc_entry *) parg;
- const struct perc_entry *q = (const struct perc_entry *) qarg;
+ const struct perc_entry *p = parg;
+ const struct perc_entry *q = qarg;
if (p->name == q->name)
return 0;
static void
free_subsym_ent (void *ent)
{
- string_tuple_t *tuple = (string_tuple_t *) ent;
+ string_tuple_t *tuple = ent;
subsym_ent_t *val = (void *) tuple->value;
if (val->freekey)
free ((void *) tuple->key);
static void
free_local_label_ent (void *ent)
{
- string_tuple_t *tuple = (string_tuple_t *) ent;
+ string_tuple_t *tuple = ent;
free ((void *) tuple->key);
free ((void *) tuple->value);
free (ent);
/* Write to a temporary file, then use s_include to include it
a bit of a hack. */
ftmp = fopen (fname, "w+b");
- fwrite ((void *) buf, size, 1, ftmp);
+ fwrite (buf, size, 1, ftmp);
if (size == 0 || buf[size - 1] != '\n')
fwrite ("\n", 1, 1, ftmp);
fclose (ftmp);
&& ((struct v850_operand *) fixP->tc_fix_data)->insert != NULL)
{
const char * message = NULL;
- struct v850_operand * operand = (struct v850_operand *) fixP->tc_fix_data;
+ struct v850_operand * operand = fixP->tc_fix_data;
unsigned long insn;
/* The variable "where" currently points at the exact point inside
LITTLENUM_TYPE *p; /* -> most significant (non-zero) input
littlenum. */
- memcpy ((void *) out, (void *) in,
- (unsigned int) out_length << LITTLENUM_SHIFT);
+ memcpy (out, in, (unsigned int) out_length << LITTLENUM_SHIFT);
for (p = in + in_length - 1; p >= in; --p)
{
if (*p)
}
else
{
- memcpy ((char *) out, (char *) in,
- (unsigned int) in_length << LITTLENUM_SHIFT);
+ memcpy (out, in, (unsigned int) in_length << LITTLENUM_SHIFT);
if (out_length > in_length)
- memset ((char *) (out + in_length), '\0',
+ memset (out + in_length, 0,
(unsigned int) (out_length - in_length) << LITTLENUM_SHIFT);
significant_littlenums_dropped = 0;
and wasting time, so why bother??? */
if (in_length < out_length)
{
- memset ((char *) (out->low + in_length + 1), '\0',
- out_length - in_length);
+ memset (out->low + in_length + 1, 0, out_length - in_length);
}
}
- memcpy ((void *) (out->low), (void *) (in->low),
- ((in_length + 1) * sizeof (LITTLENUM_TYPE)));
+ memcpy (out->low, in->low,
+ (in_length + 1) * sizeof (LITTLENUM_TYPE));
out->exponent = in->exponent;
out->leader = in->leader - in->low + out->low;
}
shorten = in_length - out_length;
/* Assume out_length >= 0 ! */
- memcpy ((void *) (out->low), (void *) (in->low + shorten),
- ((out_length + 1) * sizeof (LITTLENUM_TYPE)));
+ memcpy (out->low, in->low + shorten,
+ (out_length + 1) * sizeof (LITTLENUM_TYPE));
out->leader = out->high;
out->exponent = in->exponent + shorten;
}
static int
eq_symbol_entry (const void *a, const void *b)
{
- const symbol_entry_t *ea = (const symbol_entry_t *) a;
- const symbol_entry_t *eb = (const symbol_entry_t *) b;
+ const symbol_entry_t *ea = a;
+ const symbol_entry_t *eb = b;
return (ea->sy.hash == eb->sy.hash
&& strcmp (ea->sy.name, eb->sy.name) == 0);
static symbolS *
local_symbol_convert (void *sym)
{
- symbol_entry_t *ent = (symbol_entry_t *) sym;
+ symbol_entry_t *ent = sym;
struct xsymbol *xtra;
valueT val;
static void
fb_label_init (void)
{
- memset ((void *) fb_low_counter, '\0', sizeof (fb_low_counter));
+ memset (fb_low_counter, 0, sizeof (fb_low_counter));
}
/* Add one to the instance number of this fb label. */
static void
renumber_sections (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *countparg)
{
- int *countp = (int *) countparg;
+ int *countp = countparg;
sec->index = *countp;
++*countp;
relax_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx)
{
segment_info_type *seginfo = seg_info (sec);
- struct relax_seg_info *info = (struct relax_seg_info *) xxx;
+ struct relax_seg_info *info = xxx;
if (seginfo && seginfo->frchainP
&& relax_segment (seginfo->frchainP->frch_root, sec, info->pass))