@@ -621,7 +621,7 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
621621 debug (" rewriting section '%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n " ,
622622 sectionName.c_str (), rdi (shdr.sh_offset ), rdi (shdr.sh_size ), curOff, i->second .size ());
623623
624- memcpy (fileContents->data () + curOff, ( unsigned char *) i->second .c_str (),
624+ memcpy (fileContents->data () + curOff, i->second .c_str (),
625625 i->second .size ());
626626
627627 /* Update the section header for this section. */
@@ -1316,7 +1316,7 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const std::string &
13161316 std::string & newDynamic = replaceSection (" .dynamic" , rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
13171317
13181318 unsigned int idx = 0 ;
1319- for (; rdi ((( Elf_Dyn *) newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++);
1319+ for (; rdi (reinterpret_cast < const Elf_Dyn *>( newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++);
13201320 debug (" DT_NULL index is %d\n " , idx);
13211321
13221322 /* Shift all entries down by one. */
@@ -1551,7 +1551,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
15511551 rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
15521552
15531553 unsigned int idx = 0 ;
1554- for ( ; rdi ((( Elf_Dyn *) newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
1554+ for ( ; rdi (reinterpret_cast < const Elf_Dyn *>( newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
15551555 debug (" DT_NULL index is %d\n " , idx);
15561556
15571557 /* Shift all entries down by one. */
@@ -1753,7 +1753,7 @@ void ElfFile<ElfFileParamNames>::addNeeded(const std::set<std::string> & libs)
17531753 rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn) * libs.size ());
17541754
17551755 unsigned int idx = 0 ;
1756- for ( ; rdi ((( Elf_Dyn *) newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
1756+ for ( ; rdi (reinterpret_cast < const Elf_Dyn *>( newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
17571757 debug (" DT_NULL index is %d\n " , idx);
17581758
17591759 /* Shift all entries down by the number of new entries. */
@@ -1815,7 +1815,7 @@ void ElfFile<ElfFileParamNames>::noDefaultLib()
18151815 rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
18161816
18171817 unsigned int idx = 0 ;
1818- for ( ; rdi ((( Elf_Dyn *) newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
1818+ for ( ; rdi (reinterpret_cast < const Elf_Dyn *>( newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
18191819 debug (" DT_NULL index is %d\n " , idx);
18201820
18211821 /* Shift all entries down by one. */
@@ -1848,7 +1848,7 @@ void ElfFile<ElfFileParamNames>::addDebugTag()
18481848 rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
18491849
18501850 unsigned int idx = 0 ;
1851- for ( ; rdi ((( Elf_Dyn *) newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
1851+ for ( ; rdi (reinterpret_cast < const Elf_Dyn *>( newDynamic.c_str ())[idx].d_tag ) != DT_NULL; idx++) ;
18521852 debug (" DT_NULL index is %d\n " , idx);
18531853
18541854 /* Shift all entries down by one. */
0 commit comments