]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas function arg casts
authorAlan Modra <amodra@gmail.com>
Tue, 8 Jul 2025 23:42:53 +0000 (09:12 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Jul 2025 00:05:07 +0000 (09:35 +0930)
This patch removes more unnecessary arg casts in various function
calls.

32 files changed:
gas/cgen.c
gas/config/obj-coff.c
gas/config/obj-elf.c
gas/config/obj-macho.c
gas/config/tc-aarch64.c
gas/config/tc-alpha.c
gas/config/tc-cr16.c
gas/config/tc-csky.c
gas/config/tc-i386.c
gas/config/tc-ia64.c
gas/config/tc-loongarch.c
gas/config/tc-m32r.c
gas/config/tc-m68k.c
gas/config/tc-mips.c
gas/config/tc-mmix.c
gas/config/tc-nds32.c
gas/config/tc-ppc.c
gas/config/tc-pru.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-tic6x.c
gas/config/tc-xstormy16.c
gas/config/tc-xtensa.c
gas/config/tc-z80.c
gas/ecoff.c
gas/read.c
gas/stabs.c
gas/symbols.c
gas/write.c

index f5b9030a0195d76066c51313d9766c66bf95dbab..605dd3cf25112033211ec5d81d5dcfac2a10bb8e 100644 (file)
@@ -475,13 +475,13 @@ gas_cgen_parse_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
          /* Re-init rightshift quantity, just in case.  */
          rightshift = operand->length;
          queue_fixup_recursively (opindex, opinfo_1, & exp,
-                                  (reloc_type == BFD_RELOC_RELC) ?
-                                  & (operand->index_fields) : 0,
+                                  (reloc_type == BFD_RELOC_RELC
+                                   ? &operand->index_fields : 0),
                                   signed_p, -1);
        }
-      * resultP = errmsg
-       ? CGEN_PARSE_OPERAND_RESULT_ERROR
-       : CGEN_PARSE_OPERAND_RESULT_QUEUED;
+      *resultP = (errmsg
+                 ? CGEN_PARSE_OPERAND_RESULT_ERROR
+                 : CGEN_PARSE_OPERAND_RESULT_QUEUED);
       *valueP = 0;
 #else
       queue_fixup (opindex, opinfo_1, &exp);
@@ -910,7 +910,7 @@ gas_cgen_md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 
            /* ??? 0 is passed for `pc'.  */
            errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields,
-                                                  &insn_value, (bfd_vma) 0);
+                                                  &insn_value, 0);
            cgen_put_insn_value (cd, (unsigned char *) where,
                                 CGEN_INSN_BITSIZE (insn), insn_value,
                                  cd->insn_endian);
@@ -918,8 +918,7 @@ gas_cgen_md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 #else
          /* ??? 0 is passed for `pc'.  */
          errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields,
-                                                (unsigned char *) where,
-                                                (bfd_vma) 0);
+                                                (unsigned char *) where, 0);
 #endif
          if (errmsg)
            as_bad_where (fixP->fx_file, fixP->fx_line, "%s", errmsg);
index 3467d646428fe2796162b32c6d60aba6748669d5..be6a96576289a8604ac880588236b183c4befc82 100644 (file)
@@ -903,7 +903,7 @@ obj_coff_line (int ignore ATTRIBUTE_UNUSED)
       extern int listing;
 
       if (listing)
-       listing_source_line ((unsigned int) this_base);
+       listing_source_line (this_base);
     }
 #endif
 }
@@ -982,8 +982,8 @@ obj_coff_type (int ignore ATTRIBUTE_UNUSED)
 
   S_SET_DATA_TYPE (def_symbol_in_progress, get_absolute_expression ());
 
-  if (ISFCN (S_GET_DATA_TYPE (def_symbol_in_progress)) &&
-      S_GET_STORAGE_CLASS (def_symbol_in_progress) != C_TPDEF)
+  if (ISFCN (S_GET_DATA_TYPE (def_symbol_in_progress))
+      && S_GET_STORAGE_CLASS (def_symbol_in_progress) != C_TPDEF)
     SF_SET_FUNCTION (def_symbol_in_progress);
 
   demand_empty_rest_of_line ();
@@ -1011,7 +1011,7 @@ obj_coff_val (int ignore ATTRIBUTE_UNUSED)
        {
          /* If the .val is != from the .def (e.g. statics).  */
          symbol_set_frag (def_symbol_in_progress, frag_now);
-         S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ());
+         S_SET_VALUE (def_symbol_in_progress, frag_now_fix ());
        }
       else if (! streq (S_GET_NAME (def_symbol_in_progress), symbol_name))
        {
@@ -1356,8 +1356,8 @@ coff_frob_symbol (symbolS *symp, int *punt)
                as_fatal (_("C_EFCN symbol for %s out of scope"),
                          S_GET_NAME (symp));
              SA_SET_SYM_FSIZE (last_functionP,
-                               (long) (S_GET_VALUE (symp)
-                                       - S_GET_VALUE (last_functionP)));
+                               (S_GET_VALUE (symp)
+                                - S_GET_VALUE (last_functionP)));
            }
        }
 
@@ -1669,7 +1669,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
        }
     }
 
-  sec = subseg_new (name, (subsegT) exp);
+  sec = subseg_new (name, exp);
 
   if (is_bss)
     seg_info (sec)->bss = 1;
index 8eb267d7782c0f0be9861f09b7dcee594c57037c..6ca2433b4b913712d2a74c62a2206977fa538e85 100644 (file)
@@ -1613,7 +1613,7 @@ obj_elf_bss (int i ATTRIBUTE_UNUSED)
   obj_elf_section_change_hook ();
 
   temp = get_absolute_expression ();
-  subseg_set (bss_section, (subsegT) temp);
+  subseg_set (bss_section, temp);
   demand_empty_rest_of_line ();
 
 #ifdef md_elf_section_change_hook
@@ -1687,7 +1687,7 @@ obj_elf_subsection (int ignore ATTRIBUTE_UNUSED)
   obj_elf_section_change_hook ();
 
   temp = get_absolute_expression ();
-  subseg_set (now_seg, (subsegT) temp);
+  subseg_set (now_seg, temp);
   demand_empty_rest_of_line ();
 
 #ifdef md_elf_section_change_hook
index c7171244acfa54faa20e1ca3395640c711d86c52..17bb697d796178c801bebceed51b87fb6aab981e 100644 (file)
@@ -552,7 +552,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED)
   new_seg = obj_mach_o_make_or_get_sect (segname, sectname, specified_mask,
                                         BFD_MACH_O_S_ZEROFILL,
                                         BFD_MACH_O_S_ATTR_NONE,
-                                        align, (offsetT) 0 /*stub size*/);
+                                        align, 0 /*stub size*/);
   if (new_seg == NULL)
     return;
 
index 9d2ae950a95cfb7fa74f12817acd9df6f3ac7239..3dfb0774cddbc5e37bcc1b94c4963386d70e7e68 100644 (file)
@@ -8662,7 +8662,7 @@ md_assemble (char *str)
   if (last_label_seen != NULL)
     {
       symbol_set_frag (last_label_seen, frag_now);
-      S_SET_VALUE (last_label_seen, (valueT) frag_now_fix ());
+      S_SET_VALUE (last_label_seen, frag_now_fix ());
       S_SET_SEGMENT (last_label_seen, now_seg);
     }
 
index 4a9255873b035f8dfb6b7821ae0d1c7a48161179..7c4cffba611af27e1b4119c49b538b671b4d3500 100644 (file)
@@ -1699,7 +1699,7 @@ alpha_align (int n,
   if (label != NULL && S_GET_SEGMENT (label) == now_seg)
     {
       symbol_set_frag (label, frag_now);
-      S_SET_VALUE (label, (valueT) frag_now_fix ());
+      S_SET_VALUE (label, frag_now_fix ());
     }
 
   record_alignment (now_seg, n);
@@ -5485,7 +5485,7 @@ md_begin (void)
 #ifdef OBJ_ELF
   if (ECOFF_DEBUGGING)
     {
-      segT sec = subseg_new (".mdebug", (subsegT) 0);
+      segT sec = subseg_new (".mdebug", 0);
       bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
       bfd_set_section_alignment (sec, 3);
     }
index 5b5b651dae8352f6c64ac339bf22a6b05469ba1a..5bf088d573608a1561a1aa2976a8a2e38d2a0d2b 100644 (file)
@@ -235,7 +235,7 @@ l_cons (int nbytes)
 
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
        code_label = 1;
-      emit_expr (&exp, (unsigned int) nbytes);
+      emit_expr (&exp, nbytes);
       ++c;
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
        {
index eca6ff17878b0dd5477f9189d25105dd1d8bbb30..cfd0b37c90d16266c76fbad2dda716062d79867f 100644 (file)
@@ -1950,11 +1950,11 @@ mapping_state (map_state state)
    {
      struct frag * const frag_first = seg_info (now_seg)->frchainP->frch_root;
      if (frag_now != frag_first || frag_now_fix () > 0)
-       make_mapping_symbol (MAP_DATA, (valueT) 0, frag_first);
+       make_mapping_symbol (MAP_DATA, 0, frag_first);
    }
 
   seg_info (now_seg)->tc_segment_info_data.current_state = state;
-  make_mapping_symbol (state, (valueT) frag_now_fix (), frag_now);
+  make_mapping_symbol (state, frag_now_fix (), frag_now);
 }
 
 /* Dump the literal pool.  */
@@ -7689,7 +7689,7 @@ csky_cons (int nbytes)
                        howto->name, nbytes);
              else
                {
-                 register char *p = frag_more ((int) nbytes);
+                 register char *p = frag_more (nbytes);
                  int offset = nbytes - size;
 
                  fix_new_exp (frag_now,
@@ -7698,7 +7698,7 @@ csky_cons (int nbytes)
                }
            }
          else
-           emit_expr (&exp, (unsigned int) nbytes);
+           emit_expr (&exp, nbytes);
          if (now_seg == text_section)
            poolspan += nbytes;
        }
index 532632ac8e9e17839d31be6f09c9531a18cec988..9292cfa2f9b4acde9f17b8b7dee49f38c5e69546 100644 (file)
@@ -18148,7 +18148,7 @@ s_bss (int ignore ATTRIBUTE_UNUSED)
   int temp;
 
   temp = get_absolute_expression ();
-  subseg_set (bss_section, (subsegT) temp);
+  subseg_set (bss_section, temp);
   demand_empty_rest_of_line ();
 }
 
@@ -18328,7 +18328,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
                          _("symbol size computation overflow"));
          fixp->fx_addsy = NULL;
          fixp->fx_subsy = NULL;
-         md_apply_fix (fixp, (valueT *) &value, NULL);
+         md_apply_fix (fixp, &value, NULL);
          return NULL;
        }
       if (!fixp->fx_addsy || fixp->fx_subsy)
index 160661ac1bbf1792e247ff1e18164908b8ab7cd4..ac610b77046c4e6104d4edba587ec1737dd32035 100644 (file)
@@ -5095,7 +5095,7 @@ dot_pred_rel (int type)
       if (count == 0)
        mask = ~(valueT) 0;
       clear_qp_mutex (mask);
-      clear_qp_implies (mask, (valueT) 0);
+      clear_qp_implies (mask, 0);
       break;
     case 'i':
       if (count != 2 || p1 == -1 || p2 == -1)
index 047dc6fd3bb552c089cb88c177888d7ae7178b20..b620d47366147944ce36a1fac458aac3188fbc40 100644 (file)
@@ -1755,8 +1755,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 
          unsigned int subtype;
          offsetT loc;
-         subtype = bfd_get_8 (NULL, &((fragS *)
-                     (fixP->fx_frag->fr_opcode))->fr_literal[fixP->fx_where]);
+         fragS *opfrag = (fragS *) fixP->fx_frag->fr_opcode;
+         subtype = bfd_get_8 (NULL, opfrag->fr_literal + fixP->fx_where);
          loc = fixP->fx_frag->fr_fix - (subtype & 7);
          switch (subtype)
            {
@@ -1792,7 +1792,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
              if (subtype < 0x80 && (subtype & 0x40))
                {
                  /* DW_CFA_advance_loc.  */
-                 fixP->fx_frag = (fragS *) fixP->fx_frag->fr_opcode;
+                 fixP->fx_frag = opfrag;
                  fixP->fx_next->fx_frag = fixP->fx_frag;
                  fixP->fx_r_type = BFD_RELOC_LARCH_ADD6;
                  fixP->fx_next->fx_r_type = BFD_RELOC_LARCH_SUB6;
index de51726d2b7faecac07bb16ccf998c1f4ec23b9d..410b6a81d65024c549cca3b47afbe0cd6207e3a9 100644 (file)
@@ -1581,7 +1581,7 @@ m32r_scomm (int ignore ATTRIBUTE_UNUSED)
     }
   else
     {
-      S_SET_VALUE (symbolP, (valueT) size);
+      S_SET_VALUE (symbolP, size);
       S_SET_ALIGN (symbolP, align2);
       S_SET_EXTERNAL (symbolP);
       S_SET_SEGMENT (symbolP, &scom_section);
index ad8ab96697af156e1ad0f8b6217e85b4bdbedf0e..aa1354f2aa977834ad2b1e74cc949182f908dcc9 100644 (file)
@@ -7904,7 +7904,7 @@ m68k_elf_cons (int nbytes /* 4=.long */)
            }
        }
       else
-       emit_expr (&exp, (unsigned int) nbytes);
+       emit_expr (&exp, nbytes);
     }
   while (*input_line_pointer++ == ',');
 
index 84ef1842a4e4edf4d6f37a45740b25221ddc8483..a1b56d73fdce16cd6ad5d489e0329325b081916d 100644 (file)
@@ -3881,7 +3881,7 @@ md_begin (void)
 
     if (mips_abi != N64_ABI)
       {
-       sec = subseg_new (".reginfo", (subsegT) 0);
+       sec = subseg_new (".reginfo", 0);
 
        bfd_set_section_flags (sec, flags);
        bfd_set_section_alignment (sec, HAVE_NEWABI ? 3 : 2);
@@ -3892,7 +3892,7 @@ md_begin (void)
       {
        /* The 64-bit ABI uses a .MIPS.options section rather than
           .reginfo section.  */
-       sec = subseg_new (".MIPS.options", (subsegT) 0);
+       sec = subseg_new (".MIPS.options", 0);
        bfd_set_section_flags (sec, flags);
        bfd_set_section_alignment (sec, 3);
 
@@ -3914,7 +3914,7 @@ md_begin (void)
        }
       }
 
-    sec = subseg_new (".MIPS.abiflags", (subsegT) 0);
+    sec = subseg_new (".MIPS.abiflags", 0);
     bfd_set_section_flags (sec,
                           SEC_READONLY | SEC_DATA | SEC_ALLOC | SEC_LOAD);
     bfd_set_section_alignment (sec, 3);
@@ -3922,13 +3922,13 @@ md_begin (void)
 
     if (ECOFF_DEBUGGING)
       {
-       sec = subseg_new (".mdebug", (subsegT) 0);
+       sec = subseg_new (".mdebug", 0);
        bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
        bfd_set_section_alignment (sec, 2);
       }
     else if (mips_flag_pdr)
       {
-       pdr_seg = subseg_new (".pdr", (subsegT) 0);
+       pdr_seg = subseg_new (".pdr", 0);
        bfd_set_section_flags (pdr_seg,
                               SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
        bfd_set_section_alignment (pdr_seg, 2);
@@ -6170,7 +6170,7 @@ match_float_constant (struct mips_arg_info *arg, expressionS *imm,
        newname = ".lit8";
     }
 
-  new_seg = subseg_new (newname, (subsegT) 0);
+  new_seg = subseg_new (newname, 0);
   bfd_set_section_flags (new_seg,
                         SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA);
   frag_align (length == 4 ? 2 : 3, 0, 0);
@@ -16337,13 +16337,12 @@ s_change_sec (int sec)
       s_data (0);
       break;
     case 'b':
-      subseg_set (bss_section, (subsegT) get_absolute_expression ());
+      subseg_set (bss_section, get_absolute_expression ());
       demand_empty_rest_of_line ();
       break;
 
     case 'r':
-      seg = subseg_new (RDATA_SECTION_NAME,
-                       (subsegT) get_absolute_expression ());
+      seg = subseg_new (RDATA_SECTION_NAME, get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
                                   | SEC_RELOC | SEC_DATA));
       if (!startswith (TARGET_OS, "elf"))
@@ -16352,7 +16351,7 @@ s_change_sec (int sec)
       break;
 
     case 's':
-      seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
+      seg = subseg_new (".sdata", get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                   | SEC_DATA | SEC_SMALL_DATA));
       if (!startswith (TARGET_OS, "elf"))
@@ -16361,7 +16360,7 @@ s_change_sec (int sec)
       break;
 
     case 'B':
-      seg = subseg_new (".sbss", (subsegT) get_absolute_expression ());
+      seg = subseg_new (".sbss", get_absolute_expression ());
       bfd_set_section_flags (seg, SEC_ALLOC | SEC_SMALL_DATA);
       if (!startswith (TARGET_OS, "elf"))
        record_alignment (seg, 4);
index 8b052dce9676f56959c2698efb48c2ef832ff46b..5ae158d6f8c8cd2ad191fe632884b94b4c727e9e 100644 (file)
@@ -4254,7 +4254,7 @@ mmix_cons (int nbytes)
       exp.X_unsigned = 0;
       exp.X_add_symbol = NULL;
       exp.X_op_symbol = NULL;
-      emit_expr (&exp, (unsigned int) nbytes);
+      emit_expr (&exp, nbytes);
     }
   else
     do
@@ -4272,7 +4272,7 @@ mmix_cons (int nbytes)
                exp.X_op = O_constant;
                exp.X_add_number = c;
                exp.X_unsigned = 1;
-               emit_expr (&exp, (unsigned int) nbytes);
+               emit_expr (&exp, nbytes);
              }
 
            if (input_line_pointer[-1] != '\"')
@@ -4289,7 +4289,7 @@ mmix_cons (int nbytes)
          default:
            {
              expression (&exp);
-             emit_expr (&exp, (unsigned int) nbytes);
+             emit_expr (&exp, nbytes);
              SKIP_WHITESPACE ();
            }
            break;
index 3e1385160749af121db035bcd9c6c79f7bfb9ed3..53fb2c1af48a37cabc30c4184801a579a1e5ee31 100644 (file)
@@ -4015,7 +4015,7 @@ add_mapping_symbol (enum mstate state, unsigned int padding_byte,
 
   /* start adding mapping symbol  */
   seg_info (now_seg)->tc_segment_info_data.mapstate = state;
-  make_mapping_symbol (state, (valueT) frag_now_fix () + padding_byte,
+  make_mapping_symbol (state, frag_now_fix () + padding_byte,
                       frag_now, align);
 }
 
index 93e7bf74a61e599dc51796d53148736d65ca76b1..08c3b7b8ef650c5f3e6a0d76f526a8a7b64659fc 100644 (file)
@@ -4640,7 +4640,7 @@ ppc_change_csect (symbolS *sym, offsetT align)
        frag_align (align, 0, 0);
 
       symbol_set_frag (sym, frag_now);
-      S_SET_VALUE (sym, (valueT) frag_now_fix ());
+      S_SET_VALUE (sym, frag_now_fix ());
 
       symbol_get_tc (sym)->align = align;
       symbol_get_tc (sym)->output = 1;
@@ -5120,7 +5120,7 @@ ppc_stabx (int ignore ATTRIBUTE_UNUSED)
       exp.X_add_number = 0;
       /* Fall through.  */
     case O_constant:
-      S_SET_VALUE (sym, (valueT) exp.X_add_number);
+      S_SET_VALUE (sym, exp.X_add_number);
       symbol_set_frag (sym, &zero_address_frag);
       break;
 
@@ -5647,7 +5647,7 @@ ppc_toc (int ignore ATTRIBUTE_UNUSED)
       sym = symbol_find_or_make ("TOC[TC0]");
       symbol_set_frag (sym, frag_now);
       S_SET_SEGMENT (sym, data_section);
-      S_SET_VALUE (sym, (valueT) frag_now_fix ());
+      S_SET_VALUE (sym, frag_now_fix ());
       symbol_get_tc (sym)->subseg = subseg;
       symbol_get_tc (sym)->output = 1;
       symbol_get_tc (sym)->within = sym;
@@ -5801,7 +5801,7 @@ ppc_tc (int ignore ATTRIBUTE_UNUSED)
 
     S_SET_SEGMENT (sym, now_seg);
     symbol_set_frag (sym, frag_now);
-    S_SET_VALUE (sym, (valueT) frag_now_fix ());
+    S_SET_VALUE (sym, frag_now_fix ());
 
     /* AIX assembler seems to allow any storage class to be set in .tc.
        But for now, only XMC_TC and XMC_TE are supported by us.  */
@@ -6141,8 +6141,7 @@ ppc_frob_symbol (symbolS *sym)
       if (symbol_get_tc (sym)->u.size != NULL)
        {
          resolve_symbol_value (symbol_get_tc (sym)->u.size);
-         SA_SET_SYM_FSIZE (sym,
-                           (long) S_GET_VALUE (symbol_get_tc (sym)->u.size));
+         SA_SET_SYM_FSIZE (sym, S_GET_VALUE (symbol_get_tc (sym)->u.size));
        }
       else
        {
index a6398fef68217e7e108c451f70064d1f20e894de..9e12ab68f7687b335b461f60bc2370fa7eb22f00 100644 (file)
@@ -1817,7 +1817,7 @@ pru_frob_label (symbolS *lab)
 
   /* Update the label's address with the current output pointer.  */
   symbol_set_frag (lab, frag_now);
-  S_SET_VALUE (lab, (valueT) frag_now_fix ());
+  S_SET_VALUE (lab, frag_now_fix ());
 
   /* Record this label for future adjustment after we find out what
      kind of data it references, and the required alignment therewith.  */
index 320ffecc2089cbcc96eed800c6158ed2e0eba9ce..6d4748ece023b766ccb6be0a390b1b3a9fb5b420 100644 (file)
@@ -1316,7 +1316,7 @@ s390_elf_cons (int nbytes /* 1=.byte, 2=.word, 4=.long */)
            as_bad (_("relocation not applicable"));
        }
       else
-       emit_expr (&exp, (unsigned int) nbytes);
+       emit_expr (&exp, nbytes);
     }
   while (*input_line_pointer++ == ',');
 
@@ -2083,7 +2083,7 @@ s390_literals (int ignore ATTRIBUTE_UNUSED)
 
   /* Emit symbol for start of literal pool.  */
   S_SET_SEGMENT (lp_sym, now_seg);
-  S_SET_VALUE (lp_sym, (valueT) frag_now_fix ());
+  S_SET_VALUE (lp_sym, frag_now_fix ());
   symbol_set_frag (lp_sym, frag_now);
 
   while (lpe_list)
@@ -2091,7 +2091,7 @@ s390_literals (int ignore ATTRIBUTE_UNUSED)
       lpe = lpe_list;
       lpe_list = lpe_list->next;
       S_SET_SEGMENT (lpe->sym, now_seg);
-      S_SET_VALUE (lpe->sym, (valueT) frag_now_fix ());
+      S_SET_VALUE (lpe->sym, frag_now_fix ());
       symbol_set_frag (lpe->sym, frag_now);
 
       /* Emit literal pool entry.  */
@@ -2501,7 +2501,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
        {
          /* Insert the fully resolved operand value.  */
          s390_insert_operand ((unsigned char *) where, operand,
-                              (offsetT) value, fixP->fx_file, fixP->fx_line, 0);
+                              value, fixP->fx_file, fixP->fx_line, 0);
          return;
        }
 
index 1c16ab3f986c941191cb5ad8db96ba838f5c0768..cf8687bb78f854fe314fd32740518e1f92d0323e 100644 (file)
@@ -5551,7 +5551,7 @@ s3_s_change_sec (int sec)
   switch (sec)
     {
     case 'r':
-      seg = subseg_new (s3_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
+      seg = subseg_new (s3_RDATA_SECTION_NAME, get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
                                   | SEC_RELOC | SEC_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
@@ -5559,7 +5559,7 @@ s3_s_change_sec (int sec)
       demand_empty_rest_of_line ();
       break;
     case 's':
-      seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
+      seg = subseg_new (".sdata", get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                   | SEC_DATA | SEC_SMALL_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
@@ -6458,7 +6458,7 @@ s3_begin (void)
   bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0);
   seg = now_seg;
   subseg = now_subseg;
-  s3_pdr_seg = subseg_new (".pdr", (subsegT) 0);
+  s3_pdr_seg = subseg_new (".pdr", 0);
   bfd_set_section_flags (s3_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
   bfd_set_section_alignment (s3_pdr_seg, 2);
   subseg_set (seg, subseg);
index bf15007941f8b8b692006c958c6cdf715f0e6efe..85437184b5b5d548e61ea595583623e5eb80d7b2 100644 (file)
@@ -5390,7 +5390,7 @@ s7_s_change_sec (int sec)
   switch (sec)
     {
     case 'r':
-      seg = subseg_new (s7_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
+      seg = subseg_new (s7_RDATA_SECTION_NAME, get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
                                   | SEC_RELOC | SEC_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
@@ -5398,7 +5398,7 @@ s7_s_change_sec (int sec)
       demand_empty_rest_of_line ();
       break;
     case 's':
-      seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
+      seg = subseg_new (".sdata", get_absolute_expression ());
       bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                   | SEC_DATA | SEC_SMALL_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
@@ -6089,7 +6089,7 @@ s7_begin (void)
   bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0);
   seg = now_seg;
   subseg = now_subseg;
-  s7_pdr_seg = subseg_new (".pdr", (subsegT) 0);
+  s7_pdr_seg = subseg_new (".pdr", 0);
   bfd_set_section_flags (s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
   bfd_set_section_alignment (s7_pdr_seg, 2);
   subseg_set (seg, subseg);
index c87a2e1239606b647e5d900fe4ca8e406f058860..2a259376710ca9d5c7f7bcd89cb77af8d6516965 100644 (file)
@@ -445,7 +445,7 @@ sh_elf_cons (int nbytes)
   do
     {
       expression (&exp);
-      emit_expr (&exp, (unsigned int) nbytes);
+      emit_expr (&exp, nbytes);
     }
   while (*input_line_pointer++ == ',');
 
index 062cb479a07625719194476f4bf89a277ffdd6f6..61f43e0ea08d0d16fc8ddde9c676365ce51f3fc0 100644 (file)
@@ -4345,7 +4345,7 @@ s_common (int ignore ATTRIBUTE_UNUSED)
       else
        {
        allocate_common:
-         S_SET_VALUE (symbolP, (valueT) size);
+         S_SET_VALUE (symbolP, size);
          S_SET_ALIGN (symbolP, temp);
          S_SET_SIZE (symbolP, size);
          S_SET_EXTERNAL (symbolP);
@@ -4551,7 +4551,7 @@ s_register (int ignore ATTRIBUTE_UNUSED)
              if (! (flags & (BSF_GLOBAL|BSF_LOCAL|BSF_WEAK)))
                flags |= BSF_GLOBAL;
              symbol_get_bfdsym (globals[reg])->flags = flags;
-             S_SET_VALUE (globals[reg], (valueT) reg);
+             S_SET_VALUE (globals[reg], reg);
              S_SET_ALIGN (globals[reg], reg);
              S_SET_SIZE (globals[reg], 0);
              /* Although we actually want undefined_section here,
index 0c88e60f8ae5207e781eac94c53f7959369ec89b..99ec7ecc178f5b34cf98447280190dbcb3e7b508 100644 (file)
@@ -668,7 +668,7 @@ s_tic6x_scomm (int ignore ATTRIBUTE_UNUSED)
     }
   else
     {
-      S_SET_VALUE (symbolP, (valueT) size);
+      S_SET_VALUE (symbolP, size);
       S_SET_ALIGN (symbolP, 1 << align2);
       S_SET_EXTERNAL (symbolP);
       S_SET_SEGMENT (symbolP, &scom_section);
index f86423da6d7820cab94f9ce0c9aa3748824230bd..7a903160110f078999694a4133590ae7e0abc275 100644 (file)
@@ -496,7 +496,7 @@ xstormy16_md_apply_fix (fixS *   fixP,
          CGEN_FIELDS *fields = xmalloc (CGEN_CPU_SIZEOF_FIELDS (cd));
 
          CGEN_CPU_SET_FIELDS_BITSIZE (cd) (fields, CGEN_INSN_BITSIZE (insn));
-         CGEN_CPU_SET_VMA_OPERAND (cd) (cd, opindex, fields, (bfd_vma) value);
+         CGEN_CPU_SET_VMA_OPERAND (cd) (cd, opindex, fields, value);
 
 #if CGEN_INT_INSN_P
          {
@@ -507,7 +507,7 @@ xstormy16_md_apply_fix (fixS *   fixP,
 
            /* ??? 0 is passed for `pc'.  */
            errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields,
-                                                  &insn_value, (bfd_vma) 0);
+                                                  &insn_value, 0);
            cgen_put_insn_value (cd, (unsigned char *) where,
                                 CGEN_INSN_BITSIZE (insn), insn_value,
                                 gas_cgen_cpu_desc->insn_endian);
@@ -516,7 +516,7 @@ xstormy16_md_apply_fix (fixS *   fixP,
          /* ??? 0 is passed for `pc'.  */
          errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields,
                                                 (unsigned char *) where,
-                                                (bfd_vma) 0);
+                                                0);
 #endif
          if (errmsg)
            as_bad_where (fixP->fx_file, fixP->fx_line, "%s", errmsg);
index 144016962cb0f9484a72b6927e029b6f987e53f5..38af6d0c95985144b5e1db7c7fe7d10b40e21233 100644 (file)
@@ -1705,7 +1705,7 @@ xtensa_elf_cons (int nbytes)
            as_bad (_("invalid use of %s relocation"), reloc_howto->name);
          else
            {
-             char *p = frag_more ((int) nbytes);
+             char *p = frag_more (nbytes);
              xtensa_set_frag_assembly_state (frag_now);
              fix_new_exp (frag_now, p - frag_now->fr_literal,
                           nbytes, &exp, reloc_howto->pc_relative, reloc);
@@ -1714,7 +1714,7 @@ xtensa_elf_cons (int nbytes)
       else
        {
          xtensa_set_frag_assembly_state (frag_now);
-         emit_expr (&exp, (unsigned int) nbytes);
+         emit_expr (&exp, nbytes);
        }
     }
   while (*input_line_pointer++ == ',');
@@ -5378,7 +5378,7 @@ xtensa_frob_label (symbolS *sym)
   /* Since the label was already attached to a frag associated with the
      previous basic block, it now needs to be reset to the current frag.  */
   symbol_set_frag (sym, frag_now);
-  S_SET_VALUE (sym, (valueT) frag_now_fix ());
+  S_SET_VALUE (sym, frag_now_fix ());
 
   if (generating_literals)
     xtensa_add_literal_sym (sym);
index 7ffd82e04539c1658dbc98efc5b736f5905afa24..e7f014cb84daa4057c5d74a6e475b16da903564b 100644 (file)
@@ -3720,7 +3720,7 @@ is_overflow (long value, unsigned bitsize)
 {
   if (value < 0)
     return signed_overflow (value, bitsize);
-  return unsigned_overflow ((unsigned long)value, bitsize);
+  return unsigned_overflow (value, bitsize);
 }
 
 void
index db3d862deeb0c4574a98a4d163fb4aee1f512425..ba8f6d8eaea3cf33aca8c80dc5d628ca59669248 100644 (file)
@@ -1943,7 +1943,7 @@ add_aux_sym_tir (type_info_t *t,  /* current type information */
      for an enum bitfield.  */
 
   if (t->bitfield)
-    (void) add_aux_sym_symint ((symint_t) t->sizes[t->num_sizes - 1]);
+    (void) add_aux_sym_symint (t->sizes[t->num_sizes - 1]);
 
   /* Add tag information if needed.  Structure, union, and enum
      references add 2 aux symbols: a [file index, symbol index]
@@ -1984,7 +1984,7 @@ add_aux_sym_tir (type_info_t *t,  /* current type information */
                               cur_file_ptr->int_type);
 
       (void) add_aux_sym_symint (cur_file_ptr->file_index);    /* file index*/
-      (void) add_aux_sym_symint ((symint_t) 0);                        /* low bound */
+      (void) add_aux_sym_symint (0);                           /* low bound */
       (void) add_aux_sym_symint (t->dimensions[i] - 1);                /* high bound*/
       (void) add_aux_sym_symint ((t->dimensions[i] == 0)       /* stride */
                                 ? 0
@@ -2925,9 +2925,7 @@ ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
   if (coff_symbol_typ == st_Block)
     {
       /* Create or update the tag information.  */
-      tag_t *tag_ptr = get_tag (name,
-                               sym,
-                               coff_type.basic_type);
+      tag_t *tag_ptr = get_tag (name, sym, coff_type.basic_type);
       forward_t **pf;
 
       /* Remember any forward references.  */
@@ -3432,7 +3430,7 @@ ecoff_stab (int what,
 
 #ifndef NO_LISTING
       if (listing)
-       listing_source_line ((unsigned int) desc);
+       listing_source_line (desc);
 #endif
 
       dummy_symr.index = desc;
index 5a3d6ae662d58851c65e765f682575f615d015c1..e01d6397fd146c3584c16cff0e39fececd0ce686 100644 (file)
@@ -1856,7 +1856,7 @@ s_comm_internal (int param,
     symbolP = (*comm_parse_extra) (param, symbolP, size);
   else
     {
-      S_SET_VALUE (symbolP, (valueT) size);
+      S_SET_VALUE (symbolP, size);
       S_SET_EXTERNAL (symbolP);
       S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
     }
@@ -1993,7 +1993,7 @@ s_data (int ignore ATTRIBUTE_UNUSED)
   else
     section = data_section;
 
-  subseg_set (section, (subsegT) temp);
+  subseg_set (section, temp);
 
   demand_empty_rest_of_line ();
 }
@@ -2423,7 +2423,7 @@ s_fill (int ignore ATTRIBUTE_UNUSED)
          p = frag_var (rs_space, size, size, 0, rep_sym, 0, NULL);
        }
 
-      memset (p, 0, (unsigned int) size);
+      memset (p, 0, size);
 
       /* The magic number BSD_FILL_SIZE_CROCK_4 is from BSD 4.2 VAX
         flavoured AS.  The following bizarre behaviour is to be
@@ -2760,7 +2760,7 @@ s_lsym (int ignore ATTRIBUTE_UNUSED)
                     (exp.X_op == O_constant
                      ? absolute_section
                      : reg_section));
-      S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
+      S_SET_VALUE (symbolP, exp.X_add_number);
     }
   else
     {
@@ -3895,7 +3895,7 @@ s_float_space (int float_type)
       char *p;
 
       p = frag_more (flen);
-      memcpy (p, temp, (unsigned int) flen);
+      memcpy (p, temp, flen);
     }
 
   demand_empty_rest_of_line ();
@@ -3933,7 +3933,7 @@ s_text (int ignore ATTRIBUTE_UNUSED)
   int temp;
 
   temp = get_absolute_expression ();
-  subseg_set (text_section, (subsegT) temp);
+  subseg_set (text_section, temp);
   demand_empty_rest_of_line ();
 }
 
@@ -4331,7 +4331,7 @@ cons_worker (int nbytes,  /* 1=.byte, 2=.word, 4=.long.  */
 
 #ifdef TC_M68K
       if (flag_m68k_mri)
-       parse_mri_cons (&exp, (unsigned int) nbytes);
+       parse_mri_cons (&exp, nbytes);
       else
 #endif
        {
@@ -4343,7 +4343,7 @@ cons_worker (int nbytes,  /* 1=.byte, 2=.word, 4=.long.  */
              return;
            }
 #endif
-         ret = TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
+         ret = TC_PARSE_CONS_EXPRESSION (&exp, nbytes);
        }
 
       if (rva)
@@ -4353,7 +4353,7 @@ cons_worker (int nbytes,  /* 1=.byte, 2=.word, 4=.long.  */
          else
            as_fatal (_("rva without symbol"));
        }
-      emit_expr_with_reloc (&exp, (unsigned int) nbytes, ret);
+      emit_expr_with_reloc (&exp, nbytes, ret);
 #ifdef TC_CONS_FIX_CHECK
       TC_CONS_FIX_CHECK (&exp, nbytes, *cur_fix);
 #endif
@@ -4559,7 +4559,7 @@ emit_expr_with_reloc (expressionS *exp,
           && nbytes == 2
           && exp->X_op == O_constant
           && (exp->X_add_number == -1 || exp->X_add_number == 0xffff))
-    listing_source_line ((unsigned int) dwarf_line);
+    listing_source_line (dwarf_line);
   else if (nbytes == 4
           && exp->X_op == O_constant
           && exp->X_add_number >= 0)
@@ -4672,7 +4672,7 @@ emit_expr_with_reloc (expressionS *exp,
     as_bad (_("attempt to store non-zero value in section `%s'"),
            segment_name (now_seg));
 
-  p = frag_more ((int) nbytes);
+  p = frag_more (nbytes);
 
   if (reloc != TC_PARSE_CONS_RETURN_NONE)
     {
@@ -5158,7 +5158,7 @@ float_cons (/* Clobbers input_line-pointer, checks end-of-line.  */
          while (--count >= 0)
            {
              p = frag_more (length);
-             memcpy (p, temp, (unsigned int) length);
+             memcpy (p, temp, length);
            }
        }
       SKIP_WHITESPACE ();
@@ -5228,7 +5228,7 @@ unsigned int
 sizeof_leb128 (valueT value, int sign)
 {
   if (sign)
-    return sizeof_sleb128 ((offsetT) value);
+    return sizeof_sleb128 (value);
   else
     return sizeof_uleb128 (value);
 }
@@ -5287,7 +5287,7 @@ unsigned int
 output_leb128 (char *p, valueT value, int sign)
 {
   if (sign)
-    return output_sleb128 (p, (offsetT) value);
+    return output_sleb128 (p, value);
   else
     return output_uleb128 (p, value);
 }
index da5228f680c5fc65d81674eac57d35c32e7a46dc..12b1267ff84d9a1a42b73675af34f24ebdb09792 100644 (file)
@@ -163,7 +163,7 @@ aout_process_stab (int what, const char *string, int type, int other, int desc)
       /* .stabd sets the name to NULL.  Why?  */
       S_SET_NAME (symbol, NULL);
       symbol_set_frag (symbol, frag_now);
-      S_SET_VALUE (symbol, (valueT) frag_now_fix ());
+      S_SET_VALUE (symbol, frag_now_fix ());
     }
 
   symbol_append (symbol, symbol_lastP, &symbol_rootP, &symbol_lastP);
@@ -323,7 +323,7 @@ s_stab_generic (int what,
       switch (type)
        {
        case N_SLINE:
-         listing_source_line ((unsigned int) desc);
+         listing_source_line (desc);
          break;
        case N_SO:
        case N_SOL:
index 775736f5a5396acf17eabfa836e5d546c2b7dbbd..5d6d141e04a2d87b5391dc8dddd0d5da43e518d9 100644 (file)
@@ -491,7 +491,7 @@ static void
 define_sym_at_dot (symbolS *symbolP)
 {
   symbolP->frag = frag_now;
-  S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
+  S_SET_VALUE (symbolP, frag_now_fix ());
   S_SET_SEGMENT (symbolP, now_seg);
 }
 
@@ -626,11 +626,8 @@ colon (/* Just seen "x:" - rattle symbols & frags.  */
                         If the new size is larger we just change its
                         value.  If the new size is smaller, we ignore
                         this symbol.  */
-                     if (S_GET_VALUE (symbolP)
-                         < ((unsigned) frag_now_fix ()))
-                       {
-                         S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
-                       }
+                     if (S_GET_VALUE (symbolP) < frag_now_fix ())
+                       S_SET_VALUE (symbolP, frag_now_fix ());
                    }
                  else
                    {
index 02dfcc7001750a400d806b4271a689662f57dd09..ca6fedf743c831e5db023906e10530011b983264 100644 (file)
@@ -1668,9 +1668,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
 
       if (f->fr_fix)
        {
-         x = bfd_set_section_contents (stdoutput, sec,
-                                       f->fr_literal, (file_ptr) offset,
-                                       (bfd_size_type) f->fr_fix);
+         x = bfd_set_section_contents (stdoutput, sec, f->fr_literal,
+                                       offset, f->fr_fix);
          if (!x)
            as_fatal (ngettext ("can't write %ld byte "
                                "to section %s of %s: '%s'",
@@ -1694,10 +1693,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
              /* Do it the old way. Can this ever happen?  */
              while (count--)
                {
-                 x = bfd_set_section_contents (stdoutput, sec,
-                                               fill_literal,
-                                               (file_ptr) offset,
-                                               (bfd_size_type) fill_size);
+                 x = bfd_set_section_contents (stdoutput, sec, fill_literal,
+                                               offset, fill_size);
                  if (!x)
                    as_fatal (ngettext ("can't fill %ld byte "
                                        "in section %s of %s: '%s'",
@@ -1732,9 +1729,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
              for (; count > 0; count -= n_per_buf)
                {
                  n_per_buf = n_per_buf > count ? count : n_per_buf;
-                 x = bfd_set_section_contents
-                   (stdoutput, sec, buf, (file_ptr) offset,
-                    (bfd_size_type) n_per_buf * fill_size);
+                 x = bfd_set_section_contents (stdoutput, sec, buf, offset,
+                                               n_per_buf * fill_size);
                  if (!x)
                    as_fatal (ngettext ("can't fill %ld byte "
                                        "in section %s of %s: '%s'",
@@ -2896,8 +2892,7 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass)
                            {
                              char buf[50];
 
-                             bfd_sprintf_vma (stdoutput, buf,
-                                              (addressT) lie->addnum);
+                             bfd_sprintf_vma (stdoutput, buf, lie->addnum);
                              as_warn_where (fragP->fr_file, fragP->fr_line,
                                             _(".word %s-%s+%s didn't fit"),
                                             S_GET_NAME (lie->add),