aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-d10v.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-d10v.c')
-rw-r--r--gas/config/tc-d10v.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
index dd0292a..98d5e8b 100644
--- a/gas/config/tc-d10v.c
+++ b/gas/config/tc-d10v.c
@@ -275,7 +275,7 @@ void
md_begin (void)
{
const char *prev_name = "";
- struct d10v_opcode *opcode;
+ const struct d10v_opcode *opcode;
d10v_hash = str_htab_create ();
/* Insert unique names into hash table. The D10v instruction set
@@ -283,11 +283,11 @@ md_begin (void)
on the operands. This hash table then provides a quick index to
the first opcode with a particular name in the opcode table. */
- for (opcode = (struct d10v_opcode *) d10v_opcodes; opcode->name; opcode++)
+ for (opcode = d10v_opcodes; opcode->name; opcode++)
{
if (strcmp (prev_name, opcode->name))
{
- prev_name = (char *) opcode->name;
+ prev_name = opcode->name;
str_hash_insert (d10v_hash, opcode->name, opcode, 0);
}
}
@@ -325,7 +325,7 @@ postfix (char *p)
}
static bfd_reloc_code_real_type
-get_reloc (struct d10v_operand *op)
+get_reloc (const struct d10v_operand *op)
{
int bits = op->bits;
@@ -564,7 +564,7 @@ build_insn (struct d10v_opcode *opcode,
else
{
fixups->fix[fixups->fc].reloc =
- get_reloc ((struct d10v_operand *) &d10v_operands[opcode->operands[i]]);
+ get_reloc (&d10v_operands[opcode->operands[i]]);
/* Check that an immediate was passed to ops that expect one. */
if ((flags & OPERAND_NUM)
@@ -1428,7 +1428,7 @@ do_assemble (char *str, struct d10v_opcode **opcode)
return -1;
/* Find the first opcode with the proper name. */
- *opcode = (struct d10v_opcode *) str_hash_find (d10v_hash, name);
+ *opcode = str_hash_find (d10v_hash, name);
if (*opcode == NULL)
return -1;
@@ -1454,7 +1454,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
@@ -1481,7 +1481,7 @@ md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED,
long
md_pcrel_from_section (fixS *fixp, segT sec)
{
- if (fixp->fx_addsy != (symbolS *) NULL
+ if (fixp->fx_addsy != NULL
&& (!S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
return 0;
@@ -1497,11 +1497,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
int op_type;
int left = 0;
- if (fixP->fx_addsy == (symbolS *) NULL)
+ if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
/* We don't actually support subtracting a symbol. */
- if (fixP->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != NULL)
as_bad_subtract (fixP);
op_type = fixP->fx_r_type;
@@ -1521,13 +1521,13 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
}
else
fixP->fx_r_type =
- get_reloc ((struct d10v_operand *) &d10v_operands[op_type]);
+ get_reloc (&d10v_operands[op_type]);
}
/* Fetch the instruction, insert the fully resolved operand
value, and stuff the instruction back again. */
where = fixP->fx_frag->fr_literal + fixP->fx_where;
- insn = bfd_getb32 ((unsigned char *) where);
+ insn = bfd_getb32 (where);
switch (fixP->fx_r_type)
{
@@ -1551,13 +1551,13 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
/* Instruction addresses are always right-shifted by 2. */
value >>= AT_WORD_RIGHT_SHIFT;
if (fixP->fx_size == 2)
- bfd_putb16 ((bfd_vma) value, (unsigned char *) where);
+ bfd_putb16 (value, where);
else
{
struct d10v_opcode *rep, *repi;
- rep = (struct d10v_opcode *) str_hash_find (d10v_hash, "rep");
- repi = (struct d10v_opcode *) str_hash_find (d10v_hash, "repi");
+ rep = str_hash_find (d10v_hash, "rep");
+ repi = str_hash_find (d10v_hash, "repi");
if ((insn & FM11) == FM11
&& ((repi != NULL
&& (insn & repi->mask) == (unsigned) repi->opcode)
@@ -1569,14 +1569,14 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
fixP->fx_line);
insn =
d10v_insert_operand (insn, op_type, (offsetT) value, left, fixP);
- bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
+ bfd_putb32 (insn, where);
}
break;
case BFD_RELOC_32:
- bfd_putb32 ((bfd_vma) value, (unsigned char *) where);
+ bfd_putb32 (value, where);
break;
case BFD_RELOC_16:
- bfd_putb16 ((bfd_vma) value, (unsigned char *) where);
+ bfd_putb16 (value, where);
break;
case BFD_RELOC_8:
*where = value;