From b05f8ea5b50d2fcbfaa906d674f9b8026f0352ab Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Apr 2018 21:27:43 -0400 Subject: [PATCH 1/3] disk_filesystem: Make constructors explicit where applicable --- src/core/file_sys/disk_filesystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/file_sys/disk_filesystem.h b/src/core/file_sys/disk_filesystem.h index 05a29bc3a..e774cd08b 100644 --- a/src/core/file_sys/disk_filesystem.h +++ b/src/core/file_sys/disk_filesystem.h @@ -43,7 +43,7 @@ protected: class Disk_Storage : public StorageBackend { public: - Disk_Storage(std::shared_ptr file) : file(std::move(file)) {} + explicit Disk_Storage(std::shared_ptr file) : file(std::move(file)) {} ResultVal Read(u64 offset, size_t length, u8* buffer) const override; ResultVal Write(u64 offset, size_t length, bool flush, const u8* buffer) const override; @@ -60,7 +60,7 @@ private: class Disk_Directory : public DirectoryBackend { public: - Disk_Directory(const std::string& path); + explicit Disk_Directory(const std::string& path); ~Disk_Directory() override { Close(); From e61a4dd4855784c966053a402300d267b1488bbf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Apr 2018 21:28:07 -0400 Subject: [PATCH 2/3] disk_filesystem: Remove redundant initializer in Disk_Directory's constructor --- src/core/file_sys/disk_filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/file_sys/disk_filesystem.cpp b/src/core/file_sys/disk_filesystem.cpp index 263392930..ca1323873 100644 --- a/src/core/file_sys/disk_filesystem.cpp +++ b/src/core/file_sys/disk_filesystem.cpp @@ -183,7 +183,7 @@ bool Disk_Storage::SetSize(const u64 size) const { return true; } -Disk_Directory::Disk_Directory(const std::string& path) : directory() { +Disk_Directory::Disk_Directory(const std::string& path) { unsigned size = FileUtil::ScanDirectoryTree(path, directory); directory.size = size; directory.isDirectory = true; From 80982748c8f16c9f208fcb030f4dae795864e2f2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Apr 2018 21:28:56 -0400 Subject: [PATCH 3/3] disk_filesystem: Remove unused total_entries_in_directory member from Disk_Directory --- src/core/file_sys/disk_filesystem.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/file_sys/disk_filesystem.h b/src/core/file_sys/disk_filesystem.h index e774cd08b..8f9e1145a 100644 --- a/src/core/file_sys/disk_filesystem.h +++ b/src/core/file_sys/disk_filesystem.h @@ -74,7 +74,6 @@ public: } protected: - u32 total_entries_in_directory; FileUtil::FSTEntry directory; // We need to remember the last entry we returned, so a subsequent call to Read will continue