From f95602f15207851b849c57e2a2dd313a087b2493 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 5 Dec 2020 11:40:14 -0500 Subject: video_core: Resolve more variable shadowing scenarios pt.3 Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors. --- src/core/file_sys/vfs_vector.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/file_sys/vfs_vector.h') diff --git a/src/core/file_sys/vfs_vector.h b/src/core/file_sys/vfs_vector.h index 95d3da2f2..c214db422 100644 --- a/src/core/file_sys/vfs_vector.h +++ b/src/core/file_sys/vfs_vector.h @@ -17,9 +17,9 @@ namespace FileSys { template class ArrayVfsFile : public VfsFile { public: - explicit ArrayVfsFile(const std::array& data, std::string name = "", - VirtualDir parent = nullptr) - : data(data), name(std::move(name)), parent(std::move(parent)) {} + explicit ArrayVfsFile(const std::array& data_, std::string name_ = "", + VirtualDir parent_ = nullptr) + : data(data_), name(std::move(name_)), parent(std::move(parent_)) {} std::string GetName() const override { return name; @@ -51,12 +51,12 @@ public: return read; } - std::size_t Write(const u8* data, std::size_t length, std::size_t offset) override { + std::size_t Write(const u8* data_, std::size_t length, std::size_t offset) override { return 0; } - bool Rename(std::string_view name) override { - this->name = name; + bool Rename(std::string_view new_name) override { + name = new_name; return true; } -- cgit v1.2.3 From b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 10 Dec 2020 01:31:58 -0500 Subject: vfs: Use existing type aliases consistently Makes use of the VirtualDir and VirtualFile aliases across the board instead of having a few isolated places that don't use it. --- src/core/file_sys/vfs_vector.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/file_sys/vfs_vector.h') diff --git a/src/core/file_sys/vfs_vector.h b/src/core/file_sys/vfs_vector.h index c214db422..2aff9ca34 100644 --- a/src/core/file_sys/vfs_vector.h +++ b/src/core/file_sys/vfs_vector.h @@ -33,7 +33,7 @@ public: return false; } - std::shared_ptr GetContainingDirectory() const override { + VirtualDir GetContainingDirectory() const override { return parent; } @@ -82,7 +82,7 @@ public: std::string GetName() const override; std::size_t GetSize() const override; bool Resize(std::size_t new_size) override; - std::shared_ptr GetContainingDirectory() const override; + VirtualDir GetContainingDirectory() const override; bool IsWritable() const override; bool IsReadable() const override; std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override; @@ -106,17 +106,17 @@ public: VirtualDir parent = nullptr); ~VectorVfsDirectory() override; - std::vector> GetFiles() const override; - std::vector> GetSubdirectories() const override; + std::vector GetFiles() const override; + std::vector GetSubdirectories() const override; bool IsWritable() const override; bool IsReadable() const override; std::string GetName() const override; - std::shared_ptr GetParentDirectory() const override; + VirtualDir GetParentDirectory() const override; bool DeleteSubdirectory(std::string_view name) override; bool DeleteFile(std::string_view name) override; bool Rename(std::string_view name) override; - std::shared_ptr CreateSubdirectory(std::string_view name) override; - std::shared_ptr CreateFile(std::string_view name) override; + VirtualDir CreateSubdirectory(std::string_view name) override; + VirtualFile CreateFile(std::string_view name) override; virtual void AddFile(VirtualFile file); virtual void AddDirectory(VirtualDir dir); -- cgit v1.2.3