summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/ns/pl_u.cpp6
-rw-r--r--src/core/loader/nso.cpp23
2 files changed, 9 insertions, 20 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index d4e0f615a..691b1d106 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -132,9 +132,9 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
font_sizes.push_back(SHARED_FONT_REGIONS[i].size);
}
- ctx.WriteBuffer(font_codes.data(), font_codes.size() * sizeof(u32), 0);
- ctx.WriteBuffer(font_offsets.data(), font_offsets.size() * sizeof(u32), 1);
- ctx.WriteBuffer(font_sizes.data(), font_sizes.size() * sizeof(u32), 2);
+ ctx.WriteBuffer(font_codes, 0);
+ ctx.WriteBuffer(font_offsets, 1);
+ ctx.WriteBuffer(font_sizes, 2);
rb.Push(RESULT_SUCCESS);
rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index c66561bf4..06b1b33f4 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -69,29 +69,18 @@ FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) {
static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,
const NsoSegmentHeader& header) {
std::vector<u8> uncompressed_data(header.size);
- const int bytes_uncompressed = LZ4_decompress_safe(
- reinterpret_cast<const char*>(compressed_data.data()),
- reinterpret_cast<char*>(uncompressed_data.data()), compressed_data.size(), header.size);
+ const int bytes_uncompressed =
+ LZ4_decompress_safe(reinterpret_cast<const char*>(compressed_data.data()),
+ reinterpret_cast<char*>(uncompressed_data.data()),
+ static_cast<int>(compressed_data.size()), header.size);
- ASSERT_MSG(bytes_uncompressed == header.size && bytes_uncompressed == uncompressed_data.size(),
+ ASSERT_MSG(bytes_uncompressed == static_cast<int>(header.size) &&
+ bytes_uncompressed == static_cast<int>(uncompressed_data.size()),
"{} != {} != {}", bytes_uncompressed, header.size, uncompressed_data.size());
return uncompressed_data;
}
-static std::vector<u8> ReadSegment(FileUtil::IOFile& file, const NsoSegmentHeader& header,
- size_t compressed_size) {
- std::vector<u8> compressed_data(compressed_size);
-
- file.Seek(header.offset, SEEK_SET);
- if (compressed_size != file.ReadBytes(compressed_data.data(), compressed_size)) {
- LOG_CRITICAL(Loader, "Failed to read {} NSO LZ4 compressed bytes", compressed_size);
- return {};
- }
-
- return DecompressSegment(compressed_data, header);
-}
-
static constexpr u32 PageAlignSize(u32 size) {
return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
}