modernize-constexpr

This commit is contained in:
Serge Lamikhov-Center 2021-09-07 09:31:50 +03:00
parent f8e870823d
commit c99baabc0b
3 changed files with 726 additions and 705 deletions

File diff suppressed because it is too large Load Diff

View File

@ -83,11 +83,11 @@ template <class S> class relocation_section_accessor_template
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool get_entry( Elf_Xword index, bool get_entry( Elf_Xword index,
Elf64_Addr& offset, Elf64_Addr& offset,
Elf_Word& symbol, Elf_Word& symbol,
Elf_Word& type, unsigned char& type,
Elf_Sxword& addend ) const Elf_Sxword& addend ) const
{ {
if ( index >= get_entries_num() ) { // Is index valid if ( index >= get_entries_num() ) { // Is index valid
return false; return false;
@ -118,13 +118,13 @@ template <class S> class relocation_section_accessor_template
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool get_entry( Elf_Xword index, bool get_entry( Elf_Xword index,
Elf64_Addr& offset, Elf64_Addr& offset,
Elf64_Addr& symbolValue, Elf64_Addr& symbolValue,
std::string& symbolName, std::string& symbolName,
Elf_Word& type, unsigned char& type,
Elf_Sxword& addend, Elf_Sxword& addend,
Elf_Sxword& calcValue ) const Elf_Sxword& calcValue ) const
{ {
// Do regular job // Do regular job
Elf_Word symbol; Elf_Word symbol;
@ -185,11 +185,11 @@ template <class S> class relocation_section_accessor_template
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool set_entry( Elf_Xword index, bool set_entry( Elf_Xword index,
Elf64_Addr offset, Elf64_Addr offset,
Elf_Word symbol, Elf_Word symbol,
Elf_Word type, unsigned char type,
Elf_Sxword addend ) Elf_Sxword addend )
{ {
if ( index >= get_entries_num() ) { // Is index valid if ( index >= get_entries_num() ) { // Is index valid
return false; return false;
@ -293,10 +293,10 @@ template <class S> class relocation_section_accessor_template
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void swap_symbols( Elf_Xword first, Elf_Xword second ) void swap_symbols( Elf_Xword first, Elf_Xword second )
{ {
Elf64_Addr offset; Elf64_Addr offset;
Elf_Word symbol; Elf_Word symbol;
Elf_Word rtype; unsigned char rtype;
Elf_Sxword addend; Elf_Sxword addend;
for ( Elf_Word i = 0; i < get_entries_num(); i++ ) { for ( Elf_Word i = 0; i < get_entries_num(); i++ ) {
get_entry( i, offset, symbol, rtype, addend ); get_entry( i, offset, symbol, rtype, addend );
if ( symbol == first ) { if ( symbol == first ) {
@ -318,11 +318,11 @@ template <class S> class relocation_section_accessor_template
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template <class T> template <class T>
void generic_get_entry_rel( Elf_Xword index, void generic_get_entry_rel( Elf_Xword index,
Elf64_Addr& offset, Elf64_Addr& offset,
Elf_Word& symbol, Elf_Word& symbol,
Elf_Word& type, unsigned char& type,
Elf_Sxword& addend ) const Elf_Sxword& addend ) const
{ {
const endianess_convertor& convertor = elf_file.get_convertor(); const endianess_convertor& convertor = elf_file.get_convertor();
@ -338,11 +338,11 @@ template <class S> class relocation_section_accessor_template
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template <class T> template <class T>
void generic_get_entry_rela( Elf_Xword index, void generic_get_entry_rela( Elf_Xword index,
Elf64_Addr& offset, Elf64_Addr& offset,
Elf_Word& symbol, Elf_Word& symbol,
Elf_Word& type, unsigned char& type,
Elf_Sxword& addend ) const Elf_Sxword& addend ) const
{ {
const endianess_convertor& convertor = elf_file.get_convertor(); const endianess_convertor& convertor = elf_file.get_convertor();
@ -358,10 +358,10 @@ template <class S> class relocation_section_accessor_template
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template <class T> template <class T>
void generic_set_entry_rel( Elf_Xword index, void generic_set_entry_rel( Elf_Xword index,
Elf64_Addr offset, Elf64_Addr offset,
Elf_Word symbol, Elf_Word symbol,
Elf_Word type, unsigned char type,
Elf_Sxword ) Elf_Sxword )
{ {
const endianess_convertor& convertor = elf_file.get_convertor(); const endianess_convertor& convertor = elf_file.get_convertor();
@ -383,11 +383,11 @@ template <class S> class relocation_section_accessor_template
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template <class T> template <class T>
void generic_set_entry_rela( Elf_Xword index, void generic_set_entry_rela( Elf_Xword index,
Elf64_Addr offset, Elf64_Addr offset,
Elf_Word symbol, Elf_Word symbol,
Elf_Word type, unsigned char type,
Elf_Sxword addend ) Elf_Sxword addend )
{ {
const endianess_convertor& convertor = elf_file.get_convertor(); const endianess_convertor& convertor = elf_file.get_convertor();

View File

@ -4,4 +4,4 @@ add_subdirectory(elfdump)
add_subdirectory(tutorial) add_subdirectory(tutorial)
add_subdirectory(write_obj) add_subdirectory(write_obj)
add_subdirectory(writer) add_subdirectory(writer)
add_subdirectory(c_wrapper) #add_subdirectory(c_wrapper)