From e04476791a1cfbc355e3d3db8ec31a0cc8856dd2 Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Sun, 29 Jul 2012 22:24:45 +0300 Subject: [PATCH] Another change --- elfio/elfio_dump.hpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/elfio/elfio_dump.hpp b/elfio/elfio_dump.hpp index ecd1ce4..d664d78 100644 --- a/elfio/elfio_dump.hpp +++ b/elfio/elfio_dump.hpp @@ -39,7 +39,7 @@ class dump out << "ELF Header\n" << std::endl; out << " Class: " << str_elf_class( reader.get_class() ) - << "(" << (int)reader.get_class() << ")" + << " (" << (int)reader.get_class() << ")" << std::endl; out << " Encoding: " << ( ( ELFDATA2LSB == reader.get_encoding() ) ? "Little endian" : "" ) @@ -59,8 +59,21 @@ class dump } +struct convert +{ + Elf_Word type; + const char* str; +}; + +convert converts[] = +{ + { ELFCLASS32, "ELF32" }, + { ELFCLASS64, "ELF64" }, +}; + + //------------------------------------------------------------------------------ - static std::string + template static std::string str_section_type( Elf_Word type ) { } @@ -68,17 +81,6 @@ class dump static std::string str_elf_class( Elf_Word type ) { - struct convert - { - Elf_Word type; - const char* str; - }; - convert converts[] = - { - { ELFCLASS32, "ELF32" }, - { ELFCLASS64, "ELF64" }, - }; - std::string res = "UNKNOWN"; for ( unsigned int i = 0; i < sizeof( converts )/sizeof( convert ); ++i ) { if ( converts[i].type == type ) {