From ed64d150603a02990c464e134bc576bca599f697 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 28 Mar 2018 19:40:30 -0400 Subject: [PATCH 1/3] disk_archive: Remove unused total_entries_in_directory member from DiskDirectory Also converts initializer list assignments to in-class initializers where relevant. --- src/core/file_sys/disk_archive.cpp | 2 +- src/core/file_sys/disk_archive.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 677f924676..faa28b84f1 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -52,7 +52,7 @@ bool DiskFile::Close() const { //////////////////////////////////////////////////////////////////////////////////////////////////// -DiskDirectory::DiskDirectory(const std::string& path) : directory() { +DiskDirectory::DiskDirectory(const std::string& path) { unsigned size = FileUtil::ScanDirectoryTree(path, directory); directory.size = size; directory.isDirectory = true; diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 0de3747a17..025eea3d22 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -59,8 +59,7 @@ public: } protected: - u32 total_entries_in_directory; - FileUtil::FSTEntry directory; + FileUtil::FSTEntry directory{}; // We need to remember the last entry we returned, so a subsequent call to Read will continue // from the next one. This iterator will always point to the next unread entry. From 07855c48d1bd046013987bcb9813316741e38632 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 28 Mar 2018 19:41:29 -0400 Subject: [PATCH 2/3] disk_archive: Remove unnecessary const in DiskDirectory's Read() declaration This only applies in the definition of the function, not the declaration. --- src/core/file_sys/disk_archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 025eea3d22..0e875d1945 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -52,7 +52,7 @@ public: Close(); } - u32 Read(const u32 count, Entry* entries) override; + u32 Read(u32 count, Entry* entries) override; bool Close() const override { return true; From 0e7ca706dcaa5ca2a9d5080e6bd787fbeaa4cd76 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 28 Mar 2018 19:43:03 -0400 Subject: [PATCH 3/3] disk_archive: Make DiskDirectory's constructor explicit Prevents implicit conversions/construction. --- src/core/file_sys/disk_archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 0e875d1945..fd6983ed1d 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -46,7 +46,7 @@ protected: class DiskDirectory : public DirectoryBackend { public: - DiskDirectory(const std::string& path); + explicit DiskDirectory(const std::string& path); ~DiskDirectory() override { Close();