summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-12 04:47:32 -0500
committerGravatar Lioncash2019-11-12 07:55:39 -0500
commit86c397dd6e55202af02edd1606e4dcbdf64d0c8a (patch)
tree15fb011e0b39236ec784f0a5a341d0d73a3e2ce0 /src
parentresult: Add default error code for the ResultCode(-1) case (diff)
downloadyuzu-86c397dd6e55202af02edd1606e4dcbdf64d0c8a.tar.gz
yuzu-86c397dd6e55202af02edd1606e4dcbdf64d0c8a.tar.xz
yuzu-86c397dd6e55202af02edd1606e4dcbdf64d0c8a.zip
file_sys: Resolve sign conversion warnings
Resolves a few trivial sign conversion/mismatch errors.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/romfs_factory.cpp4
-rw-r--r--src/core/file_sys/savedata_factory.cpp4
-rw-r--r--src/core/file_sys/vfs_libzip.cpp2
-rw-r--r--src/core/file_sys/xts_archive.cpp12
4 files changed, 10 insertions, 12 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index 4bd2e6183..418a39a7e 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -71,12 +71,12 @@ ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage,
71 71
72 if (res == nullptr) { 72 if (res == nullptr) {
73 // TODO(DarkLordZach): Find the right error code to use here 73 // TODO(DarkLordZach): Find the right error code to use here
74 return ResultCode(-1); 74 return RESULT_UNKNOWN;
75 } 75 }
76 const auto romfs = res->GetRomFS(); 76 const auto romfs = res->GetRomFS();
77 if (romfs == nullptr) { 77 if (romfs == nullptr) {
78 // TODO(DarkLordZach): Find the right error code to use here 78 // TODO(DarkLordZach): Find the right error code to use here
79 return ResultCode(-1); 79 return RESULT_UNKNOWN;
80 } 80 }
81 return MakeResult<VirtualFile>(romfs); 81 return MakeResult<VirtualFile>(romfs);
82} 82}
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index e2a7eaf7b..f3def93ab 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -90,7 +90,7 @@ ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space,
90 // Return an error if the save data doesn't actually exist. 90 // Return an error if the save data doesn't actually exist.
91 if (out == nullptr) { 91 if (out == nullptr) {
92 // TODO(DarkLordZach): Find out correct error code. 92 // TODO(DarkLordZach): Find out correct error code.
93 return ResultCode(-1); 93 return RESULT_UNKNOWN;
94 } 94 }
95 95
96 return MakeResult<VirtualDir>(std::move(out)); 96 return MakeResult<VirtualDir>(std::move(out));
@@ -111,7 +111,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space,
111 // Return an error if the save data doesn't actually exist. 111 // Return an error if the save data doesn't actually exist.
112 if (out == nullptr) { 112 if (out == nullptr) {
113 // TODO(Subv): Find out correct error code. 113 // TODO(Subv): Find out correct error code.
114 return ResultCode(-1); 114 return RESULT_UNKNOWN;
115 } 115 }
116 116
117 return MakeResult<VirtualDir>(std::move(out)); 117 return MakeResult<VirtualDir>(std::move(out));
diff --git a/src/core/file_sys/vfs_libzip.cpp b/src/core/file_sys/vfs_libzip.cpp
index 8bdaa7e4a..11d1978ea 100644
--- a/src/core/file_sys/vfs_libzip.cpp
+++ b/src/core/file_sys/vfs_libzip.cpp
@@ -27,7 +27,7 @@ VirtualDir ExtractZIP(VirtualFile file) {
27 27
28 std::shared_ptr<VectorVfsDirectory> out = std::make_shared<VectorVfsDirectory>(); 28 std::shared_ptr<VectorVfsDirectory> out = std::make_shared<VectorVfsDirectory>();
29 29
30 const auto num_entries = zip_get_num_entries(zip.get(), 0); 30 const auto num_entries = static_cast<std::size_t>(zip_get_num_entries(zip.get(), 0));
31 31
32 zip_stat_t stat{}; 32 zip_stat_t stat{};
33 zip_stat_init(&stat); 33 zip_stat_init(&stat);
diff --git a/src/core/file_sys/xts_archive.cpp b/src/core/file_sys/xts_archive.cpp
index 4bc5cb2ee..b2b39502d 100644
--- a/src/core/file_sys/xts_archive.cpp
+++ b/src/core/file_sys/xts_archive.cpp
@@ -7,12 +7,13 @@
7#include <cstring> 7#include <cstring>
8#include <regex> 8#include <regex>
9#include <string> 9#include <string>
10
10#include <mbedtls/md.h> 11#include <mbedtls/md.h>
11#include <mbedtls/sha256.h> 12#include <mbedtls/sha256.h>
12#include "common/assert.h" 13
13#include "common/file_util.h" 14#include "common/file_util.h"
14#include "common/hex_util.h" 15#include "common/hex_util.h"
15#include "common/logging/log.h" 16#include "common/string_util.h"
16#include "core/crypto/aes_util.h" 17#include "core/crypto/aes_util.h"
17#include "core/crypto/xts_encryption_layer.h" 18#include "core/crypto/xts_encryption_layer.h"
18#include "core/file_sys/partition_filesystem.h" 19#include "core/file_sys/partition_filesystem.h"
@@ -53,11 +54,8 @@ NAX::NAX(VirtualFile file_) : header(std::make_unique<NAXHeader>()), file(std::m
53 return; 54 return;
54 } 55 }
55 56
56 std::string two_dir = match[1]; 57 const std::string two_dir = Common::ToUpper(match[1]);
57 std::string nca_id = match[2]; 58 const std::string nca_id = Common::ToLower(match[2]);
58 std::transform(two_dir.begin(), two_dir.end(), two_dir.begin(), ::toupper);
59 std::transform(nca_id.begin(), nca_id.end(), nca_id.begin(), ::tolower);
60
61 status = Parse(fmt::format("/registered/{}/{}.nca", two_dir, nca_id)); 59 status = Parse(fmt::format("/registered/{}/{}.nca", two_dir, nca_id));
62} 60}
63 61