From 927a4a16f852e4b5b465c9ed260dca0dcb27987c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 6 Jun 2017 22:53:38 -0400 Subject: [PATCH 1/4] Boot: Make BootExecutableReader constructors explicit --- Source/Core/Core/Boot/Boot.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.h b/Source/Core/Core/Boot/Boot.h index a178edaf75..1f52daa1c5 100644 --- a/Source/Core/Core/Boot/Boot.h +++ b/Source/Core/Core/Boot/Boot.h @@ -109,8 +109,8 @@ private: class BootExecutableReader { public: - BootExecutableReader(const std::string& file_name); - BootExecutableReader(const std::vector& buffer); + explicit BootExecutableReader(const std::string& file_name); + explicit BootExecutableReader(const std::vector& buffer); virtual ~BootExecutableReader(); virtual u32 GetEntryPoint() const = 0; From 187650570783c723ff4e76d72a8513c917c10ccc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 6 Jun 2017 22:56:40 -0400 Subject: [PATCH 2/4] DolReader: Make constructors explicit --- Source/Core/Core/Boot/DolReader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Boot/DolReader.h b/Source/Core/Core/Boot/DolReader.h index 43b1c0f354..e2daa04733 100644 --- a/Source/Core/Core/Boot/DolReader.h +++ b/Source/Core/Core/Boot/DolReader.h @@ -13,8 +13,8 @@ class DolReader final : public BootExecutableReader { public: - DolReader(const std::string& filename); - DolReader(const std::vector& buffer); + explicit DolReader(const std::string& filename); + explicit DolReader(const std::vector& buffer); ~DolReader(); bool IsValid() const override { return m_is_valid; } From 1af1795695bbda672fb2671a2290b571b7550b7e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 6 Jun 2017 22:58:06 -0400 Subject: [PATCH 3/4] ElfReader: Make constructors explicit --- Source/Core/Core/Boot/ElfReader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Boot/ElfReader.h b/Source/Core/Core/Boot/ElfReader.h index 014d0667c3..a73a18a536 100644 --- a/Source/Core/Core/Boot/ElfReader.h +++ b/Source/Core/Core/Boot/ElfReader.h @@ -21,8 +21,8 @@ typedef int SectionID; class ElfReader final : public BootExecutableReader { public: - ElfReader(const std::string& filename); - ElfReader(const std::vector& buffer); + explicit ElfReader(const std::string& filename); + explicit ElfReader(const std::vector& buffer); ~ElfReader() {} u32 Read32(int off) const { return base32[off >> 2]; } // Quick accessors From b0427731b3b122f45079dc4520d47a2c62c6bd18 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 6 Jun 2017 22:59:12 -0400 Subject: [PATCH 4/4] ElfReader: default the destructor --- Source/Core/Core/Boot/ElfReader.cpp | 2 ++ Source/Core/Core/Boot/ElfReader.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Boot/ElfReader.cpp b/Source/Core/Core/Boot/ElfReader.cpp index 4f9297b06d..78a77954ed 100644 --- a/Source/Core/Core/Boot/ElfReader.cpp +++ b/Source/Core/Core/Boot/ElfReader.cpp @@ -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; diff --git a/Source/Core/Core/Boot/ElfReader.h b/Source/Core/Core/Boot/ElfReader.h index a73a18a536..951f5a7b57 100644 --- a/Source/Core/Core/Boot/ElfReader.h +++ b/Source/Core/Core/Boot/ElfReader.h @@ -23,7 +23,7 @@ class ElfReader final : public BootExecutableReader public: explicit ElfReader(const std::string& filename); explicit ElfReader(const std::vector& buffer); - ~ElfReader() {} + ~ElfReader(); u32 Read32(int off) const { return base32[off >> 2]; } // Quick accessors ElfType GetType() const { return (ElfType)(header->e_type); }