Browse Source

ELFImage: Sprinkle some constification love

Robin Burchell 6 years ago
parent
commit
7de79d3bbb
2 changed files with 4 additions and 4 deletions
  1. 2 2
      AK/ELF/ELFImage.cpp
  2. 2 2
      AK/ELF/ELFImage.h

+ 2 - 2
AK/ELF/ELFImage.cpp

@@ -29,7 +29,7 @@ static const char* object_file_type_to_string(Elf32_Half type)
     }
     }
 }
 }
 
 
-const char* ELFImage::section_index_to_string(unsigned index)
+const char* ELFImage::section_index_to_string(unsigned index) const
 {
 {
     if (index == SHN_UNDEF)
     if (index == SHN_UNDEF)
         return "Undefined";
         return "Undefined";
@@ -43,7 +43,7 @@ unsigned ELFImage::symbol_count() const
     return section(m_symbol_table_section_index).entry_count();
     return section(m_symbol_table_section_index).entry_count();
 }
 }
 
 
-void ELFImage::dump()
+void ELFImage::dump() const
 {
 {
     kprintf("ELFImage{%p} {\n", this);
     kprintf("ELFImage{%p} {\n", this);
     kprintf("    is_valid: %u\n", is_valid());
     kprintf("    is_valid: %u\n", is_valid());

+ 2 - 2
AK/ELF/ELFImage.h

@@ -9,7 +9,7 @@ class ELFImage {
 public:
 public:
     explicit ELFImage(const u8*);
     explicit ELFImage(const u8*);
     ~ELFImage();
     ~ELFImage();
-    void dump();
+    void dump() const;
     bool is_valid() const { return m_valid; }
     bool is_valid() const { return m_valid; }
     bool parse();
     bool parse();
 
 
@@ -132,7 +132,7 @@ private:
     const Elf32_Phdr& program_header_internal(unsigned) const;
     const Elf32_Phdr& program_header_internal(unsigned) const;
     const char* table_string(unsigned offset) const;
     const char* table_string(unsigned offset) const;
     const char* section_header_table_string(unsigned offset) const;
     const char* section_header_table_string(unsigned offset) const;
-    const char* section_index_to_string(unsigned index);
+    const char* section_index_to_string(unsigned index) const;
 
 
     const u8* m_buffer { nullptr };
     const u8* m_buffer { nullptr };
     bool m_valid { false };
     bool m_valid { false };