diff options
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/nca_metadata.cpp | 8 | ||||
-rw-r--r-- | src/core/file_sys/nca_metadata.h | 4 | ||||
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 7 | ||||
-rw-r--r-- | src/core/file_sys/registered_cache.h | 1 | ||||
-rw-r--r-- | src/core/file_sys/submission_package.cpp | 4 | ||||
-rw-r--r-- | src/core/file_sys/submission_package.h | 2 | ||||
-rw-r--r-- | src/core/file_sys/vfs_concat.cpp | 8 | ||||
-rw-r--r-- | src/core/file_sys/vfs_concat.h | 4 | ||||
-rw-r--r-- | src/core/file_sys/vfs_layered.cpp | 4 | ||||
-rw-r--r-- | src/core/file_sys/vfs_layered.h | 2 | ||||
-rw-r--r-- | src/core/file_sys/vfs_libzip.cpp | 9 | ||||
-rw-r--r-- | src/core/file_sys/vfs_static.h | 6 | ||||
-rw-r--r-- | src/core/file_sys/vfs_vector.cpp | 4 | ||||
-rw-r--r-- | src/core/file_sys/vfs_vector.h | 4 |
14 files changed, 42 insertions, 25 deletions
diff --git a/src/core/file_sys/nca_metadata.cpp b/src/core/file_sys/nca_metadata.cpp index 3596541b2..f5cb4aa8c 100644 --- a/src/core/file_sys/nca_metadata.cpp +++ b/src/core/file_sys/nca_metadata.cpp @@ -39,10 +39,10 @@ CNMT::CNMT(VirtualFile file) { } } -CNMT::CNMT(CNMTHeader header, OptionalHeader opt_header, std::vector<ContentRecord> content_records, - std::vector<MetaRecord> meta_records) - : header(std::move(header)), opt_header(std::move(opt_header)), - content_records(std::move(content_records)), meta_records(std::move(meta_records)) {} +CNMT::CNMT(CNMTHeader header_, OptionalHeader opt_header_, + std::vector<ContentRecord> content_records_, std::vector<MetaRecord> meta_records_) + : header(std::move(header_)), opt_header(std::move(opt_header_)), + content_records(std::move(content_records_)), meta_records(std::move(meta_records_)) {} CNMT::~CNMT() = default; diff --git a/src/core/file_sys/nca_metadata.h b/src/core/file_sys/nca_metadata.h index 53535e5f5..ce1138a17 100644 --- a/src/core/file_sys/nca_metadata.h +++ b/src/core/file_sys/nca_metadata.h @@ -87,8 +87,8 @@ static_assert(sizeof(CNMTHeader) == 0x20, "CNMTHeader has incorrect size."); class CNMT { public: explicit CNMT(VirtualFile file); - CNMT(CNMTHeader header, OptionalHeader opt_header, std::vector<ContentRecord> content_records, - std::vector<MetaRecord> meta_records); + CNMT(CNMTHeader header_, OptionalHeader opt_header_, + std::vector<ContentRecord> content_records_, std::vector<MetaRecord> meta_records_); ~CNMT(); u64 GetTitleID() const; diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 1fb66874e..b0cb65952 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -12,6 +12,7 @@ #include "common/logging/log.h" #include "core/crypto/key_manager.h" #include "core/file_sys/card_image.h" +#include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" #include "core/file_sys/registered_cache.h" @@ -592,6 +593,12 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex const CNMT cnmt(cnmt_file); const auto title_id = cnmt.GetTitleID(); + const auto version = cnmt.GetTitleVersion(); + + if (title_id == GetBaseTitleID(title_id) && version == 0) { + return InstallResult::ErrorBaseInstall; + } + const auto result = RemoveExistingEntry(title_id); // Install Metadata File diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index b31630014..d042aef90 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -38,6 +38,7 @@ enum class InstallResult { ErrorAlreadyExists, ErrorCopyFailed, ErrorMetaFailed, + ErrorBaseInstall, }; struct ContentProviderEntry { diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index 80e560970..d51d469e3 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -20,8 +20,8 @@ namespace FileSys { -NSP::NSP(VirtualFile file_, std::size_t program_index) - : file(std::move(file_)), program_index(program_index), status{Loader::ResultStatus::Success}, +NSP::NSP(VirtualFile file_, std::size_t program_index_) + : file(std::move(file_)), program_index(program_index_), status{Loader::ResultStatus::Success}, pfs(std::make_shared<PartitionFilesystem>(file)), keys{Core::Crypto::KeyManager::Instance()} { if (pfs->GetStatus() != Loader::ResultStatus::Success) { status = pfs->GetStatus(); diff --git a/src/core/file_sys/submission_package.h b/src/core/file_sys/submission_package.h index 54581a6f3..ecb3b6f15 100644 --- a/src/core/file_sys/submission_package.h +++ b/src/core/file_sys/submission_package.h @@ -27,7 +27,7 @@ enum class ContentRecordType : u8; class NSP : public ReadOnlyVfsDirectory { public: - explicit NSP(VirtualFile file, std::size_t program_index = 0); + explicit NSP(VirtualFile file_, std::size_t program_index_ = 0); ~NSP() override; Loader::ResultStatus GetStatus() const; diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp index 619081502..5f8c09124 100644 --- a/src/core/file_sys/vfs_concat.cpp +++ b/src/core/file_sys/vfs_concat.cpp @@ -23,8 +23,8 @@ static bool VerifyConcatenationMapContinuity(const std::multimap<u64, VirtualFil return map.begin()->first == 0; } -ConcatenatedVfsFile::ConcatenatedVfsFile(std::vector<VirtualFile> files_, std::string name) - : name(std::move(name)) { +ConcatenatedVfsFile::ConcatenatedVfsFile(std::vector<VirtualFile> files_, std::string name_) + : name(std::move(name_)) { std::size_t next_offset = 0; for (const auto& file : files_) { files.emplace(next_offset, file); @@ -32,8 +32,8 @@ ConcatenatedVfsFile::ConcatenatedVfsFile(std::vector<VirtualFile> files_, std::s } } -ConcatenatedVfsFile::ConcatenatedVfsFile(std::multimap<u64, VirtualFile> files_, std::string name) - : files(std::move(files_)), name(std::move(name)) { +ConcatenatedVfsFile::ConcatenatedVfsFile(std::multimap<u64, VirtualFile> files_, std::string name_) + : files(std::move(files_)), name(std::move(name_)) { ASSERT(VerifyConcatenationMapContinuity(files)); } diff --git a/src/core/file_sys/vfs_concat.h b/src/core/file_sys/vfs_concat.h index 3397d32cd..cd32960a5 100644 --- a/src/core/file_sys/vfs_concat.h +++ b/src/core/file_sys/vfs_concat.h @@ -14,8 +14,8 @@ namespace FileSys { // Class that wraps multiple vfs files and concatenates them, making reads seamless. Currently // read-only. class ConcatenatedVfsFile : public VfsFile { - ConcatenatedVfsFile(std::vector<VirtualFile> files, std::string name); - ConcatenatedVfsFile(std::multimap<u64, VirtualFile> files, std::string name); + explicit ConcatenatedVfsFile(std::vector<VirtualFile> files, std::string name_); + explicit ConcatenatedVfsFile(std::multimap<u64, VirtualFile> files, std::string name_); public: ~ConcatenatedVfsFile() override; diff --git a/src/core/file_sys/vfs_layered.cpp b/src/core/file_sys/vfs_layered.cpp index 192740058..e093c4db2 100644 --- a/src/core/file_sys/vfs_layered.cpp +++ b/src/core/file_sys/vfs_layered.cpp @@ -8,8 +8,8 @@ namespace FileSys { -LayeredVfsDirectory::LayeredVfsDirectory(std::vector<VirtualDir> dirs, std::string name) - : dirs(std::move(dirs)), name(std::move(name)) {} +LayeredVfsDirectory::LayeredVfsDirectory(std::vector<VirtualDir> dirs_, std::string name_) + : dirs(std::move(dirs_)), name(std::move(name_)) {} LayeredVfsDirectory::~LayeredVfsDirectory() = default; diff --git a/src/core/file_sys/vfs_layered.h b/src/core/file_sys/vfs_layered.h index cb4b32e91..cd6baf28c 100644 --- a/src/core/file_sys/vfs_layered.h +++ b/src/core/file_sys/vfs_layered.h @@ -13,7 +13,7 @@ namespace FileSys { // one and falling back to the one after. The highest priority directory (overwrites all others) // should be element 0 in the dirs vector. class LayeredVfsDirectory : public VfsDirectory { - LayeredVfsDirectory(std::vector<VirtualDir> dirs, std::string name); + explicit LayeredVfsDirectory(std::vector<VirtualDir> dirs_, std::string name_); public: ~LayeredVfsDirectory() override; diff --git a/src/core/file_sys/vfs_libzip.cpp b/src/core/file_sys/vfs_libzip.cpp index 429d7bc8b..618eb658a 100644 --- a/src/core/file_sys/vfs_libzip.cpp +++ b/src/core/file_sys/vfs_libzip.cpp @@ -3,7 +3,16 @@ // Refer to the license.txt file included. #include <string> + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#endif #include <zip.h> +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #include "common/logging/backend.h" #include "core/file_sys/vfs.h" #include "core/file_sys/vfs_libzip.h" diff --git a/src/core/file_sys/vfs_static.h b/src/core/file_sys/vfs_static.h index c840b24b9..f5b66cf71 100644 --- a/src/core/file_sys/vfs_static.h +++ b/src/core/file_sys/vfs_static.h @@ -14,9 +14,9 @@ namespace FileSys { class StaticVfsFile : public VfsFile { public: - explicit StaticVfsFile(u8 value, std::size_t size = 0, std::string name = "", - VirtualDir parent = nullptr) - : value{value}, size{size}, name{std::move(name)}, parent{std::move(parent)} {} + explicit StaticVfsFile(u8 value_, std::size_t size_ = 0, std::string name_ = "", + VirtualDir parent_ = nullptr) + : value{value_}, size{size_}, name{std::move(name_)}, parent{std::move(parent_)} {} std::string GetName() const override { return name; diff --git a/src/core/file_sys/vfs_vector.cpp b/src/core/file_sys/vfs_vector.cpp index 1a3f06227..f64b88639 100644 --- a/src/core/file_sys/vfs_vector.cpp +++ b/src/core/file_sys/vfs_vector.cpp @@ -7,8 +7,8 @@ #include "core/file_sys/vfs_vector.h" namespace FileSys { -VectorVfsFile::VectorVfsFile(std::vector<u8> initial_data, std::string name, VirtualDir parent) - : data(std::move(initial_data)), parent(std::move(parent)), name(std::move(name)) {} +VectorVfsFile::VectorVfsFile(std::vector<u8> initial_data, std::string name_, VirtualDir parent_) + : data(std::move(initial_data)), parent(std::move(parent_)), name(std::move(name_)) {} VectorVfsFile::~VectorVfsFile() = default; diff --git a/src/core/file_sys/vfs_vector.h b/src/core/file_sys/vfs_vector.h index c10c527b6..73f180070 100644 --- a/src/core/file_sys/vfs_vector.h +++ b/src/core/file_sys/vfs_vector.h @@ -75,8 +75,8 @@ std::shared_ptr<ArrayVfsFile<Size>> MakeArrayFile(const std::array<u8, Size>& da // An implementation of VfsFile that is backed by a vector optionally supplied upon construction class VectorVfsFile : public VfsFile { public: - explicit VectorVfsFile(std::vector<u8> initial_data = {}, std::string name = "", - VirtualDir parent = nullptr); + explicit VectorVfsFile(std::vector<u8> initial_data = {}, std::string name_ = "", + VirtualDir parent_ = nullptr); ~VectorVfsFile() override; std::string GetName() const override; |