From: Alan Modra Date: Mon, 29 Jun 2020 00:37:56 +0000 (+0930) Subject: C++ comments X-Git-Url: http://git.efficios.com/?p=deliverable%2Fbinutils-gdb.git;a=commitdiff_plain;h=279edac53db8fa6482ee3e305c9627f788fd2699 C++ comments binutils isn't c99 (yet). This replaces or removes some C++ style comments. bfd/ * arc-got.h: Use C style comments. * coff-z80.c: Likewise. * elf32-csky.c: Likewise. * peXXigen.c: Likewise. * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out code. binutils/ * dwarf.c: Use C style comments. * resrc.c: Likewise. gas/ * config/tc-s12z.c: Use C style comments. * config/tc-z80.c: Likewise. * config/tc-xtensa.c (emit_ld_r_n): Remove commented out code. include/ * coff/internal.h: Use C style comments. * coff/pe.h: Likewise. * elf/ppc64.h: Likewise. opcodes/ * arm-dis.c: Use C style comments. * cr16-opc.c: Likewise. * ft32-dis.c: Likewise. * moxie-opc.c: Likewise. * tic54x-dis.c: Likewise. * s12z-opc.c: Remove useless comment. * xgate-dis.c: Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7b6375a0f7..4a87b3bb5c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2020-06-29 Alan Modra + + * arc-got.h: Use C style comments. + * coff-z80.c: Likewise. + * elf32-csky.c: Likewise. + * peXXigen.c: Likewise. + * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out + code. + 2020-06-26 Pat Bernardi * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function. diff --git a/bfd/arc-got.h b/bfd/arc-got.h index 762d84dab0..8053a2d907 100644 --- a/bfd/arc-got.h +++ b/bfd/arc-got.h @@ -296,7 +296,7 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p, if (h != NULL) { - // TODO: This should not be here. + /* TODO: This should not be here. */ reloc_data->sym_value = h->root.u.def.value; reloc_data->sym_section = h->root.u.def.section; diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c index 8913fb5bf9..16f83cfeef 100644 --- a/bfd/coff-z80.c +++ b/bfd/coff-z80.c @@ -373,7 +373,7 @@ extra_case (bfd *in_abfd, case R_IMM8: if (reloc->howto->partial_inplace) val += bfd_get_8 ( in_abfd, data+*src_ptr) & reloc->howto->src_mask; - //fallthrough + /* Fall through. */ case R_BYTE0: bfd_put_8 (in_abfd, val, data + *dst_ptr); (*dst_ptr) += 1; @@ -389,7 +389,7 @@ extra_case (bfd *in_abfd, case R_IMM16: if (reloc->howto->partial_inplace) val += bfd_get_16 ( in_abfd, data+*src_ptr) & reloc->howto->src_mask; - //fallthrough + /* Fall through. */ case R_WORD0: bfd_put_16 (in_abfd, val, data + *dst_ptr); (*dst_ptr) += 2; diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c index ea58e14c00..669284bcfa 100644 --- a/bfd/elf32-csky.c +++ b/bfd/elf32-csky.c @@ -3738,8 +3738,8 @@ csky_relocate_contents (reloc_howto_type *howto, /* FIXME: these macros should be defined at file head or head file head. */ #define CSKY_INSN_ADDI_TO_SUBI 0x04000000 -#define CSKY_INSN_MOV_RTB 0xc41d4820 // mov32 rx, r29, 0 -#define CSKY_INSN_MOV_RDB 0xc41c4820 // mov32 rx, r28, 0 +#define CSKY_INSN_MOV_RTB 0xc41d4820 /* mov32 rx, r29, 0 */ +#define CSKY_INSN_MOV_RDB 0xc41c4820 /* mov32 rx, r28, 0 */ #define CSKY_INSN_GET_ADDI_RZ(x) (((x) & 0x03e00000) >> 21) #define CSKY_INSN_SET_MOV_RZ(x) ((x) & 0x0000001f) #define CSKY_INSN_JSRI_TO_LRW 0xea9a0000 diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 7a97d6d909..d839f62483 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -2072,7 +2072,6 @@ m32c_elf_relax_delete_bytes symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) - symtab_hdr->sh_info); sym_hashes = elf_sym_hashes (abfd); - // sym_hashes += symtab_hdr->sh_info; end_hashes = sym_hashes + symcount; for (; sym_hashes < end_hashes; sym_hashes ++) diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index c33c495a0f..b3b68085dd 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -1176,7 +1176,7 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length memcpy (&(cvinfo->Signature[8]), &(cvinfo70->Signature[8]), 8); cvinfo->SignatureLength = CV_INFO_SIGNATURE_LENGTH; - // cvinfo->PdbFileName = cvinfo70->PdbFileName; + /* cvinfo->PdbFileName = cvinfo70->PdbFileName; */ return cvinfo; } @@ -1187,7 +1187,7 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length cvinfo->Age = H_GET_32(abfd, cvinfo20->Age); memcpy (cvinfo->Signature, cvinfo20->Signature, 4); cvinfo->SignatureLength = 4; - // cvinfo->PdbFileName = cvinfo20->PdbFileName; + /* cvinfo->PdbFileName = cvinfo20->PdbFileName; */ return cvinfo; } @@ -2929,7 +2929,7 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: subsystem_name = "Wince CUI"; break; - // These are from UEFI Platform Initialization Specification 1.1. + /* These are from UEFI Platform Initialization Specification 1.1. */ case IMAGE_SUBSYSTEM_EFI_APPLICATION: subsystem_name = "EFI application"; break; @@ -2942,11 +2942,11 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) case IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER: subsystem_name = "SAL runtime driver"; break; - // This is from revision 8.0 of the MS PE/COFF spec + /* This is from revision 8.0 of the MS PE/COFF spec */ case IMAGE_SUBSYSTEM_XBOX: subsystem_name = "XBOX"; break; - // Added default case for clarity - subsystem_name is NULL anyway. + /* Added default case for clarity - subsystem_name is NULL anyway. */ default: subsystem_name = NULL; } diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 13d9c3e057..657bc9591b 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2020-06-29 Alan Modra + + * dwarf.c: Use C style comments. + * resrc.c: Likewise. + 2020-06-27 Alan Modra * elfcomm.c (setup_nested_archive): Set nested_arch->file to NULL diff --git a/binutils/dwarf.c b/binutils/dwarf.c index e2f217ee0b..6e61bfdca1 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -9216,10 +9216,10 @@ display_debug_names (struct dwarf_section *section, void *file) unsigned char *entryptr = entry_pool + entry_offset; - // We need to scan first whether there is a single or multiple - // entries. TAGNO is -2 for the first entry, it is -1 for the - // initial tag read of the second entry, then it becomes 0 for the - // first entry for real printing etc. + /* We need to scan first whether there is a single or multiple + entries. TAGNO is -2 for the first entry, it is -1 for the + initial tag read of the second entry, then it becomes 0 for the + first entry for real printing etc. */ int tagno = -2; /* Initialize it due to a false compiler warning. */ dwarf_vma second_abbrev_tag = -1; diff --git a/binutils/resrc.c b/binutils/resrc.c index 1d43355915..a875c3a4ac 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -674,7 +674,7 @@ get_long (FILE *e, const char *msg) static void get_data (FILE *e, bfd_byte *p, rc_uint_type c, const char *msg) { - rc_uint_type got; // $$$d + rc_uint_type got; /* $$$d */ got = (rc_uint_type) fread (p, 1, c, e); if (got == c) diff --git a/gas/ChangeLog b/gas/ChangeLog index af34ad85ae..a498748a9a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2020-06-29 Alan Modra + + * config/tc-s12z.c: Use C style comments. + * config/tc-z80.c: Likewise. + * config/tc-xtensa.c (emit_ld_r_n): Remove commented out code. + 2020-06-26 H.J. Lu * config/tc-i386.c (md_assemble): Process ImmExt without diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c index 91480de405..d89fb0c21f 100644 --- a/gas/config/tc-s12z.c +++ b/gas/config/tc-s12z.c @@ -1325,20 +1325,20 @@ mul_reg_opr_opr (const struct instruction *insn) static const uint8_t reg_map [] = { - 0x02, // D2 - 0x01, // D3 + 0x02, /* D2 */ + 0x01, /* D3 */ 0x20, - 0x10, // D5 - 0x08, // D0 - 0x04, // D1 - 0x08, // D6 - 0x04, // D7 + 0x10, /* D5 */ + 0x08, /* D0 */ + 0x04, /* D1 */ + 0x08, /* D6 */ + 0x04, /* D7 */ 0x02, - 0x01, // Y + 0x01, /* Y */ 0x00, 0x00, - 0x20, // CCH - 0x10, // CCL + 0x20, /* CCH */ + 0x10, /* CCL */ 0x00 }; @@ -3595,8 +3595,6 @@ static const struct instruction opcodes[] = { {"divu.lp", 2, 0x30, mul_reg_opr_opr, 0}, {"divu.ll", 2, 0x30, mul_reg_opr_opr, 0}, - // - {"qmuls", 2, 0xb0, mul_reg_reg_reg, 0}, {"qmulu", 2, 0xb0, mul_reg_reg_reg, 0}, @@ -3656,9 +3654,6 @@ static const struct instruction opcodes[] = { {"qmulu.lp", 2, 0xb0, mul_reg_opr_opr, 0}, {"qmulu.ll", 2, 0xb0, mul_reg_opr_opr, 0}, - - // - {"macs", 2, 0x48, mul_reg_reg_reg, 0}, {"macu", 2, 0x48, mul_reg_reg_reg, 0}, @@ -3718,9 +3713,6 @@ static const struct instruction opcodes[] = { {"macu.lp", 2, 0x48, mul_reg_opr_opr, 0}, {"macu.ll", 2, 0x48, mul_reg_opr_opr, 0}, - - // - {"mods", 2, 0x38, mul_reg_reg_reg, 0}, {"modu", 2, 0x38, mul_reg_reg_reg, 0}, diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index b512f7a36b..e4a234abb1 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -7882,7 +7882,7 @@ dump_litpools (void) printf(" %ld <%d:%d> (%d) [%d]: ", lpf->addr, lpf->priority, lpf->original_priority, lpf->fragP->fr_line, count); - //dump_frag(lpf->fragP); + /* dump_frag(lpf->fragP); */ } } } diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 59cda3d03c..d9a8aa5fb8 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -2390,7 +2390,6 @@ emit_ld_r_n (expressionS *dst, expressionS *src) break; default: ill_op (); -// return; } q = frag_more (prefix ? 2 : 1); diff --git a/include/ChangeLog b/include/ChangeLog index dc7089ef80..850da739a1 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,9 @@ +2020-06-29 Alan Modra + + * coff/internal.h: Use C style comments. + * coff/pe.h: Likewise. + * elf/ppc64.h: Likewise. + 2020-06-26 Nick Alcock * ctf-api.h (ctf_arc_bufopen): New. diff --git a/include/coff/internal.h b/include/coff/internal.h index 2b6c08cb50..9f62699c24 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -161,7 +161,7 @@ typedef struct _CODEVIEW_INFO char Signature[CV_INFO_SIGNATURE_LENGTH]; unsigned int SignatureLength; unsigned long Age; - // char PdbFileName[]; + /* char PdbFileName[]; */ } CODEVIEW_INFO; /* Default image base for NT. */ diff --git a/include/coff/pe.h b/include/coff/pe.h index efb7075754..c83a958eee 100644 --- a/include/coff/pe.h +++ b/include/coff/pe.h @@ -578,10 +578,10 @@ struct external_IMAGE_DEBUG_DIRECTORY /* Extra structures used in codeview debug record. */ /* This is not part of the PE specification. */ -#define CVINFO_PDB70_CVSIGNATURE 0x53445352 // "RSDS" -#define CVINFO_PDB20_CVSIGNATURE 0x3031424e // "NB10" -#define CVINFO_CV50_CVSIGNATURE 0x3131424e // "NB11" -#define CVINFO_CV41_CVSIGNATURE 0x3930424e // "NB09" +#define CVINFO_PDB70_CVSIGNATURE 0x53445352 /* "RSDS" */ +#define CVINFO_PDB20_CVSIGNATURE 0x3031424e /* "NB10" */ +#define CVINFO_CV50_CVSIGNATURE 0x3131424e /* "NB11" */ +#define CVINFO_CV41_CVSIGNATURE 0x3930424e /* "NB09" */ typedef struct _CV_INFO_PDB70 { diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h index f7034ec24b..f3e478fdfd 100644 --- a/include/elf/ppc64.h +++ b/include/elf/ppc64.h @@ -256,14 +256,14 @@ END_RELOC_NUMBERS (R_PPC64_max) #define STO_PPC64_LOCAL_BIT 5 #define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT) -// 3 bit other field to bytes. +/* 3 bit other field to bytes. */ static inline unsigned int ppc64_decode_local_entry(unsigned int other) { return ((1 << other) >> 2) << 2; } -// bytes to field value. +/* bytes to field value. */ static inline unsigned int ppc64_encode_local_entry(unsigned int val) { diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 17806b432b..46300b55ac 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,13 @@ +2020-06-29 Alan Modra + + * arm-dis.c: Use C style comments. + * cr16-opc.c: Likewise. + * ft32-dis.c: Likewise. + * moxie-opc.c: Likewise. + * tic54x-dis.c: Likewise. + * s12z-opc.c: Remove useless comment. + * xgate-dis.c: Likewise. + 2020-06-26 H.J. Lu * i386-opc.tbl: Add a blank line. diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index de62328ec9..1b63bd3d5f 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -7034,14 +7034,14 @@ print_simd_imm8 (struct disassemble_info *info, unsigned long given, return; } - // printU determines whether the immediate value should be printed as - // unsigned. + /* printU determines whether the immediate value should be printed as + unsigned. */ unsigned printU = 0; switch (insn->mve_op) { default: break; - // We want this for instructions that don't have a 'signed' type + /* We want this for instructions that don't have a 'signed' type. */ case MVE_VBIC_IMM: case MVE_VORR_IMM: case MVE_VMVN_IMM: diff --git a/opcodes/cr16-opc.c b/opcodes/cr16-opc.c index f3032634b5..a9d1378b3b 100644 --- a/opcodes/cr16-opc.c +++ b/opcodes/cr16-opc.c @@ -493,7 +493,7 @@ const reg_entry cr16_regptab[] = REG_RP(9,8), REG_RP(10,9), REG_RP(11,10), REG_RP(12,11), REG((r12), 0xc, CR16_RP_REGTYPE), REG((r13), 0xd, CR16_RP_REGTYPE), - //REG((r14), 0xe, CR16_RP_REGTYPE), + /* REG((r14), 0xe, CR16_RP_REGTYPE), */ REG((ra), 0xe, CR16_RP_REGTYPE), REG((sp), 0xf, CR16_RP_REGTYPE), }; diff --git a/opcodes/ft32-dis.c b/opcodes/ft32-dis.c index 5f42fff4f5..f486b38d9c 100644 --- a/opcodes/ft32-dis.c +++ b/opcodes/ft32-dis.c @@ -81,7 +81,7 @@ ft32_opcode(bfd_vma addr ATTRIBUTE_UNUSED, switch (lobit) { case FT32_FLD_CBCRCV: - // imm is {CB, CV} + /* imm is {CB, CV} */ imm = ((iword >> FT32_FLD_CB_BIT) & ((1 << FT32_FLD_CB_SIZ) - 1)) << 4; imm |= ((iword >> FT32_FLD_CV_BIT) & ((1 << FT32_FLD_CV_SIZ) - 1)); switch (imm) diff --git a/opcodes/moxie-opc.c b/opcodes/moxie-opc.c index beff0373b1..b5a6ae8fc7 100644 --- a/opcodes/moxie-opc.c +++ b/opcodes/moxie-opc.c @@ -52,7 +52,7 @@ const moxie_opc_info_t moxie_form1_opc_info[128] = { - { 0x00, MOXIE_BAD, "bad" }, // Reserved as bad. + { 0x00, MOXIE_BAD, "bad" }, /* Reserved as bad. */ { 0x01, MOXIE_F1_A4, "ldi.l" }, { 0x02, MOXIE_F1_AB, "mov" }, { 0x03, MOXIE_F1_M, "jsra" }, @@ -207,5 +207,5 @@ const moxie_opc_info_t moxie_form3_opc_info[16] = { 0x0c, MOXIE_BAD, "bad" }, { 0x0d, MOXIE_BAD, "bad" }, { 0x0e, MOXIE_BAD, "bad" }, - { 0x0f, MOXIE_BAD, "bad" } // Reserved as bad. + { 0x0f, MOXIE_BAD, "bad" } /* Reserved as bad. */ }; diff --git a/opcodes/s12z-opc.c b/opcodes/s12z-opc.c index b68a4b815c..980fa7875a 100644 --- a/opcodes/s12z-opc.c +++ b/opcodes/s12z-opc.c @@ -1962,7 +1962,7 @@ static const struct bm bm_table[] = { { 0x84, 0x00, BM_REG_IMM}, { 0x06, 0x06, BM_REG_IMM}, { 0xC6, 0x44, BM_RESERVED0}, - // 00 + { 0x8F, 0x80, BM_OPR_B}, { 0x8E, 0x82, BM_OPR_W}, { 0x8C, 0x88, BM_OPR_L}, diff --git a/opcodes/tic54x-dis.c b/opcodes/tic54x-dis.c index 2ec585181d..18851680be 100644 --- a/opcodes/tic54x-dis.c +++ b/opcodes/tic54x-dis.c @@ -117,7 +117,7 @@ tic54x_get_insn (disassemble_info *info, bfd_vma addr, bfd_byte opbuf[2]; bfd_vma addr2 = addr + 1 + has_lkaddr (memdata, tm); int status = (*info->read_memory_func) (addr2, opbuf, 2, info); - // FIXME handle errors + /* FIXME handle errors. */ if (status == 0) { unsigned short data2 = bfd_getl16 (opbuf); diff --git a/opcodes/xgate-dis.c b/opcodes/xgate-dis.c index 61eeb9971c..810fbc4917 100644 --- a/opcodes/xgate-dis.c +++ b/opcodes/xgate-dis.c @@ -254,7 +254,6 @@ print_insn (bfd_vma memaddr, struct disassemble_info* info) } else if (!strcmp (decodePTR->opcodePTR->constraints, XGATE_OP_INH)) { - // } else {