diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-19 17:41:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-19 17:41:42 +0200 |
commit | 1bf7ae79c8451d00897037a67438da265654caf3 (patch) | |
tree | 80dd3e8d6fd6636cc5b0bfc7e9d750b4b74ae513 /src/core | |
parent | Merge pull request #699 from lioncash/vfs (diff) | |
parent | content_archive: Make IsDirectoryExeFS() take a shared_ptr as a const reference (diff) | |
download | yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.gz yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.bz2 yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.lz yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.xz yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.zst yuzu-1bf7ae79c8451d00897037a67438da265654caf3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/content_archive.cpp | 5 | ||||
-rw-r--r-- | src/core/file_sys/content_archive.h | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 6cfef774d..d6b20c047 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp @@ -2,6 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <algorithm> +#include <utility> + #include "common/logging/log.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/vfs_offset.h" @@ -61,7 +64,7 @@ struct RomFSSuperblock { }; static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); -NCA::NCA(VirtualFile file_) : file(file_) { +NCA::NCA(VirtualFile file_) : file(std::move(file_)) { if (sizeof(NCAHeader) != file->ReadObject(&header)) LOG_CRITICAL(Loader, "File reader errored out during header read."); diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h index 129a70b97..0b8b9db61 100644 --- a/src/core/file_sys/content_archive.h +++ b/src/core/file_sys/content_archive.h @@ -4,6 +4,11 @@ #pragma once +#include <array> +#include <memory> +#include <string> +#include <vector> + #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" @@ -48,7 +53,7 @@ struct NCAHeader { }; static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size."); -inline bool IsDirectoryExeFS(std::shared_ptr<FileSys::VfsDirectory> pfs) { +inline bool IsDirectoryExeFS(const std::shared_ptr<VfsDirectory>& pfs) { // According to switchbrew, an exefs must only contain these two files: return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; } |