@@ -621,7 +621,7 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
621
621
debug (" rewriting section '%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n " ,
622
622
sectionName.c_str (), rdi (shdr.sh_offset ), rdi (shdr.sh_size ), curOff, i->second .size ());
623
623
624
- memcpy (fileContents->data () + curOff, ( unsigned char *) i->second .c_str (),
624
+ memcpy (fileContents->data () + curOff, i->second .c_str (),
625
625
i->second .size ());
626
626
627
627
/* Update the section header for this section. */
@@ -1316,7 +1316,7 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const std::string &
1316
1316
std::string & newDynamic = replaceSection (" .dynamic" , rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
1317
1317
1318
1318
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++);
1320
1320
debug (" DT_NULL index is %d\n " , idx);
1321
1321
1322
1322
/* Shift all entries down by one. */
@@ -1551,7 +1551,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
1551
1551
rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
1552
1552
1553
1553
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++) ;
1555
1555
debug (" DT_NULL index is %d\n " , idx);
1556
1556
1557
1557
/* Shift all entries down by one. */
@@ -1753,7 +1753,7 @@ void ElfFile<ElfFileParamNames>::addNeeded(const std::set<std::string> & libs)
1753
1753
rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn) * libs.size ());
1754
1754
1755
1755
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++) ;
1757
1757
debug (" DT_NULL index is %d\n " , idx);
1758
1758
1759
1759
/* Shift all entries down by the number of new entries. */
@@ -1815,7 +1815,7 @@ void ElfFile<ElfFileParamNames>::noDefaultLib()
1815
1815
rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
1816
1816
1817
1817
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++) ;
1819
1819
debug (" DT_NULL index is %d\n " , idx);
1820
1820
1821
1821
/* Shift all entries down by one. */
@@ -1848,7 +1848,7 @@ void ElfFile<ElfFileParamNames>::addDebugTag()
1848
1848
rdi (shdrDynamic.sh_size ) + sizeof (Elf_Dyn));
1849
1849
1850
1850
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++) ;
1852
1852
debug (" DT_NULL index is %d\n " , idx);
1853
1853
1854
1854
/* Shift all entries down by one. */
0 commit comments