From: Alan Modra Date: Tue, 8 Jul 2025 23:42:53 +0000 (+0930) Subject: gas function arg casts X-Git-Tag: binutils-2_45~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c78eda50fe3651e57c12d6ad850c2af2685ec30a;p=thirdparty%2Fbinutils-gdb.git gas function arg casts This patch removes more unnecessary arg casts in various function calls. --- diff --git a/gas/cgen.c b/gas/cgen.c index f5b9030a019..605dd3cf251 100644 --- a/gas/cgen.c +++ b/gas/cgen.c @@ -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); diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 3467d646428..be6a9657628 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -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; diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 8eb267d7782..6ca2433b4b9 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -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 diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index c7171244acf..17bb697d796 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -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; diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 9d2ae950a95..3dfb0774cdd 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -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); } diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 4a9255873b0..7c4cffba611 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -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); } diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index 5b5b651dae8..5bf088d5736 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -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')) { diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c index eca6ff17878..cfd0b37c90d 100644 --- a/gas/config/tc-csky.c +++ b/gas/config/tc-csky.c @@ -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; } diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 532632ac8e9..9292cfa2f9b 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -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) diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 160661ac1bb..ac610b77046 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -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) diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 047dc6fd3bb..b620d473661 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -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; diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index de51726d2b7..410b6a81d65 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -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); diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index ad8ab96697a..aa1354f2aa9 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -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++ == ','); diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 84ef1842a4e..a1b56d73fdc 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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); diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c index 8b052dce967..5ae158d6f8c 100644 --- a/gas/config/tc-mmix.c +++ b/gas/config/tc-mmix.c @@ -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; diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index 3e138516074..53fb2c1af48 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -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); } diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 93e7bf74a61..08c3b7b8ef6 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -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 { diff --git a/gas/config/tc-pru.c b/gas/config/tc-pru.c index a6398fef682..9e12ab68f76 100644 --- a/gas/config/tc-pru.c +++ b/gas/config/tc-pru.c @@ -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. */ diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 320ffecc208..6d4748ece02 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -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; } diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c index 1c16ab3f986..cf8687bb78f 100644 --- a/gas/config/tc-score.c +++ b/gas/config/tc-score.c @@ -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); diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c index bf15007941f..85437184b5b 100644 --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -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); diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index c87a2e12396..2a259376710 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -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++ == ','); diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 062cb479a07..61f43e0ea08 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -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, diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c index 0c88e60f8ae..99ec7ecc178 100644 --- a/gas/config/tc-tic6x.c +++ b/gas/config/tc-tic6x.c @@ -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); diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c index f86423da6d7..7a903160110 100644 --- a/gas/config/tc-xstormy16.c +++ b/gas/config/tc-xstormy16.c @@ -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); diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 144016962cb..38af6d0c959 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -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); diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 7ffd82e0453..e7f014cb84d 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -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 diff --git a/gas/ecoff.c b/gas/ecoff.c index db3d862deeb..ba8f6d8eaea 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -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; diff --git a/gas/read.c b/gas/read.c index 5a3d6ae662d..e01d6397fd1 100644 --- a/gas/read.c +++ b/gas/read.c @@ -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); } diff --git a/gas/stabs.c b/gas/stabs.c index da5228f680c..12b1267ff84 100644 --- a/gas/stabs.c +++ b/gas/stabs.c @@ -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: diff --git a/gas/symbols.c b/gas/symbols.c index 775736f5a53..5d6d141e04a 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -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 { diff --git a/gas/write.c b/gas/write.c index 02dfcc70017..ca6fedf743c 100644 --- a/gas/write.c +++ b/gas/write.c @@ -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),