modernize-use-using

This commit is contained in:
Serge Lamikhov-Center 2021-09-07 10:03:19 +03:00
parent c99baabc0b
commit 4dc38f0f34
4 changed files with 25 additions and 42 deletions

View File

@ -926,31 +926,14 @@ struct Elf64_Rela
Elf_Sxword r_addend;
};
template <typename T> constexpr auto ELF32_R_SYM( T i )
{
return ( ( i ) >> 8 );
}
template <typename T> constexpr auto ELF32_R_TYPE( T i )
{
return ( (unsigned char)( i ) );
}
template <typename T1, typename T2> constexpr auto ELF32_R_INFO( T1 s, T2 t )
{
return ( ( ( s ) << 8 ) + (unsigned char)( t ) );
}
#define ELF32_R_SYM( i ) ( ( i ) >> 8 )
#define ELF32_R_TYPE( i ) ( (unsigned char)( i ) )
#define ELF32_R_INFO( s, t ) ( ( ( s ) << 8 ) + (unsigned char)( t ) )
template <typename T> constexpr auto ELF64_R_SYM( T i )
{
return ( ( i ) >> 32 );
}
template <typename T> constexpr auto ELF64_R_TYPE( T i )
{
return ( (i)&0xffffffffL );
}
template <typename T1, typename T2> constexpr auto ELF64_R_INFO( T1 s, T2 t )
{
return ( ( ( (int64_t)( s ) ) << 32 ) + ( (t)&0xffffffffL ) );
}
#define ELF64_R_SYM( i ) ( ( i ) >> 32 )
#define ELF64_R_TYPE( i ) ( (i)&0xffffffffL )
#define ELF64_R_INFO( s, t ) \
( ( ( (int64_t)( s ) ) << 32 ) + ( (t)&0xffffffffL ) )
// Dynamic structure
struct Elf32_Dyn

View File

@ -60,14 +60,14 @@ class elf_header
template <class T> struct elf_header_impl_types;
template <> struct elf_header_impl_types<Elf32_Ehdr>
{
typedef Elf32_Phdr Phdr_type;
typedef Elf32_Shdr Shdr_type;
using Phdr_type = Elf32_Phdr;
using Shdr_type = Elf32_Shdr;
static const unsigned char file_class = ELFCLASS32;
};
template <> struct elf_header_impl_types<Elf64_Ehdr>
{
typedef Elf64_Phdr Phdr_type;
typedef Elf64_Shdr Shdr_type;
using Phdr_type = Elf64_Phdr;
using Shdr_type = Elf64_Shdr;
static const unsigned char file_class = ELFCLASS64;
};

View File

@ -164,7 +164,7 @@ void checkRelocation( const relocation_section_accessor* pRT,
Elf64_Addr offset;
Elf64_Addr symbolValue;
std::string symbolName;
Elf_Word type;
unsigned char type;
Elf_Sxword addend;
Elf_Sxword calcValue;

View File

@ -843,7 +843,7 @@ BOOST_AUTO_TEST_CASE( rearrange_local_symbols_with_reallocation )
for ( Elf_Word i = 0; i < rela.get_entries_num(); i++ ) {
Elf64_Addr offset;
Elf_Word symbol;
Elf_Word rtype;
unsigned char rtype;
Elf_Sxword addend;
rela.get_entry( i, offset, symbol, rtype, addend );
@ -877,7 +877,7 @@ BOOST_AUTO_TEST_CASE( rearrange_local_symbols_with_reallocation )
for ( Elf_Word i = 0; i < rel.get_entries_num(); i++ ) {
Elf64_Addr offset;
Elf_Word symbol;
Elf_Word rtype;
unsigned char rtype;
Elf_Sxword addend;
rel.get_entry( i, offset, symbol, rtype, addend );