Skip to content

Commit

Permalink
Merge pull request #5568 from lioncash/boot
Browse files Browse the repository at this point in the history
Boot: Make BootExecutableReader hierarchy constructors explicit
  • Loading branch information
leoetlino committed Jun 7, 2017
2 parents a3e9aba + b042773 commit 6ee2227
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/Boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class CBoot
class BootExecutableReader
{
public:
BootExecutableReader(const std::string& file_name);
BootExecutableReader(const std::vector<u8>& buffer);
explicit BootExecutableReader(const std::string& file_name);
explicit BootExecutableReader(const std::vector<u8>& buffer);
virtual ~BootExecutableReader();

virtual u32 GetEntryPoint() const = 0;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/DolReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
class DolReader final : public BootExecutableReader
{
public:
DolReader(const std::string& filename);
DolReader(const std::vector<u8>& buffer);
explicit DolReader(const std::string& filename);
explicit DolReader(const std::vector<u8>& buffer);
~DolReader();

bool IsValid() const override { return m_is_valid; }
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/Boot/ElfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ ElfReader::ElfReader(const std::string& filename) : BootExecutableReader(filenam
Initialize(m_bytes.data());
}

ElfReader::~ElfReader() = default;

void ElfReader::Initialize(u8* ptr)
{
base = (char*)ptr;
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Boot/ElfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ typedef int SectionID;
class ElfReader final : public BootExecutableReader
{
public:
ElfReader(const std::string& filename);
ElfReader(const std::vector<u8>& buffer);
~ElfReader() {}
explicit ElfReader(const std::string& filename);
explicit ElfReader(const std::vector<u8>& buffer);
~ElfReader();
u32 Read32(int off) const { return base32[off >> 2]; }
// Quick accessors
ElfType GetType() const { return (ElfType)(header->e_type); }
Expand Down

0 comments on commit 6ee2227

Please sign in to comment.