]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
str_hash_find casts
authorAlan Modra <amodra@gmail.com>
Mon, 9 Jun 2025 03:16:23 +0000 (12:46 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 9 Jun 2025 03:16:23 +0000 (12:46 +0930)
Putting an explicit cast on the void* return from str_hash_find isn't
necessary and doesn't add much to code clarity.  In other cases, poor
choice of function parameter types, eg. "void *value" in
tc-aarch64.c checked_hash_insert rather than "const void *value" leads
to needing (void *) casts all over the place just to cast away const.
Fix that by correcting the parameter type.  (And it really is a const,
the function and str_hash_insert don't modify the strings.)
This patch also removes some unnecessary casts in hash.c

53 files changed:
gas/config/obj-coff-seh.c
gas/config/obj-coff.c
gas/config/tc-aarch64.c
gas/config/tc-alpha.c
gas/config/tc-arm.c
gas/config/tc-avr.c
gas/config/tc-cr16.c
gas/config/tc-cris.c
gas/config/tc-crx.c
gas/config/tc-csky.c
gas/config/tc-d10v.c
gas/config/tc-d30v.c
gas/config/tc-dlx.c
gas/config/tc-ft32.c
gas/config/tc-h8300.c
gas/config/tc-hppa.c
gas/config/tc-i386.c
gas/config/tc-ia64.c
gas/config/tc-kvx.c
gas/config/tc-loongarch.c
gas/config/tc-m68hc11.c
gas/config/tc-m68k.c
gas/config/tc-mcore.c
gas/config/tc-microblaze.c
gas/config/tc-mips.c
gas/config/tc-mmix.c
gas/config/tc-mn10200.c
gas/config/tc-mn10300.c
gas/config/tc-moxie.c
gas/config/tc-msp430.c
gas/config/tc-ns32k.c
gas/config/tc-pdp11.c
gas/config/tc-pj.c
gas/config/tc-ppc.c
gas/config/tc-pru.c
gas/config/tc-riscv.c
gas/config/tc-s390.c
gas/config/tc-score.c
gas/config/tc-score7.c
gas/config/tc-sh.c
gas/config/tc-sparc.c
gas/config/tc-spu.c
gas/config/tc-tic30.c
gas/config/tc-tic4x.c
gas/config/tc-tic54x.c
gas/config/tc-v850.c
gas/config/tc-vax.c
gas/config/tc-wasm32.c
gas/config/tc-xgate.c
gas/config/tc-z8k.c
gas/ecoff.c
gas/ginsn.c
gas/hash.c

index 70cb4e4aa640e0d4cea9f5d0d469acca9aa57c0f..becf7a969f2c9c256fd2b2b030571af8dcec3df9 100644 (file)
@@ -121,7 +121,7 @@ seh_hash_insert (const char *name, struct seh_seg_list *item)
 static struct seh_seg_list *
 seh_hash_find (char *name)
 {
-  return (struct seh_seg_list *) str_hash_find (seh_hash, name);
+  return str_hash_find (seh_hash, name);
 }
 
 static struct seh_seg_list *
index 2c95ba9038f32718abff1bee77544e8e3e4b30e6..1f9eaa33c93a2d2e0469e167b0bc52aebca1d057 100644 (file)
@@ -133,7 +133,7 @@ tag_insert (const char *name, symbolS *symbolP)
 static symbolS *
 tag_find (char *name)
 {
-  return (symbolS *) str_hash_find (tag_hash, name);
+  return str_hash_find (tag_hash, name);
 }
 
 static symbolS *
index 398b7d618c7919803a8d92676ef61e206ae880b5..98254eb87edb46957f98129957beb748767e1387 100644 (file)
@@ -907,7 +907,7 @@ parse_reg (char **ccp)
     p++;
   while (ISALPHA (*p) || ISDIGIT (*p) || *p == '_');
 
-  reg = (reg_entry *) str_hash_find_n (aarch64_reg_hsh, start, p - start);
+  reg = str_hash_find_n (aarch64_reg_hsh, start, p - start);
 
   if (!reg)
     return NULL;
@@ -6254,10 +6254,7 @@ typedef struct templates templates;
 static templates *
 lookup_mnemonic (const char *start, int len)
 {
-  templates *templ = NULL;
-
-  templ = str_hash_find_n (aarch64_ops_hsh, start, len);
-  return templ;
+  return str_hash_find_n (aarch64_ops_hsh, start, len);
 }
 
 /* Subroutine of md_assemble, responsible for looking up the primary
@@ -10241,13 +10238,13 @@ aarch64_adjust_symtab (void)
 }
 
 static void
-checked_hash_insert (htab_t table, const char *key, void *value)
+checked_hash_insert (htab_t table, const char *key, const void *value)
 {
   str_hash_insert (table, key, value, 0);
 }
 
 static void
-sysreg_hash_insert (htab_t table, const char *key, void *value)
+sysreg_hash_insert (htab_t table, const char *key, const void *value)
 {
   gas_assert (strlen (key) < AARCH64_MAX_SYSREG_NAME_LEN);
   checked_hash_insert (table, key, value);
@@ -10268,7 +10265,7 @@ fill_instruction_hash_table (void)
       new_templ->next = NULL;
 
       if (!templ)
-       checked_hash_insert (aarch64_ops_hsh, opcode->name, (void *) new_templ);
+       checked_hash_insert (aarch64_ops_hsh, opcode->name, new_templ);
       else
        {
          new_templ->next = templ->next;
@@ -10327,54 +10324,54 @@ md_begin (void)
 
   for (i = 0; aarch64_sys_regs[i].name != NULL; ++i)
     sysreg_hash_insert (aarch64_sys_regs_hsh, aarch64_sys_regs[i].name,
-                        (void *) (aarch64_sys_regs + i));
+                       aarch64_sys_regs + i);
 
   for (i = 0; aarch64_pstatefields[i].name != NULL; ++i)
     sysreg_hash_insert (aarch64_pstatefield_hsh,
-                        aarch64_pstatefields[i].name,
-                        (void *) (aarch64_pstatefields + i));
+                       aarch64_pstatefields[i].name,
+                       aarch64_pstatefields + i);
 
   for (i = 0; aarch64_sys_regs_ic[i].name != NULL; i++)
     sysreg_hash_insert (aarch64_sys_regs_ic_hsh,
-                        aarch64_sys_regs_ic[i].name,
-                        (void *) (aarch64_sys_regs_ic + i));
+                       aarch64_sys_regs_ic[i].name,
+                       aarch64_sys_regs_ic + i);
 
   for (i = 0; aarch64_sys_regs_dc[i].name != NULL; i++)
     sysreg_hash_insert (aarch64_sys_regs_dc_hsh,
-                        aarch64_sys_regs_dc[i].name,
-                        (void *) (aarch64_sys_regs_dc + i));
+                       aarch64_sys_regs_dc[i].name,
+                       aarch64_sys_regs_dc + i);
 
   for (i = 0; aarch64_sys_regs_at[i].name != NULL; i++)
     sysreg_hash_insert (aarch64_sys_regs_at_hsh,
-                        aarch64_sys_regs_at[i].name,
-                        (void *) (aarch64_sys_regs_at + i));
+                       aarch64_sys_regs_at[i].name,
+                       aarch64_sys_regs_at + i);
 
   for (i = 0; aarch64_sys_regs_tlbi[i].name != NULL; i++)
     sysreg_hash_insert (aarch64_sys_regs_tlbi_hsh,
-                        aarch64_sys_regs_tlbi[i].name,
-                        (void *) (aarch64_sys_regs_tlbi + i));
+                       aarch64_sys_regs_tlbi[i].name,
+                       aarch64_sys_regs_tlbi + i);
 
   for (i = 0; aarch64_sys_regs_sr[i].name != NULL; i++)
     sysreg_hash_insert (aarch64_sys_regs_sr_hsh,
-                        aarch64_sys_regs_sr[i].name,
-                        (void *) (aarch64_sys_regs_sr + i));
+                       aarch64_sys_regs_sr[i].name,
+                       aarch64_sys_regs_sr + i);
 
   for (i = 0; i < ARRAY_SIZE (reg_names); i++)
     checked_hash_insert (aarch64_reg_hsh, reg_names[i].name,
-                        (void *) (reg_names + i));
+                        reg_names + i);
 
   for (i = 0; i < ARRAY_SIZE (nzcv_names); i++)
     checked_hash_insert (aarch64_nzcv_hsh, nzcv_names[i].template,
-                        (void *) (nzcv_names + i));
+                        nzcv_names + i);
 
   for (i = 0; aarch64_operand_modifiers[i].name != NULL; i++)
     {
       const char *name = aarch64_operand_modifiers[i].name;
       checked_hash_insert (aarch64_shift_hsh, name,
-                          (void *) (aarch64_operand_modifiers + i));
+                          aarch64_operand_modifiers + i);
       /* Also hash the name in the upper case.  */
       checked_hash_insert (aarch64_shift_hsh, get_upper_str (name),
-                          (void *) (aarch64_operand_modifiers + i));
+                          aarch64_operand_modifiers + i);
     }
 
   for (i = 0; i < ARRAY_SIZE (aarch64_conds); i++)
@@ -10388,10 +10385,10 @@ md_begin (void)
          if (name == NULL)
            break;
          checked_hash_insert (aarch64_cond_hsh, name,
-                              (void *) (aarch64_conds + i));
+                              aarch64_conds + i);
          /* Also hash the name in the upper case.  */
          checked_hash_insert (aarch64_cond_hsh, get_upper_str (name),
-                              (void *) (aarch64_conds + i));
+                              aarch64_conds + i);
        }
     }
 
@@ -10402,20 +10399,20 @@ md_begin (void)
       if ((i & 0x3) == 0)
        continue;
       checked_hash_insert (aarch64_barrier_opt_hsh, name,
-                          (void *) (aarch64_barrier_options + i));
+                          aarch64_barrier_options + i);
       /* Also hash the name in the upper case.  */
       checked_hash_insert (aarch64_barrier_opt_hsh, get_upper_str (name),
-                          (void *) (aarch64_barrier_options + i));
+                          aarch64_barrier_options + i);
     }
 
   for (i = 0; i < ARRAY_SIZE (aarch64_barrier_dsb_nxs_options); i++)
     {
       const char *name = aarch64_barrier_dsb_nxs_options[i].name;
       checked_hash_insert (aarch64_barrier_opt_hsh, name,
-                          (void *) (aarch64_barrier_dsb_nxs_options + i));
+                          aarch64_barrier_dsb_nxs_options + i);
       /* Also hash the name in the upper case.  */
       checked_hash_insert (aarch64_barrier_opt_hsh, get_upper_str (name),
-                          (void *) (aarch64_barrier_dsb_nxs_options + i));
+                          aarch64_barrier_dsb_nxs_options + i);
     }
 
   for (i = 0; i < ARRAY_SIZE (aarch64_prfops); i++)
@@ -10425,10 +10422,10 @@ md_begin (void)
       if (name == NULL)
        continue;
       checked_hash_insert (aarch64_pldop_hsh, name,
-                          (void *) (aarch64_prfops + i));
+                          aarch64_prfops + i);
       /* Also hash the name in the upper case.  */
       checked_hash_insert (aarch64_pldop_hsh, get_upper_str (name),
-                          (void *) (aarch64_prfops + i));
+                          aarch64_prfops + i);
     }
 
   for (i = 0; aarch64_hint_options[i].name != NULL; i++)
@@ -10437,12 +10434,12 @@ md_begin (void)
       const char* upper_name = get_upper_str(name);
 
       checked_hash_insert (aarch64_hint_opt_hsh, name,
-                          (void *) (aarch64_hint_options + i));
+                          aarch64_hint_options + i);
 
       /* Also hash the name in the upper case if not the same.  */
       if (strcmp (name, upper_name) != 0)
        checked_hash_insert (aarch64_hint_opt_hsh, upper_name,
-                            (void *) (aarch64_hint_options + i));
+                            aarch64_hint_options + i);
     }
 
   /* Set the cpu variant based on the command-line options.  */
index 6232130b1293e8af780595e3ffe8b86ccace0536..9adfe1deacb32e9061cc0b400fa6eac1365aec96 100644 (file)
@@ -589,7 +589,7 @@ get_alpha_reloc_tag (long sequence)
 
   sprintf (buffer, "!%ld", sequence);
 
-  info = (struct alpha_reloc_tag *) str_hash_find (alpha_literal_hash, buffer);
+  info = str_hash_find (alpha_literal_hash, buffer);
   if (! info)
     {
       size_t len = strlen (buffer);
@@ -1170,8 +1170,7 @@ assemble_tokens_to_insn (const char *opname,
   const struct alpha_opcode *opcode;
 
   /* Search opcodes.  */
-  opcode = (const struct alpha_opcode *) str_hash_find (alpha_opcode_hash,
-                                                       opname);
+  opcode = str_hash_find (alpha_opcode_hash, opname);
   if (opcode)
     {
       int cpumatch;
@@ -3318,8 +3317,7 @@ assemble_tokens (const char *opname,
 #endif
   if (local_macros_on)
     {
-      macro = (const struct alpha_macro *) str_hash_find (alpha_macro_hash,
-                                                         opname);
+      macro = str_hash_find (alpha_macro_hash, opname);
       if (macro)
        {
          found_something = 1;
@@ -3333,8 +3331,7 @@ assemble_tokens (const char *opname,
     }
 
   /* Search opcodes.  */
-  opcode = (const struct alpha_opcode *) str_hash_find (alpha_opcode_hash,
-                                                       opname);
+  opcode = str_hash_find (alpha_opcode_hash, opname);
   if (opcode)
     {
       found_something = 1;
index 44020e3140b6acf55ad6bf265079a4a0e7416c78..6bf7eb1d8cec2bfe70157dd8fad5797a07eb1d44 100644 (file)
@@ -1377,7 +1377,7 @@ arm_reg_parse_multi (char **ccp)
     p++;
   while (ISALPHA (*p) || ISDIGIT (*p) || *p == '_');
 
-  reg = (struct reg_entry *) str_hash_find_n (arm_reg_hsh, start, p - start);
+  reg = str_hash_find_n (arm_reg_hsh, start, p - start);
 
   if (!reg)
     return NULL;
@@ -2505,8 +2505,7 @@ parse_reloc (char **str)
   if (*q != ')')
     return -1;
 
-  if ((r = (struct reloc_entry *)
-       str_hash_find_n (arm_reloc_hsh, p, q - p)) == NULL)
+  if ((r = str_hash_find_n (arm_reloc_hsh, p, q - p)) == NULL)
     return -1;
 
   *str = q + 1;
@@ -2521,7 +2520,7 @@ insert_reg_alias (char *str, unsigned number, int type)
   struct reg_entry *new_reg;
   const char *name;
 
-  if ((new_reg = (struct reg_entry *) str_hash_find (arm_reg_hsh, str)) != 0)
+  if ((new_reg = str_hash_find (arm_reg_hsh, str)) != 0)
     {
       if (new_reg->builtin)
        as_warn (_("ignoring attempt to redefine built-in register '%s'"), str);
@@ -2591,7 +2590,7 @@ create_register_alias (char * newname, char *p)
   if (*oldname == '\0')
     return false;
 
-  old = (struct reg_entry *) str_hash_find (arm_reg_hsh, oldname);
+  old = str_hash_find (arm_reg_hsh, oldname);
   if (!old)
     {
       as_warn (_("unknown register '%s' -- .req ignored"), oldname);
@@ -2838,8 +2837,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
     as_bad (_("invalid syntax for .unreq directive"));
   else
     {
-      struct reg_entry *reg
-       = (struct reg_entry *) str_hash_find (arm_reg_hsh, name);
+      struct reg_entry *reg = str_hash_find (arm_reg_hsh, name);
 
       if (!reg)
        as_bad (_("unknown register alias '%s'"), name);
@@ -2863,7 +2861,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
          nbuf = strdup (name);
          for (p = nbuf; *p; p++)
            *p = TOUPPER (*p);
-         reg = (struct reg_entry *) str_hash_find (arm_reg_hsh, nbuf);
+         reg = str_hash_find (arm_reg_hsh, nbuf);
          if (reg)
            {
              str_hash_delete (arm_reg_hsh, nbuf);
@@ -2874,7 +2872,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
 
          for (p = nbuf; *p; p++)
            *p = TOLOWER (*p);
-         reg = (struct reg_entry *) str_hash_find (arm_reg_hsh, nbuf);
+         reg = str_hash_find (arm_reg_hsh, nbuf);
          if (reg)
            {
              str_hash_delete (arm_reg_hsh, nbuf);
@@ -5450,9 +5448,7 @@ parse_shift (char **str, int i, enum parse_shift_mode mode)
       return FAIL;
     }
 
-  shift_name
-    = (const struct asm_shift_name *) str_hash_find_n (arm_shift_hsh, *str,
-                                                      p - *str);
+  shift_name = str_hash_find_n (arm_shift_hsh, *str, p - *str);
 
   if (shift_name == NULL)
     {
@@ -6260,8 +6256,7 @@ parse_psr (char **str, bool lhs)
          || strncasecmp (start, "psr", 3) == 0)
        p = start + strcspn (start, "rR") + 1;
 
-      psr = (const struct asm_psr *) str_hash_find_n (arm_v7m_psr_hsh, start,
-                                                     p - start);
+      psr = str_hash_find_n (arm_v7m_psr_hsh, start, p - start);
 
       if (!psr)
        return FAIL;
@@ -6363,8 +6358,7 @@ parse_psr (char **str, bool lhs)
        }
       else
        {
-         psr = (const struct asm_psr *) str_hash_find_n (arm_psr_hsh, start,
-                                                         p - start);
+         psr = str_hash_find_n (arm_psr_hsh, start, p - start);
          if (!psr)
            goto error;
 
@@ -6561,7 +6555,7 @@ parse_cond (char **str)
       n++;
     }
 
-  c = (const struct asm_cond *) str_hash_find_n (arm_cond_hsh, cond, n);
+  c = str_hash_find_n (arm_cond_hsh, cond, n);
   if (!c)
     {
       inst.error = _("condition required");
@@ -6584,8 +6578,7 @@ parse_barrier (char **str)
   while (ISALPHA (*q))
     q++;
 
-  o = (const struct asm_barrier_opt *) str_hash_find_n (arm_barrier_opt_hsh, p,
-                                                       q - p);
+  o = str_hash_find_n (arm_barrier_opt_hsh, p, q - p);
   if (!o)
     return FAIL;
 
@@ -15431,7 +15424,7 @@ do_vfp_nsyn_opcode (const char *opname)
 {
   const struct asm_opcode *opcode;
 
-  opcode = (const struct asm_opcode *) str_hash_find (arm_ops_hsh, opname);
+  opcode = str_hash_find (arm_ops_hsh, opname);
 
   if (!opcode)
     abort ();
@@ -22485,8 +22478,7 @@ opcode_lookup (char **str)
     *str = end;
 
   /* Look for unaffixed or special-case affixed mnemonic.  */
-  opcode = (const struct asm_opcode *) str_hash_find_n (arm_ops_hsh, base,
-                                                       end - base);
+  opcode = str_hash_find_n (arm_ops_hsh, base, end - base);
   cond = NULL;
   if (opcode)
     {
@@ -22500,7 +22492,7 @@ opcode_lookup (char **str)
       if (warn_on_deprecated && unified_syntax)
        as_tsktsk (_("conditional infixes are deprecated in unified syntax"));
       affix = base + (opcode->tag - OT_odd_infix_0);
-      cond = (const struct asm_cond *) str_hash_find_n (arm_cond_hsh, affix, 2);
+      cond = str_hash_find_n (arm_cond_hsh, affix, 2);
       gas_assert (cond);
 
       inst.cond = cond->value;
@@ -22513,9 +22505,8 @@ opcode_lookup (char **str)
     if (end - base < 2)
       return NULL;
      affix = end - 1;
-     cond = (const struct asm_cond *) str_hash_find_n (arm_vcond_hsh, affix, 1);
-     opcode = (const struct asm_opcode *) str_hash_find_n (arm_ops_hsh, base,
-                                                          affix - base);
+     cond = str_hash_find_n (arm_vcond_hsh, affix, 1);
+     opcode = str_hash_find_n (arm_ops_hsh, base, affix - base);
 
      /* A known edge case is a conflict between an 'e' as a suffix for an
        Else of a VPT predication block and an 'ne' suffix for an IT block.
@@ -22547,9 +22538,8 @@ opcode_lookup (char **str)
 
       /* Look for suffixed mnemonic.  */
       affix = end - 2;
-      cond = (const struct asm_cond *) str_hash_find_n (arm_cond_hsh, affix, 2);
-      opcode = (const struct asm_opcode *) str_hash_find_n (arm_ops_hsh, base,
-                                                           affix - base);
+      cond = str_hash_find_n (arm_cond_hsh, affix, 2);
+      opcode = str_hash_find_n (arm_ops_hsh, base, affix - base);
     }
 
   if (opcode && cond)
@@ -22598,14 +22588,13 @@ opcode_lookup (char **str)
 
   /* Look for infixed mnemonic in the usual position.  */
   affix = base + 3;
-  cond = (const struct asm_cond *) str_hash_find_n (arm_cond_hsh, affix, 2);
+  cond = str_hash_find_n (arm_cond_hsh, affix, 2);
   if (!cond)
     return NULL;
 
   memcpy (save, affix, 2);
   memmove (affix, affix + 2, (end - affix) - 2);
-  opcode = (const struct asm_opcode *) str_hash_find_n (arm_ops_hsh, base,
-                                                       (end - base) - 2);
+  opcode = str_hash_find_n (arm_ops_hsh, base, (end - base) - 2);
   memmove (affix + 2, affix, (end - affix) - 2);
   memcpy (affix, save, 2);
 
index 9d53e715c19d89647814341ad9f1cf61ad312843..650b736bfd4512f684a52521b478ce08cc15f940 100644 (file)
@@ -844,8 +844,7 @@ md_begin (void)
       str_hash_insert_int (avr_no_sreg_hash, avr_no_sreg[i], 0 /* dummy */, 0);
     }
 
-  avr_gccisr_opcode = (struct avr_opcodes_s*) str_hash_find (avr_hash,
-                                                            "__gcc_isr");
+  avr_gccisr_opcode = str_hash_find (avr_hash, "__gcc_isr");
   gas_assert (avr_gccisr_opcode);
 
   bfd_set_arch_mach (stdoutput, TARGET_ARCH, avr_mcu->mach);
@@ -1884,7 +1883,7 @@ md_assemble (char *str)
   if (!op[0])
     as_bad (_("can't find opcode "));
 
-  opcode = (struct avr_opcodes_s *) str_hash_find (avr_hash, op);
+  opcode = str_hash_find (avr_hash, op);
 
   if (opcode && !avr_opt.all_opcodes)
     {
@@ -2506,8 +2505,7 @@ avr_emit_insn (const char *insn, int reg, char **pwhere)
 {
   const int sreg = 0x3f;
   unsigned bin = 0;
-  const struct avr_opcodes_s *op
-    = (struct avr_opcodes_s*) str_hash_find (avr_hash, insn);
+  const struct avr_opcodes_s *op = str_hash_find (avr_hash, insn);
 
   /* We only have to deal with: IN, OUT, PUSH, POP, CLR, LDI 0, MOV R1.
      All of these deal with at least one Reg and are 1-word instructions.  */
index 751a861f074fcf0ba3589e0162867b69f27f66db..62a7deb613ac6737549982a64993b8f0983d22f3 100644 (file)
@@ -329,7 +329,7 @@ get_register (char *reg_name)
 {
   const reg_entry *rreg;
 
-  rreg = (const reg_entry *) str_hash_find (reg_hash, reg_name);
+  rreg = str_hash_find (reg_hash, reg_name);
 
   if (rreg != NULL)
     return rreg->value.reg_val;
@@ -350,10 +350,10 @@ get_register_pair (char *reg_name)
       tmp_rp[0] = '(';
       strcat (tmp_rp, reg_name);
       strcat (tmp_rp,")");
-      rreg = (const reg_entry *) str_hash_find (regp_hash, tmp_rp);
+      rreg = str_hash_find (regp_hash, tmp_rp);
     }
   else
-    rreg = (const reg_entry *) str_hash_find (regp_hash, reg_name);
+    rreg = str_hash_find (regp_hash, reg_name);
 
   if (rreg != NULL)
     return rreg->value.reg_val;
@@ -368,7 +368,7 @@ get_index_register (char *reg_name)
 {
   const reg_entry *rreg;
 
-  rreg = (const reg_entry *) str_hash_find (reg_hash, reg_name);
+  rreg = str_hash_find (reg_hash, reg_name);
 
   if ((rreg != NULL)
       && ((rreg->value.reg_val == 12) || (rreg->value.reg_val == 13)))
@@ -383,7 +383,7 @@ get_index_register_pair (char *reg_name)
 {
   const reg_entry *rreg;
 
-  rreg = (const reg_entry *) str_hash_find (regp_hash, reg_name);
+  rreg = str_hash_find (regp_hash, reg_name);
 
   if (rreg != NULL)
     {
@@ -404,7 +404,7 @@ get_pregister (char *preg_name)
 {
   const reg_entry *prreg;
 
-  prreg = (const reg_entry *) str_hash_find (preg_hash, preg_name);
+  prreg = str_hash_find (preg_hash, preg_name);
 
   if (prreg != NULL)
     return prreg->value.preg_val;
@@ -419,7 +419,7 @@ get_pregisterp (char *preg_name)
 {
   const reg_entry *prreg;
 
-  prreg = (const reg_entry *) str_hash_find (pregp_hash, preg_name);
+  prreg = str_hash_find (pregp_hash, preg_name);
 
   if (prreg != NULL)
     return prreg->value.preg_val;
@@ -2469,7 +2469,7 @@ cr16_assemble (const char *op, char *param)
   ins cr16_ins;
 
   /* Find the instruction.  */
-  instruction = (const inst *) str_hash_find (cr16_inst_hash, op);
+  instruction = str_hash_find (cr16_inst_hash, op);
   if (instruction == NULL)
     {
       as_bad (_("Unknown opcode: `%s'"), op);
@@ -2539,7 +2539,7 @@ md_assemble (char *op)
     {
       strcpy (param1, param);
       /* Find the instruction.  */
-      instruction = (const inst *) str_hash_find (cr16_inst_hash, op);
+      instruction = str_hash_find (cr16_inst_hash, op);
       parse_operands (&cr16_ins, param1);
       if (((&cr16_ins)->arg[0].type == arg_ic)
          && ((&cr16_ins)->arg[0].constant >= 0))
index 22048694f4b8ab31523c1092b2f1f06b2f5169fe..2ceac0ed201331c7a3dcd0652497198a80a1f822 100644 (file)
@@ -1552,7 +1552,7 @@ cris_process_instruction (char *insn_text, struct cris_instruction *out_insnp,
     }
 
   /* Find the instruction.  */
-  instruction = (struct cris_opcode *) str_hash_find (op_hash, insn_text);
+  instruction = str_hash_find (op_hash, insn_text);
   if (instruction == NULL)
     {
       as_bad (_("Unknown opcode: `%s'"), insn_text);
index f62424b7a1686f8e866e3e767685dce1962a3d95..fffd3f12b4567c36a92b1cec5e06fec468243943 100644 (file)
@@ -184,7 +184,7 @@ get_register (char *reg_name)
 {
   const reg_entry *rreg;
 
-  rreg = (const reg_entry *) str_hash_find (reg_hash, reg_name);
+  rreg = str_hash_find (reg_hash, reg_name);
 
   if (rreg != NULL)
     return rreg->value.reg_val;
@@ -199,7 +199,7 @@ get_copregister (char *copreg_name)
 {
   const reg_entry *coreg;
 
-  coreg = (const reg_entry *) str_hash_find (copreg_hash, copreg_name);
+  coreg = str_hash_find (copreg_hash, copreg_name);
 
   if (coreg != NULL)
     return coreg->value.copreg_val;
@@ -1933,7 +1933,7 @@ md_assemble (char *op)
   *param++ = '\0';
 
   /* Find the instruction.  */
-  instruction = (const inst *) str_hash_find (crx_inst_hash, op);
+  instruction = str_hash_find (crx_inst_hash, op);
   if (instruction == NULL)
     {
       as_bad (_("Unknown opcode: `%s'"), op);
index 81f1b759c1501d5384cd092e54e74eeb8ecd2a6c..ed148e5deed1b9f2f2dc9e00eb03fd01cfaa97be 100644 (file)
@@ -3386,10 +3386,8 @@ parse_opcode (char *str)
   csky_insn.number = csky_count_operands (opcode_end);
 
   /* Find hash by name in csky_macros_hash and csky_opcodes_hash.  */
-  csky_insn.macro = (struct csky_macro_info *) str_hash_find (csky_macros_hash,
-                                                             macro_name);
-  csky_insn.opcode = (struct csky_opcode *) str_hash_find (csky_opcodes_hash,
-                                                          name);
+  csky_insn.macro = str_hash_find (csky_macros_hash, macro_name);
+  csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
 
   if (csky_insn.macro == NULL && csky_insn.opcode == NULL)
     return false;
@@ -3614,8 +3612,7 @@ get_operand_value (struct csky_opcode_info *op,
          if (val <= 6)
            {
              const char *name = "movi";
-             csky_insn.opcode = (struct csky_opcode *)
-               str_hash_find (csky_opcodes_hash, name);
+             csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
              csky_insn.val[csky_insn.idx - 1] = 1 << val;
            }
          return true;
@@ -3648,8 +3645,7 @@ get_operand_value (struct csky_opcode_info *op,
            if (log <= 6)
              {
                const char *name = "movi";
-               csky_insn.opcode = (struct csky_opcode *)
-                 str_hash_find (csky_opcodes_hash, name);
+               csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
                as_warn (_("translating mgeni to movi"));
              }
            else
@@ -3686,8 +3682,7 @@ get_operand_value (struct csky_opcode_info *op,
          if (mask_val > 0 && mask_val < 8)
            {
              const char *op_movi = "movi";
-             csky_insn.opcode = (struct csky_opcode *)
-               str_hash_find (csky_opcodes_hash, op_movi);
+             csky_insn.opcode = str_hash_find (csky_opcodes_hash, op_movi);
              if (csky_insn.opcode == NULL)
                return false;
              csky_insn.val[csky_insn.idx - 1] = (1 << mask_val) - 1;
@@ -3747,8 +3742,7 @@ get_operand_value (struct csky_opcode_info *op,
          if (mask_val > 0 && mask_val < 16)
            {
              const char *op_movi = "movi";
-             csky_insn.opcode = (struct csky_opcode *)
-               str_hash_find (csky_opcodes_hash, op_movi);
+             csky_insn.opcode = str_hash_find (csky_opcodes_hash, op_movi);
              if (csky_insn.opcode == NULL)
                return false;
              csky_insn.val[csky_insn.idx - 1] = (1 << (mask_val + 1)) - 1;
@@ -6475,8 +6469,7 @@ v1_work_jbsr (void)
     {
       /* Using jsri instruction.  */
       const char *name = "jsri";
-      csky_insn.opcode = (struct csky_opcode *)
-       str_hash_find (csky_opcodes_hash, name);
+      csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
       csky_insn.opcode_idx = 0;
       csky_insn.isize = 2;
 
@@ -6823,8 +6816,7 @@ bool
 v2_work_rotlc (void)
 {
   const char *name = "addc";
-  csky_insn.opcode
-    = (struct csky_opcode *) str_hash_find (csky_opcodes_hash, name);
+  csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
   csky_insn.opcode_idx = 0;
   if (csky_insn.isize == 2)
     {
@@ -6861,8 +6853,7 @@ v2_work_bgeni (void)
       name = "movih";
       val >>= 16;
     }
-  csky_insn.opcode
-    = (struct csky_opcode *) str_hash_find (csky_opcodes_hash, name);
+  csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
   csky_insn.opcode_idx = 0;
   csky_insn.val[1] = val;
 
@@ -6879,8 +6870,7 @@ bool
 v2_work_not (void)
 {
   const char *name = "nor";
-  csky_insn.opcode
-    = (struct csky_opcode *) str_hash_find (csky_opcodes_hash, name);
+  csky_insn.opcode = str_hash_find (csky_opcodes_hash, name);
   csky_insn.opcode_idx = 0;
   if (csky_insn.number == 1)
     {
index dd0292a5c887989bd37cecaf27291dc473291d3c..b10cdffbdda9f7b42e1676a757a00c3e992b4b53 100644 (file)
@@ -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;
 
@@ -1556,8 +1556,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
        {
          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)
index c3c58d1198015064874f980585cfe4dd1b2a122a..76827d501b6466bf9a3345ad637df9cb26d59baa 100644 (file)
@@ -1387,7 +1387,7 @@ do_assemble (char *str,
     }
 
   /* Find the first opcode with the proper name.  */
-  opcode->op = (struct d30v_opcode *) str_hash_find (d30v_hash, name);
+  opcode->op = str_hash_find (d30v_hash, name);
   if (opcode->op == NULL)
     {
       as_bad (_("unknown opcode: %s"), name);
index 8d830fe705ad79bc28c2ad7d12e64f205e5c955e..abb283dda3209d22daa387fabb6e17cdfb2325d9 100644 (file)
@@ -683,7 +683,7 @@ machine_ip (char *str)
     }
 
   /* Hash the opcode, insn will have the string from opcode table.  */
-  if ((insn = (struct machine_opcode *) str_hash_find (op_hash, str)) == NULL)
+  if ((insn = str_hash_find (op_hash, str)) == NULL)
     {
       /* Handle the ret and return macro here.  */
       if ((strcmp (str, "ret") == 0) || (strcmp (str, "return") == 0))
index 50958d5052f46a37d7c54592af3eaccca9d6d6dd..83d3e1f573121b7e6ff650024751a997099dde80 100644 (file)
@@ -230,7 +230,7 @@ md_assemble (char *str)
   if (nlen == 0)
     as_bad (_("can't find opcode "));
 
-  opcode = (ft32_opc_info_t *) str_hash_find (opcode_hash_control, op_start);
+  opcode = str_hash_find (opcode_hash_control, op_start);
   *op_end = pend;
 
   if (opcode == NULL)
index eeee4c845dbecf28929d92c7c23806b518da9f63..12456b2d0c35748ad210e6355eb483f8bc59f0a1 100644 (file)
@@ -1937,8 +1937,7 @@ md_assemble (char *str)
     while (*++slash)
       *slash = TOLOWER (*slash);
 
-  instruction = (const struct h8_instruction *)
-    str_hash_find (opcode_hash_control, op_start);
+  instruction = str_hash_find (opcode_hash_control, op_start);
 
   if (instruction == NULL)
     {
index c2a981eeb2157d18e6f53c6258dbe92fbd888fa3..5018dfc1e998b11a338971afee1377cf120ecf4a 100644 (file)
@@ -3210,7 +3210,7 @@ pa_ip (char *str)
     }
 
   /* Look up the opcode in the hash table.  */
-  if ((insn = (struct pa_opcode *) str_hash_find (op_hash, str)) == NULL)
+  if ((insn = str_hash_find (op_hash, str)) == NULL)
     {
       as_bad (_("Unknown opcode: `%s'"), str);
       return;
index 723f02159d48fc7c0a519369f29da3b113102704..ca68881b4a0ccf194ef9c33680854c7c3a051650 100644 (file)
@@ -10839,8 +10839,7 @@ process_operands (void)
             and 3 sources.  */
          for (j = i.operands; j > 0; j--)
            copy_operand (j, j - 1);
-         i.op[0].regs
-           = (const reg_entry *) str_hash_find (reg_hash, "xmm0");
+         i.op[0].regs = str_hash_find (reg_hash, "xmm0");
          i.types[0] = regxmm;
          i.tm.operand_types[0] = regxmm;
 
@@ -15107,9 +15106,8 @@ i386_index_check (const char *operand_string)
              || ((!i.mem_operands != !intel_syntax)
                  && t->operand_types[1].bitfield.baseindex))
            op = 1;
-         expected_reg
-           = (const reg_entry *) str_hash_find (reg_hash,
-                                                di_si[addr_mode][op == es_op]);
+         expected_reg = str_hash_find (reg_hash,
+                                       di_si[addr_mode][op == es_op]);
        }
       else
        {
@@ -16831,7 +16829,7 @@ parse_real_register (const char *reg_string, char **end_op)
 
   *end_op = (char *) s;
 
-  r = (const reg_entry *) str_hash_find (reg_hash, reg_name_given);
+  r = str_hash_find (reg_hash, reg_name_given);
 
   /* Handle floating point regs, allowing spaces in the (i) part.  */
   if (r == reg_st0)
index 8bd686537bc457cff697b5c8e6d534861f6e121f..192c093de499514c5c76b573e9466fc678be4074 100644 (file)
@@ -10646,7 +10646,7 @@ md_assemble (char *str)
 
   ch = get_symbol_name (&temp);
   mnemonic = temp;
-  pdesc = (struct pseudo_opcode *) str_hash_find (md.pseudo_hash, mnemonic);
+  pdesc = str_hash_find (md.pseudo_hash, mnemonic);
   if (pdesc)
     {
       (void) restore_line_pointer (ch);
@@ -11779,7 +11779,7 @@ dot_alias (int section)
 
   /* Check if alias has been used before.  */
 
-  h = (struct alias *) str_hash_find (ahash, alias);
+  h = str_hash_find (ahash, alias);
   if (h)
     {
       if (strcmp (h->name, name))
@@ -11790,7 +11790,7 @@ dot_alias (int section)
     }
 
   /* Check if name already has an alias.  */
-  a = (const char *) str_hash_find (nhash, name);
+  a = str_hash_find (nhash, name);
   if (a)
     {
       if (strcmp (a, alias))
index dbfd84b309776079457ae8d24d36b2af39ab952f..c2045cd7c886d0cbd44462048b0b0906f2df32e5 100644 (file)
@@ -2524,8 +2524,7 @@ kvx_handle_align (fragS *fragP)
   static unsigned int nop_single = 0;
   if (!nop_single)
     {
-      const struct kvxopc *opcode =
-       (struct kvxopc *) str_hash_find (env.opcode_hash, "nop");
+      const struct kvxopc *opcode = str_hash_find (env.opcode_hash, "nop");
 
       if (opcode == NULL)
        as_fatal
index acf446c30771709a857174fe6574c7766c61da5b..be3dac208a50448b16ea1ad720eeec0f03f55e98 100644 (file)
@@ -1056,8 +1056,7 @@ get_loongarch_opcode (struct loongarch_cl_insn *insn)
              if ((!it->include || (it->include && *it->include))
                  && (!it->exclude || (it->exclude && !(*it->exclude)))
                  && !(it->pinfo & INSN_DIS_ALIAS))
-               str_hash_insert (ase->name_hash_entry, it->name,
-                                (void *) it, 0);
+               str_hash_insert (ase->name_hash_entry, it->name, it, 0);
            }
        }
 
index d3e2f8bb54cd02c429514b55ad251a45ca2112c1..41bf9c374724a64b201b207cf7394df3d1e91836 100644 (file)
@@ -1008,7 +1008,7 @@ print_insn_format (char *name)
   struct m68hc11_opcode *opcode;
   char buf[128];
 
-  opc = (struct m68hc11_opcode_def *) str_hash_find (m68hc11_hash, name);
+  opc = str_hash_find (m68hc11_hash, name);
   if (opc == NULL)
     {
       as_bad (_("Instruction `%s' is not recognized."), name);
@@ -2848,7 +2848,7 @@ md_assemble (char *str)
   if (current_architecture == cpuxgate)
     {
       /* Find the opcode definition given its name.  */
-      opc = (struct m68hc11_opcode_def *) str_hash_find (m68hc11_hash, name);
+      opc = str_hash_find (m68hc11_hash, name);
       if (opc == NULL)
         {
           as_bad (_("Opcode `%s' is not recognized."), name);
@@ -3469,7 +3469,7 @@ md_assemble (char *str)
     }
 
   /* Find the opcode definition given its name.  */
-  opc = (struct m68hc11_opcode_def *) str_hash_find (m68hc11_hash, name);
+  opc = str_hash_find (m68hc11_hash, name);
 
   /* If it's not recognized, look for 'jbsr' and 'jbxx'.  These are
      pseudo insns for relative branch.  For these branches, we always
@@ -3477,8 +3477,7 @@ md_assemble (char *str)
      is given.  */
   if (opc == NULL && name[0] == 'j' && name[1] == 'b')
     {
-      opc = (struct m68hc11_opcode_def *) str_hash_find (m68hc11_hash,
-                                                        &name[1]);
+      opc = str_hash_find (m68hc11_hash, &name[1]);
       if (opc
          && (!(opc->format & M6811_OP_JUMP_REL)
              || (opc->format & M6811_OP_BITMASK)))
@@ -3509,8 +3508,7 @@ md_assemble (char *str)
            {
              name[nlen++] = TOLOWER (*op_end++);
              name[nlen] = 0;
-             opc = (struct m68hc11_opcode_def *) str_hash_find (m68hc11_hash,
-                                                                name);
+             opc = str_hash_find (m68hc11_hash, name);
            }
        }
     }
index 46b26d4f38aaa78d78c076f9a5ee19a7b28881f3..510a1bcc65fa69f7dcdcadd8d2c9b4d73f2088a8 100644 (file)
@@ -1357,7 +1357,7 @@ m68k_ip (char *instring)
 
   c = *p;
   *p = '\0';
-  opcode = (const struct m68k_incant *) str_hash_find (op_hash, instring);
+  opcode = str_hash_find (op_hash, instring);
   *p = c;
 
   if (pdot != NULL)
@@ -4560,7 +4560,7 @@ md_begin (void)
     {
       const char *name = m68k_opcode_aliases[i].primary;
       const char *alias = m68k_opcode_aliases[i].alias;
-      void *val = (void *) str_hash_find (op_hash, name);
+      void *val = str_hash_find (op_hash, name);
 
       if (!val)
        as_fatal (_("Internal Error: Can't find %s in hash table"), name);
@@ -4598,7 +4598,7 @@ md_begin (void)
        {
          const char *name = mri_aliases[i].primary;
          const char *alias = mri_aliases[i].alias;
-         void *val = (void *) str_hash_find (op_hash, name);
+         void *val = str_hash_find (op_hash, name);
 
          if (!val)
            as_fatal (_("Internal Error: Can't find %s in hash table"), name);
index 38e6637c435110e2f6a1483d0ac392b644c3d544..8688bfaf42424a61a950dddc8e41cda8beb9f243 100644 (file)
@@ -882,7 +882,7 @@ md_assemble (char * str)
       return;
     }
 
-  opcode = (mcore_opcode_info *) str_hash_find (opcode_hash_control, name);
+  opcode = str_hash_find (opcode_hash_control, name);
   if (opcode == NULL)
     {
       as_bad (_("unknown opcode \"%s\""), name);
index 035a8677695ec38e66923d76c396ae7278d0bf9e..3bf2ac16fe755aedaa7453306dcdaa7771249d9b 100644 (file)
@@ -914,7 +914,7 @@ md_assemble (char * str)
       return;
     }
 
-  opcode = (struct op_code_struct *) str_hash_find (opcode_hash_control, name);
+  opcode = str_hash_find (opcode_hash_control, name);
   if (opcode == NULL)
     {
       as_bad (_("unknown opcode \"%s\""), name);
@@ -1044,13 +1044,9 @@ md_assemble (char * str)
 
           count = 32 - reg1;
           if (streq (name, "lmi"))
-           opcode
-             = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                        "lwi");
+           opcode = str_hash_find (opcode_hash_control, "lwi");
           else
-           opcode
-             = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                        "swi");
+           opcode = str_hash_find (opcode_hash_control, "swi");
           if (opcode == NULL)
             {
               as_bad (_("unknown opcode \"%s\""), "lwi");
@@ -1082,9 +1078,7 @@ md_assemble (char * str)
           if ((temp != 0) && (temp != 0xFFFF8000))
            {
               /* Needs an immediate inst.  */
-             opcode1
-               = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                          "imm");
+             opcode1 = str_hash_find (opcode_hash_control, "imm");
               if (opcode1 == NULL)
                 {
                   as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1618,9 +1612,7 @@ md_assemble (char * str)
       if ((temp != 0) && (temp != 0xFFFF8000))
        {
           /* Needs an immediate inst.  */
-         opcode1
-           = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                      "imm");
+         opcode1 = str_hash_find (opcode_hash_control, "imm");
           if (opcode1 == NULL)
             {
               as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1686,9 +1678,7 @@ md_assemble (char * str)
       if ((temp != 0) && (temp != 0xFFFF8000))
        {
           /* Needs an immediate inst.  */
-          opcode1
-           = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                      "imm");
+          opcode1 = str_hash_find (opcode_hash_control, "imm");
           if (opcode1 == NULL)
             {
               as_bad (_("unknown opcode \"%s\""), "imm");
@@ -1761,9 +1751,7 @@ md_assemble (char * str)
       if ((temp != 0) && (temp != 0xFFFF8000))
        {
           /* Needs an immediate inst.  */
-          opcode1
-           = (struct op_code_struct *) str_hash_find (opcode_hash_control,
-                                                      "imm");
+          opcode1 = str_hash_find (opcode_hash_control, "imm");
           if (opcode1 == NULL)
             {
               as_bad (_("unknown opcode \"%s\""), "imm");
@@ -2185,8 +2173,7 @@ md_apply_fix (fixS *   fixP,
        buf[i + INST_WORD_SIZE] = buf[i];
 
       /* Generate the imm instruction.  */
-      opcode1
-       = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imm");
+      opcode1 = str_hash_find (opcode_hash_control, "imm");
       if (opcode1 == NULL)
        {
          as_bad (_("unknown opcode \"%s\""), "imm");
@@ -2234,8 +2221,7 @@ md_apply_fix (fixS *   fixP,
        buf[i + INST_WORD_SIZE] = buf[i];
 
       /* Generate the imm instruction.  */
-      opcode1
-       = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imm");
+      opcode1 = str_hash_find (opcode_hash_control, "imm");
       if (opcode1 == NULL)
        {
          as_bad (_("unknown opcode \"%s\""), "imm");
index 59733f794dbe839d3596a05ae11a08324323ba4d..5e602a47a4ec1b4df82583e80283bb5044070f0c 100644 (file)
@@ -9031,7 +9031,7 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...)
   r[1] = BFD_RELOC_UNUSED;
   r[2] = BFD_RELOC_UNUSED;
   hash = mips_opts.micromips ? micromips_op_hash : op_hash;
-  amo = (struct mips_opcode *) str_hash_find (hash, name);
+  amo = str_hash_find (hash, name);
   gas_assert (amo);
   gas_assert (strcmp (name, amo->name) == 0);
 
@@ -9189,7 +9189,7 @@ mips16_macro_build (expressionS *ep, const char *name, const char *fmt,
   bfd_reloc_code_real_type r[3]
     = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
 
-  mo = (struct mips_opcode *) str_hash_find (mips16_op_hash, name);
+  mo = str_hash_find (mips16_op_hash, name);
   gas_assert (mo);
   gas_assert (strcmp (name, mo->name) == 0);
 
@@ -14266,7 +14266,7 @@ mips_lookup_insn (htab_t hash, const char *start,
   name = xstrndup (start, length);
 
   /* Look up the instruction as-is.  */
-  insn = (struct mips_opcode *) str_hash_find (hash, name);
+  insn = str_hash_find (hash, name);
   if (insn)
     goto end;
 
@@ -14278,7 +14278,7 @@ mips_lookup_insn (htab_t hash, const char *start,
       if (*p == 0 && mask != 0)
        {
          *dot = 0;
-         insn = (struct mips_opcode *) str_hash_find (hash, name);
+         insn = str_hash_find (hash, name);
          *dot = '.';
          if (insn && (insn->pinfo2 & INSN2_VU0_CHANNEL_SUFFIX) != 0)
            {
@@ -14304,7 +14304,7 @@ mips_lookup_insn (htab_t hash, const char *start,
       if (suffix)
        {
          memmove (name + opend - 2, name + opend, length - opend + 1);
-         insn = (struct mips_opcode *) str_hash_find (hash, name);
+         insn = str_hash_find (hash, name);
          if (insn)
            {
              forced_insn_length = suffix;
@@ -14418,7 +14418,7 @@ mips16_ip (char *str, struct mips_cl_insn *insn)
   forced_insn_length = l;
 
   *end = 0;
-  first = (struct mips_opcode *) str_hash_find (mips16_op_hash, str);
+  first = str_hash_find (mips16_op_hash, str);
   *end = c;
 
   if (!first)
index 76a06188535c335d02be76c63dd57d94b72c3ee1..eb29b14d1ae2d5b9a9f68b7f40c32c135af72cc3 100644 (file)
@@ -835,7 +835,7 @@ md_assemble (char *str)
       *operands++ = '\0';
     }
 
-  instruction = (struct mmix_opcode *) str_hash_find (mmix_opcode_hash, str);
+  instruction = str_hash_find (mmix_opcode_hash, str);
   if (instruction == NULL)
     {
       as_bad (_("unknown opcode: `%s'"), str);
index 657f591a1b28ef8bc4fd2863740683d2a285f3d8..db66e201b438b79d593b6c774adc92d1a33c7430 100644 (file)
@@ -884,7 +884,7 @@ md_assemble (char *str)
     *s++ = '\0';
 
   /* Find the first opcode with the proper name.  */
-  opcode = (struct mn10200_opcode *) str_hash_find (mn10200_hash, str);
+  opcode = str_hash_find (mn10200_hash, str);
   if (opcode == NULL)
     {
       as_bad (_("Unrecognized opcode: `%s'"), str);
index 2167f408b2922372ea2383a9424abdf1a2c95f2b..55747e0280a919b05a621d0fb1ab2d63b6b730be 100644 (file)
@@ -1247,7 +1247,7 @@ md_assemble (char *str)
     *s++ = '\0';
 
   /* Find the first opcode with the proper name.  */
-  opcode = (struct mn10300_opcode *) str_hash_find (mn10300_hash, str);
+  opcode = str_hash_find (mn10300_hash, str);
   if (opcode == NULL)
     {
       as_bad (_("Unrecognized opcode: `%s'"), str);
index fec6a6ffbdf4e6403fbaacea1ec35284415643b3..3c4769921b603d515d5880685e892cccf74e198c 100644 (file)
@@ -178,7 +178,7 @@ md_assemble (char *str)
 
   if (nlen == 0)
     as_bad (_("can't find opcode "));
-  opcode = (moxie_opc_info_t *) str_hash_find (opcode_hash_control, op_start);
+  opcode = str_hash_find (opcode_hash_control, op_start);
   *op_end = pend;
 
   if (opcode == NULL)
index 7ce061b1cf778ed93269c992abdb73db8d357eb1..563365faaf7ef3cc65a4a7a291ba246f1401d020 100644 (file)
@@ -4360,7 +4360,7 @@ md_assemble (char * str)
       return;
     }
 
-  opcode = (struct msp430_opcode_s *) str_hash_find (msp430_hash, cmd);
+  opcode = str_hash_find (msp430_hash, cmd);
 
   if (opcode == NULL)
     {
index cf23c9b1fcfb9ea713a264a6d11711056f2080a6..ad2c1f4d09c0e7c8194b5e02108837c071c98eb3 100644 (file)
@@ -1105,7 +1105,7 @@ parse (const char *line, int recursive_level)
       c = *lineptr;
       *(char *) lineptr = '\0';
 
-      desc = (struct ns32k_opcode *) str_hash_find (inst_hash_handle, line);
+      desc = str_hash_find (inst_hash_handle, line);
       if (!desc)
        as_fatal (_("No such opcode"));
 
index 2c3722c10c5ad6f4079e09effb5a9e8d33becadb..7566bbbcbff6fa18814d0272852488df3883a58f 100644 (file)
@@ -710,7 +710,7 @@ md_assemble (char *instruction_string)
 
   c = *p;
   *p = '\0';
-  op = (struct pdp11_opcode *)str_hash_find (insn_hash, str);
+  op = str_hash_find (insn_hash, str);
   *p = c;
   if (op == 0)
     {
index 849f90565fd808f44c91e585c16028f062951c73..61fada7005d6567c4482550ae98b1863f3ce5d2f 100644 (file)
@@ -252,7 +252,7 @@ md_assemble (char *str)
   if (nlen == 0)
     as_bad (_("can't find opcode "));
 
-  opcode = (pj_opc_info_t *) str_hash_find (opcode_hash_control, op_start);
+  opcode = str_hash_find (opcode_hash_control, op_start);
   *op_end = pend;
 
   if (opcode == NULL)
index b59a2f59a1d39ecc77c7281728a8d294da40c238..43dddb0d9075ae3383409eb62246c9af61b2f96f 100644 (file)
@@ -3331,8 +3331,8 @@ md_assemble (char *str)
     *s++ = '\0';
 
   /* Look up the opcode in the hash table.  */
-  opcode = (const struct powerpc_opcode *) str_hash_find (ppc_hash, str);
-  if (opcode == (const struct powerpc_opcode *) NULL)
+  opcode = str_hash_find (ppc_hash, str);
+  if (opcode == NULL)
     {
       as_bad (_("unrecognized opcode: `%s'"), str);
       ppc_clear_labels ();
index 70a4e76e9b3adba4640c0a7879fee3f0d341622e..00208e4fd06d2d3f033de4815a0ec3fb99592b6f 100644 (file)
@@ -134,12 +134,12 @@ typedef struct pru_insn_info
 /* Opcode hash table.  */
 static htab_t pru_opcode_hash = NULL;
 #define pru_opcode_lookup(NAME) \
-  ((struct pru_opcode *) str_hash_find (pru_opcode_hash, (NAME)))
+  (str_hash_find (pru_opcode_hash, (NAME)))
 
 /* Register hash table.  */
 static htab_t pru_reg_hash = NULL;
 #define pru_reg_lookup(NAME) \
-  ((struct pru_reg *) str_hash_find (pru_reg_hash, (NAME)))
+  (str_hash_find (pru_reg_hash, (NAME)))
 
 /* The known current alignment of the current section.  */
 static int pru_current_align;
index c06a2d17a43a13ba099205723bffe26414569f75..d0030de46817c7947273316436e5c0b0f753a88b 100644 (file)
@@ -933,7 +933,7 @@ opcode_name_lookup (char **s)
   save_c = *e;
   *e = '\0';
 
-  o = (struct opcode_name_t *) str_hash_find (opcode_names_hash, *s);
+  o = str_hash_find (opcode_names_hash, *s);
 
   /* Advance to next token if one was recognized.  */
   if (o)
@@ -995,7 +995,7 @@ riscv_init_csr_hash (const char *name,
   bool need_enrty = true;
 
   pre_entry = NULL;
-  entry = (struct riscv_csr_extra *) str_hash_find (csr_extra_hash, name);
+  entry = str_hash_find (csr_extra_hash, name);
   while (need_enrty && entry != NULL)
     {
       if (entry->csr_class == class
@@ -1210,8 +1210,7 @@ riscv_csr_address (const char *csr_name,
 static unsigned int
 reg_csr_lookup_internal (const char *s)
 {
-  struct riscv_csr_extra *r =
-    (struct riscv_csr_extra *) str_hash_find (csr_extra_hash, s);
+  struct riscv_csr_extra *r = str_hash_find (csr_extra_hash, s);
 
   if (r == NULL)
     return -1U;
@@ -2048,7 +2047,7 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...)
   va_start (args, fmt);
 
   r = BFD_RELOC_UNUSED;
-  mo = (struct riscv_opcode *) str_hash_find (op_hash, name);
+  mo = str_hash_find (op_hash, name);
   gas_assert (mo);
 
   /* Find a non-RVC variant of the instruction.  append_insn will compress
@@ -2864,7 +2863,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
        break;
       }
 
-  insn = (struct riscv_opcode *) str_hash_find (hash, str);
+  insn = str_hash_find (hash, str);
 
   probing_insn_operands = true;
 
index b846134797256f803354c6551c43ca96573579e7..6e9dca029842e88166b26bfab0b012db8f71a5ec 100644 (file)
@@ -1931,8 +1931,8 @@ md_assemble (char *str)
     *s++ = '\0';
 
   /* Look up the opcode in the hash table.  */
-  opcode = (struct s390_opcode *) str_hash_find (s390_opcode_hash, str);
-  if (opcode == (const struct s390_opcode *) NULL)
+  opcode = str_hash_find (s390_opcode_hash, str);
+  if (opcode == NULL)
     {
       as_bad (_("Unrecognized opcode: `%s'"), str);
       return;
@@ -1988,9 +1988,8 @@ s390_insn (int ignore ATTRIBUTE_UNUSED)
   *s++ = '\0';
 
   /* Look up the opcode in the hash table.  */
-  opformat = (struct s390_opcode *)
-    str_hash_find (s390_opformat_hash, input_line_pointer);
-  if (opformat == (const struct s390_opcode *) NULL)
+  opformat = str_hash_find (s390_opformat_hash, input_line_pointer);
+  if (opformat == NULL)
     {
       as_bad (_("Unrecognized opcode format: `%s'"), input_line_pointer);
       return;
index ab498754df5cee2d9e96c0820a1da84a02a8b255..79dcf773a3dc661c3624b3e79047564136b0e1b6 100644 (file)
@@ -1040,7 +1040,7 @@ s3_score_reg_parse (char **ccp, htab_t htab)
     c = *p++;
 
   *--p = 0;
-  reg = (struct s3_reg_entry *) str_hash_find (htab, start);
+  reg = str_hash_find (htab, start);
   *p = c;
 
   if (reg)
@@ -2199,8 +2199,7 @@ s3_dependency_type_from_insn (char *insn_name)
   const struct s3_insn_to_dependency *tmp;
 
   strcpy (name, insn_name);
-  tmp = (const struct s3_insn_to_dependency *)
-    str_hash_find (s3_dependency_insn_hsh, name);
+  tmp = str_hash_find (s3_dependency_insn_hsh, name);
 
   if (tmp)
     return tmp->type;
@@ -2659,8 +2658,7 @@ s3_parse_16_32_inst (char *insnstr, bool gen_frag_p)
   c = *p;
   *p = '\0';
 
-  opcode = (const struct s3_asm_opcode *) str_hash_find (s3_score_ops_hsh,
-                                                        operator);
+  opcode = str_hash_find (s3_score_ops_hsh, operator);
   *p = c;
 
   memset (&s3_inst, '\0', sizeof (s3_inst));
@@ -2706,8 +2704,7 @@ s3_parse_48_inst (char *insnstr, bool gen_frag_p)
   c = *p;
   *p = '\0';
 
-  opcode = (const struct s3_asm_opcode *) str_hash_find (s3_score_ops_hsh,
-                                                        operator);
+  opcode = str_hash_find (s3_score_ops_hsh, operator);
   *p = c;
 
   memset (&s3_inst, '\0', sizeof (s3_inst));
index c822144a79e1b8e3f8bf30d09c9c34aaee2f93c2..b11f69f2ba92b6ac70f2385463fceb5d92e20666 100644 (file)
@@ -1129,7 +1129,7 @@ s7_score_reg_parse (char **ccp, htab_t htab)
     c = *p++;
 
   *--p = 0;
-  reg = (struct s7_reg_entry *) str_hash_find (htab, start);
+  reg = str_hash_find (htab, start);
   *p = c;
 
   if (reg)
@@ -2321,8 +2321,7 @@ s7_dependency_type_from_insn (char *insn_name)
   const struct s7_insn_to_dependency *tmp;
 
   strcpy (name, insn_name);
-  tmp = (const struct s7_insn_to_dependency *)
-    str_hash_find (s7_dependency_insn_hsh, name);
+  tmp = str_hash_find (s7_dependency_insn_hsh, name);
 
   if (tmp)
     return tmp->type;
@@ -2790,8 +2789,7 @@ s7_parse_16_32_inst (char *insnstr, bool gen_frag_p)
   c = *p;
   *p = '\0';
 
-  opcode = (const struct s7_asm_opcode *) str_hash_find (s7_score_ops_hsh,
-                                                        operator);
+  opcode = str_hash_find (s7_score_ops_hsh, operator);
   *p = c;
 
   memset (&s7_inst, '\0', sizeof (s7_inst));
index db11939a350fd355980d8768aa4547ebf72916dd..0f890c98cc9704d8f75a1b07f18103aa4bb7f1c7 100644 (file)
@@ -2180,7 +2180,7 @@ find_cooked_opcode (char **str_p)
   if (nlen == 0)
     as_bad (_("can't find opcode "));
 
-  return (sh_opcode_info *) str_hash_find (opcode_hash_control, name);
+  return str_hash_find (opcode_hash_control, name);
 }
 
 /* Assemble a parallel processing insn.  */
index e303169e73d2e9d349e68bd86adb3497af318320..358042cb36ae7749ab21db53129ca633d41da209 100644 (file)
@@ -979,9 +979,9 @@ md_begin (void)
     {
       const struct sparc_opcode *insn;
       const char *name = ((sparc_arch_size == 32)
-                   ? native_op_table[i].name32
-                   : native_op_table[i].name64);
-      insn = (struct sparc_opcode *) str_hash_find (op_hash, name);
+                         ? native_op_table[i].name32
+                         : native_op_table[i].name64);
+      insn = str_hash_find (op_hash, name);
       if (insn == NULL)
        {
          as_bad (_("Internal error: can't find opcode `%s' for `%s'\n"),
@@ -1756,7 +1756,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn)
       *pinsn = NULL;
       return special_case;
     }
-  insn = (struct sparc_opcode *) str_hash_find (op_hash, str);
+  insn = str_hash_find (op_hash, str);
   *pinsn = insn;
   if (insn == NULL)
     {
index 335fffc68c1928149a7cbecbcbd90ace417760bb..1c8f7c5f8957fe2fbc14d23264cb4d617bb46051 100644 (file)
@@ -273,7 +273,7 @@ md_assemble (char *op)
 
   /* try to find the instruction in the hash table */
 
-  if ((format = (struct spu_opcode *) str_hash_find (op_hash, op)) == NULL)
+  if ((format = str_hash_find (op_hash, op)) == NULL)
     {
       as_bad (_("Invalid mnemonic '%s'"), op);
       return;
index 1da1618ee3035d15234292402223e7bb214e0e1a..87cf09a39fdc088491354c7bdd8d3f613bd8ffa2 100644 (file)
@@ -516,7 +516,7 @@ tic30_operand (char *token)
          return NULL;
        }
 
-      ind_addr_op = (ind_addr_type *) str_hash_find (ind_hash, ind_buffer);
+      ind_addr_op = str_hash_find (ind_hash, ind_buffer);
       if (ind_addr_op)
        {
          debug ("Found indirect reference: %s\n", ind_addr_op->syntax);
@@ -555,7 +555,7 @@ tic30_operand (char *token)
     }
   else
     {
-      reg *regop = (reg *) str_hash_find (reg_hash, token);
+      reg *regop = str_hash_find (reg_hash, token);
 
       if (regop)
        {
@@ -652,7 +652,7 @@ tic30_parallel_insn (char *token)
     /* Find instruction.  */
     save_char = *current_posn;
     *current_posn = '\0';
-    p_opcode = (partemplate *) str_hash_find (parop_hash, token);
+    p_opcode = str_hash_find (parop_hash, token);
     if (p_opcode)
       {
        debug ("Found instruction %s\n", p_opcode->name);
@@ -697,7 +697,7 @@ tic30_parallel_insn (char *token)
        debug ("first_opcode = %s\n", first_opcode);
        debug ("second_opcode = %s\n", second_opcode);
        sprintf (token, "q_%s_%s", second_opcode, first_opcode);
-       p_opcode = (partemplate *) str_hash_find (parop_hash, token);
+       p_opcode = str_hash_find (parop_hash, token);
 
        if (p_opcode)
          {
@@ -1443,7 +1443,7 @@ md_assemble (char *line)
     /* Find instruction.  */
     save_char = *current_posn;
     *current_posn = '\0';
-    op = (insn_template *) str_hash_find (op_hash, token_start);
+    op = str_hash_find (op_hash, token_start);
     if (op)
       {
        debug ("Found instruction %s\n", op->name);
index 97a088c2673ea562c80f1dff88505ec30ebb825f..167a94f7024ecf063ef4a86204454182e1945e74 100644 (file)
@@ -2450,8 +2450,7 @@ md_assemble (char *str)
 
   if (insn->in_use)
     {
-      if ((insn->inst = (struct tic4x_inst *)
-          str_hash_find (tic4x_op_hash, insn->name)) == NULL)
+      if ((insn->inst = str_hash_find (tic4x_op_hash, insn->name)) == NULL)
        {
          as_bad (_("Unknown opcode `%s'."), insn->name);
          insn->parallel = 0;
index cda4f49821174a7b55fabf96b64fa4eff61aaf5b..db3def4b36f7eaba3659c1ff32e81cff2a1207ad 100644 (file)
@@ -801,7 +801,7 @@ tic54x_tag (int ignore ATTRIBUTE_UNUSED)
 {
   char *name;
   int c = get_symbol_name (&name);
-  struct stag *stag = (struct stag *) str_hash_find (stag_hash, name);
+  struct stag *stag = str_hash_find (stag_hash, name);
 
   if (!stag)
     {
@@ -2733,7 +2733,7 @@ subsym_isreg (char *a, char *ignore ATTRIBUTE_UNUSED)
 static int
 subsym_structsz (char *name, char *ignore ATTRIBUTE_UNUSED)
 {
-  struct stag *stag = (struct stag *) str_hash_find (stag_hash, name);
+  struct stag *stag = str_hash_find (stag_hash, name);
 
   if (stag)
     return stag->size;
@@ -3667,7 +3667,7 @@ encode_integer (tic54x_insn *insn,
 static int
 encode_condition (tic54x_insn *insn, struct opstruct *operand)
 {
-  tic54x_symbol *cc = (tic54x_symbol *) str_hash_find (cc_hash, operand->buf);
+  tic54x_symbol *cc = str_hash_find (cc_hash, operand->buf);
   if (!cc)
     {
       as_bad (_("Unrecognized condition code \"%s\""), operand->buf);
@@ -3727,7 +3727,7 @@ encode_condition (tic54x_insn *insn, struct opstruct *operand)
 static int
 encode_cc3 (tic54x_insn *insn, struct opstruct *operand)
 {
-  tic54x_symbol *cc3 = (tic54x_symbol *) str_hash_find (cc3_hash, operand->buf);
+  tic54x_symbol *cc3 = str_hash_find (cc3_hash, operand->buf);
   int value = cc3 ? cc3->value : operand->exp.X_add_number << 8;
 
   if ((value & 0x0300) != value)
@@ -3756,7 +3756,7 @@ encode_arx (tic54x_insn *insn, struct opstruct *operand)
 static int
 encode_cc2 (tic54x_insn *insn, struct opstruct *operand)
 {
-  tic54x_symbol *cc2 = (tic54x_symbol *) str_hash_find (cc2_hash, operand->buf);
+  tic54x_symbol *cc2 = str_hash_find (cc2_hash, operand->buf);
 
   if (!cc2)
     {
@@ -3915,8 +3915,7 @@ encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand)
                             0, 65535, 0xFFFF);
     case OP_SBIT:
       {
-       tic54x_symbol *sbit = (tic54x_symbol *)
-         str_hash_find (sbit_hash, operand->buf);
+       tic54x_symbol *sbit = str_hash_find (sbit_hash, operand->buf);
        int value = is_absolute (operand) ?
          operand->exp.X_add_number : (sbit ? sbit->value : -1);
        int reg = 0;
@@ -4170,7 +4169,7 @@ optimize_insn (tic54x_insn *insn)
 static int
 tic54x_parse_insn (tic54x_insn *insn, char *line)
 {
-  insn->tm = (insn_template *) str_hash_find (op_hash, insn->mnemonic);
+  insn->tm = str_hash_find (op_hash, insn->mnemonic);
   if (!insn->tm)
     {
       as_bad (_("Unrecognized instruction \"%s\""), insn->mnemonic);
@@ -4193,8 +4192,7 @@ tic54x_parse_insn (tic54x_insn *insn, char *line)
          /* SUCCESS! now try some optimizations.  */
          if (optimize_insn (insn))
            {
-             insn->tm = (insn_template *) str_hash_find (op_hash,
-                                                         insn->mnemonic);
+             insn->tm = str_hash_find (op_hash, insn->mnemonic);
              continue;
            }
 
@@ -4229,7 +4227,7 @@ next_line_shows_parallel (char *next_line)
 static int
 tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line)
 {
-  insn->tm = (insn_template *) str_hash_find (parop_hash, insn->mnemonic);
+  insn->tm = str_hash_find (parop_hash, insn->mnemonic);
   if (!insn->tm)
     {
       as_bad (_("Unrecognized parallel instruction \"%s\""),
@@ -5054,13 +5052,13 @@ tic54x_undefined_symbol (char *name)
   tic54x_symbol *sym;
 
   /* Not sure how to handle predefined symbols.  */
-  if ((sym = (tic54x_symbol *) str_hash_find (cc_hash, name)) != NULL
-      || (sym = (tic54x_symbol *) str_hash_find (cc2_hash, name)) != NULL
-      || (sym = (tic54x_symbol *) str_hash_find (cc3_hash, name)) != NULL
+  if ((sym = str_hash_find (cc_hash, name)) != NULL
+      || (sym = str_hash_find (cc2_hash, name)) != NULL
+      || (sym = str_hash_find (cc3_hash, name)) != NULL
       || str_hash_find (misc_symbol_hash, name) != NULL
-      || (sym = (tic54x_symbol *) str_hash_find (sbit_hash, name)) != NULL
-      || (sym = (tic54x_symbol *) str_hash_find (reg_hash, name)) != NULL
-      || (sym = (tic54x_symbol *) str_hash_find (mmreg_hash, name)) != NULL
+      || (sym = str_hash_find (sbit_hash, name)) != NULL
+      || (sym = str_hash_find (reg_hash, name)) != NULL
+      || (sym = str_hash_find (mmreg_hash, name)) != NULL
       || !strcasecmp (name, "a")
       || !strcasecmp (name, "b"))
     {
index 0a483439f9c5ee44564a3a4d2f16398e440d745a..b344005875626fc34446662533bb3519659d1ba9 100644 (file)
@@ -2312,7 +2312,7 @@ md_assemble (char *str)
     *s++ = '\0';
 
   /* Find the first opcode with the proper name.  */
-  opcode = (struct v850_opcode *) str_hash_find (v850_hash, str);
+  opcode = str_hash_find (v850_hash, str);
   if (opcode == NULL)
     {
       /* xgettext:c-format  */
index 0b39d98f44a6bcd0e94e4526e8a12e65212d032c..e256d08a36eaac7e3bdd51ebddb87db222a52c88 100644 (file)
@@ -1882,7 +1882,7 @@ vip (struct vit *vitP,            /* We build an exploded instruction here.  */
       /* Here with instring pointing to what better be an op-name, and p
          pointing to character just past that.
          We trust instring points to an op-name, with no whitespace.  */
-      vwP = (struct vot_wot *) str_hash_find (op_hash, instring);
+      vwP = str_hash_find (op_hash, instring);
       /* Restore char after op-code.  */
       *p = c;
       if (vwP == 0)
index c9b078781795110525c5d0dd63dece8e306cdb11..ea47a02bd0c76138ac99326e6c9eb9584c5e8080 100644 (file)
@@ -746,7 +746,7 @@ md_assemble (char *str)
   if (!op[0])
     as_bad (_("can't find opcode "));
 
-  opcode = (struct wasm32_opcode_s *) str_hash_find (wasm32_hash, op);
+  opcode = str_hash_find (wasm32_hash, op);
 
   if (opcode == NULL)
     {
index 5e09ee5f27e22e9b7ece15df09ca1cc70ec9a406..239310d1553a9e9d9e02a121fcefba70035b48fd 100644 (file)
@@ -491,8 +491,7 @@ md_assemble (char *input_line)
   if (!op_name[0])
     as_bad (_("opcode missing or not found on input line"));
 
-  opcode_handle = (struct xgate_opcode_handle *) str_hash_find (xgate_hash,
-                                                               op_name);
+  opcode_handle = str_hash_find (xgate_hash, op_name);
   if (!opcode_handle)
     as_bad (_("opcode %s not found in opcode hash table"), op_name);
   else
@@ -541,9 +540,7 @@ md_assemble (char *input_line)
              input_line = macro_inline; /* Rewind.  */
              p = extract_word (p, op_name, 10);
 
-             opcode_handle
-               = (struct xgate_opcode_handle *) str_hash_find (xgate_hash,
-                                                               op_name);
+             opcode_handle = str_hash_find (xgate_hash, op_name);
              if (!opcode_handle)
                {
                  as_bad (_(": processing macro, real opcode handle"
index 4cfb302d82cbd29cf190226dac6b318e06a06f7e..aa8fc5f92aee2faf902df4fdcab9500f39a4a1de 100644 (file)
@@ -1236,7 +1236,7 @@ md_assemble (char *str)
 
   *op_end = 0;  /* Zero-terminate op code string for str_hash_find() call.  */
 
-  opcode = (opcode_entry_type *) str_hash_find (opcode_hash_control, op_start);
+  opcode = str_hash_find (opcode_hash_control, op_start);
 
   if (opcode == NULL)
     {
index 756aa927946b3ea4925a515c56c5c86e980b85a5..b5d811c9857e59615a98cd5e56a96b7983444aec 100644 (file)
@@ -1559,8 +1559,8 @@ add_string (varray_t *vp,                 /* string obstack */
   if (len >= PAGE_USIZE)
     as_fatal (_("string too big (%lu bytes)"), len);
 
-  hash_ptr = (shash_t *) str_hash_find (hash_tbl, str);
-  if (hash_ptr == (shash_t *) NULL)
+  hash_ptr = str_hash_find (hash_tbl, str);
+  if (hash_ptr == NULL)
     {
       if (vp->objects_last_page + len >= PAGE_USIZE)
        {
@@ -2010,7 +2010,7 @@ get_tag (const char *tag, /* tag name */
   if (cur_file_ptr == (efdr_t *) NULL)
     as_fatal (_("no current file pointer"));
 
-  hash_ptr = (shash_t *) str_hash_find (tag_hash, tag);
+  hash_ptr = str_hash_find (tag_hash, tag);
 
   if (hash_ptr != (shash_t *) NULL
       && hash_ptr->tag_ptr != (tag_t *) NULL)
index e74196d1550eb2d8d6801e254b1ebf11c7b46e80..91b03502f59fda5f9e83635688d24381838af5cc 100644 (file)
@@ -179,9 +179,8 @@ ginsnS *
 label_ginsn_map_find (const symbolS *label)
 {
   const char *name = S_GET_NAME (label);
-  ginsnS *ginsn
-    = (ginsnS *) str_hash_find (frchain_now->frch_ginsn_data->label_ginsn_map,
-                               name);
+  ginsnS *ginsn = str_hash_find (frchain_now->frch_ginsn_data->label_ginsn_map,
+                                name);
   return ginsn;
 }
 
index 1b472039ab0cbe0c42d704b18b11d73e160b552c..a55144ded6c2be9cb5481df9516881190b2bf314 100644 (file)
@@ -25,7 +25,7 @@
 hashval_t
 hash_string_tuple (const void *e)
 {
-  string_tuple_t *tuple = (string_tuple_t *) e;
+  const string_tuple_t *tuple = e;
   return htab_hash_string (tuple->key);
 }
 
@@ -34,8 +34,8 @@ hash_string_tuple (const void *e)
 int
 eq_string_tuple (const void *a, const void *b)
 {
-  const string_tuple_t *ea = (const string_tuple_t *) a;
-  const string_tuple_t *eb = (const string_tuple_t *) b;
+  const string_tuple_t *ea = a;
+  const string_tuple_t *eb = b;
 
   return strcmp (ea->key, eb->key) == 0;
 }