summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-19 08:41:42 -0700
committerGravatar GitHub2018-07-19 08:41:42 -0700
commit1bf7ae79c8451d00897037a67438da265654caf3 (patch)
tree80dd3e8d6fd6636cc5b0bfc7e9d750b4b74ae513 /src
parentMerge pull request #699 from lioncash/vfs (diff)
parentcontent_archive: Make IsDirectoryExeFS() take a shared_ptr as a const reference (diff)
downloadyuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.gz
yuzu-1bf7ae79c8451d00897037a67438da265654caf3.tar.xz
yuzu-1bf7ae79c8451d00897037a67438da265654caf3.zip
Merge pull request #701 from lioncash/moving
content_archive: Minor changes
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/content_archive.cpp5
-rw-r--r--src/core/file_sys/content_archive.h7
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 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm>
6#include <utility>
7
5#include "common/logging/log.h" 8#include "common/logging/log.h"
6#include "core/file_sys/content_archive.h" 9#include "core/file_sys/content_archive.h"
7#include "core/file_sys/vfs_offset.h" 10#include "core/file_sys/vfs_offset.h"
@@ -61,7 +64,7 @@ struct RomFSSuperblock {
61}; 64};
62static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); 65static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size.");
63 66
64NCA::NCA(VirtualFile file_) : file(file_) { 67NCA::NCA(VirtualFile file_) : file(std::move(file_)) {
65 if (sizeof(NCAHeader) != file->ReadObject(&header)) 68 if (sizeof(NCAHeader) != file->ReadObject(&header))
66 LOG_CRITICAL(Loader, "File reader errored out during header read."); 69 LOG_CRITICAL(Loader, "File reader errored out during header read.");
67 70
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 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
8#include <memory>
9#include <string>
10#include <vector>
11
7#include "common/common_funcs.h" 12#include "common/common_funcs.h"
8#include "common/common_types.h" 13#include "common/common_types.h"
9#include "common/swap.h" 14#include "common/swap.h"
@@ -48,7 +53,7 @@ struct NCAHeader {
48}; 53};
49static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size."); 54static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size.");
50 55
51inline bool IsDirectoryExeFS(std::shared_ptr<FileSys::VfsDirectory> pfs) { 56inline bool IsDirectoryExeFS(const std::shared_ptr<VfsDirectory>& pfs) {
52 // According to switchbrew, an exefs must only contain these two files: 57 // According to switchbrew, an exefs must only contain these two files:
53 return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; 58 return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr;
54} 59}