diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/arm/arm_interface.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 3 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 23 | ||||
| -rw-r--r-- | src/core/file_sys/vfs_libzip.cpp | 4 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 24 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 4 | ||||
| -rw-r--r-- | src/core/memory/dmnt_cheat_vm.cpp | 5 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 6 |
13 files changed, 54 insertions, 43 deletions
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 7e846ddd5..fb9e616b9 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp | |||
| @@ -123,7 +123,7 @@ Symbols GetSymbols(VAddr text_offset, Memory::Memory& memory) { | |||
| 123 | std::optional<std::string> GetSymbolName(const Symbols& symbols, VAddr func_address) { | 123 | std::optional<std::string> GetSymbolName(const Symbols& symbols, VAddr func_address) { |
| 124 | const auto iter = | 124 | const auto iter = |
| 125 | std::find_if(symbols.begin(), symbols.end(), [func_address](const auto& pair) { | 125 | std::find_if(symbols.begin(), symbols.end(), [func_address](const auto& pair) { |
| 126 | const auto& [symbol, name] = pair; | 126 | const auto& symbol = pair.first; |
| 127 | const auto end_address = symbol.value + symbol.size; | 127 | const auto end_address = symbol.value + symbol.size; |
| 128 | return func_address >= symbol.value && func_address < end_address; | 128 | return func_address >= symbol.value && func_address < end_address; |
| 129 | }); | 129 | }); |
| @@ -146,7 +146,7 @@ std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktrace() const { | |||
| 146 | auto fp = GetReg(29); | 146 | auto fp = GetReg(29); |
| 147 | auto lr = GetReg(30); | 147 | auto lr = GetReg(30); |
| 148 | while (true) { | 148 | while (true) { |
| 149 | out.push_back({"", 0, lr, 0}); | 149 | out.push_back({"", 0, lr, 0, ""}); |
| 150 | if (!fp) { | 150 | if (!fp) { |
| 151 | break; | 151 | break; |
| 152 | } | 152 | } |
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index e77e82b8d..81ec06cd4 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp | |||
| @@ -440,7 +440,8 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam | |||
| 440 | // Game Updates | 440 | // Game Updates |
| 441 | const auto update_tid = GetUpdateTitleID(title_id); | 441 | const auto update_tid = GetUpdateTitleID(title_id); |
| 442 | PatchManager update{update_tid}; | 442 | PatchManager update{update_tid}; |
| 443 | auto [nacp, discard_icon_file] = update.GetControlMetadata(); | 443 | const auto metadata = update.GetControlMetadata(); |
| 444 | const auto& nacp = metadata.first; | ||
| 444 | 445 | ||
| 445 | const auto update_disabled = | 446 | const auto update_disabled = |
| 446 | std::find(disabled.cbegin(), disabled.cend(), "Update") != disabled.cend(); | 447 | std::find(disabled.cbegin(), disabled.cend(), "Update") != disabled.cend(); |
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 6e9cf67ef..ba5f76288 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -591,14 +591,18 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex | |||
| 591 | InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type, | 591 | InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type, |
| 592 | bool overwrite_if_exists, const VfsCopyFunction& copy) { | 592 | bool overwrite_if_exists, const VfsCopyFunction& copy) { |
| 593 | CNMTHeader header{ | 593 | CNMTHeader header{ |
| 594 | nca.GetTitleId(), ///< Title ID | 594 | nca.GetTitleId(), // Title ID |
| 595 | 0, ///< Ignore/Default title version | 595 | 0, // Ignore/Default title version |
| 596 | type, ///< Type | 596 | type, // Type |
| 597 | {}, ///< Padding | 597 | {}, // Padding |
| 598 | 0x10, ///< Default table offset | 598 | 0x10, // Default table offset |
| 599 | 1, ///< 1 Content Entry | 599 | 1, // 1 Content Entry |
| 600 | 0, ///< No Meta Entries | 600 | 0, // No Meta Entries |
| 601 | {}, ///< Padding | 601 | {}, // Padding |
| 602 | {}, // Reserved 1 | ||
| 603 | 0, // Is committed | ||
| 604 | 0, // Required download system version | ||
| 605 | {}, // Reserved 2 | ||
| 602 | }; | 606 | }; |
| 603 | OptionalHeader opt_header{0, 0}; | 607 | OptionalHeader opt_header{0, 0}; |
| 604 | ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}}; | 608 | ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}}; |
| @@ -848,7 +852,8 @@ VirtualFile ManualContentProvider::GetEntryUnparsed(u64 title_id, ContentRecordT | |||
| 848 | VirtualFile ManualContentProvider::GetEntryRaw(u64 title_id, ContentRecordType type) const { | 852 | VirtualFile ManualContentProvider::GetEntryRaw(u64 title_id, ContentRecordType type) const { |
| 849 | const auto iter = | 853 | const auto iter = |
| 850 | std::find_if(entries.begin(), entries.end(), [title_id, type](const auto& entry) { | 854 | std::find_if(entries.begin(), entries.end(), [title_id, type](const auto& entry) { |
| 851 | const auto [title_type, content_type, e_title_id] = entry.first; | 855 | const auto content_type = std::get<1>(entry.first); |
| 856 | const auto e_title_id = std::get<2>(entry.first); | ||
| 852 | return content_type == type && e_title_id == title_id; | 857 | return content_type == type && e_title_id == title_id; |
| 853 | }); | 858 | }); |
| 854 | if (iter == entries.end()) | 859 | if (iter == entries.end()) |
diff --git a/src/core/file_sys/vfs_libzip.cpp b/src/core/file_sys/vfs_libzip.cpp index 11d1978ea..d69952940 100644 --- a/src/core/file_sys/vfs_libzip.cpp +++ b/src/core/file_sys/vfs_libzip.cpp | |||
| @@ -42,11 +42,11 @@ VirtualDir ExtractZIP(VirtualFile file) { | |||
| 42 | continue; | 42 | continue; |
| 43 | 43 | ||
| 44 | if (name.back() != '/') { | 44 | if (name.back() != '/') { |
| 45 | std::unique_ptr<zip_file_t, decltype(&zip_fclose)> file{ | 45 | std::unique_ptr<zip_file_t, decltype(&zip_fclose)> file2{ |
| 46 | zip_fopen_index(zip.get(), i, 0), zip_fclose}; | 46 | zip_fopen_index(zip.get(), i, 0), zip_fclose}; |
| 47 | 47 | ||
| 48 | std::vector<u8> buf(stat.size); | 48 | std::vector<u8> buf(stat.size); |
| 49 | if (zip_fread(file.get(), buf.data(), buf.size()) != buf.size()) | 49 | if (zip_fread(file2.get(), buf.data(), buf.size()) != s64(buf.size())) |
| 50 | return nullptr; | 50 | return nullptr; |
| 51 | 51 | ||
| 52 | const auto parts = FileUtil::SplitPathComponents(stat.name); | 52 | const auto parts = FileUtil::SplitPathComponents(stat.name); |
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 68a0e0906..d0c43447c 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -25,7 +25,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 25 | ASSERT(height > 0); | 25 | ASSERT(height > 0); |
| 26 | // The drawing code needs at least somewhat valid values for both screens | 26 | // The drawing code needs at least somewhat valid values for both screens |
| 27 | // so just calculate them both even if the other isn't showing. | 27 | // so just calculate them both even if the other isn't showing. |
| 28 | FramebufferLayout res{width, height}; | 28 | FramebufferLayout res{width, height, false, {}}; |
| 29 | 29 | ||
| 30 | const float window_aspect_ratio = static_cast<float>(height) / width; | 30 | const float window_aspect_ratio = static_cast<float>(height) / width; |
| 31 | const float emulation_aspect_ratio = EmulationAspectRatio( | 31 | const float emulation_aspect_ratio = EmulationAspectRatio( |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index c558a2f33..d65dae3ae 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -284,17 +284,17 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(Thread& thread) { | |||
| 284 | 284 | ||
| 285 | std::vector<u8> HLERequestContext::ReadBuffer(int buffer_index) const { | 285 | std::vector<u8> HLERequestContext::ReadBuffer(int buffer_index) const { |
| 286 | std::vector<u8> buffer; | 286 | std::vector<u8> buffer; |
| 287 | const bool is_buffer_a{BufferDescriptorA().size() > buffer_index && | 287 | const bool is_buffer_a{BufferDescriptorA().size() > std::size_t(buffer_index) && |
| 288 | BufferDescriptorA()[buffer_index].Size()}; | 288 | BufferDescriptorA()[buffer_index].Size()}; |
| 289 | auto& memory = Core::System::GetInstance().Memory(); | 289 | auto& memory = Core::System::GetInstance().Memory(); |
| 290 | 290 | ||
| 291 | if (is_buffer_a) { | 291 | if (is_buffer_a) { |
| 292 | ASSERT_MSG(BufferDescriptorA().size() > buffer_index, | 292 | ASSERT_MSG(BufferDescriptorA().size() > std::size_t(buffer_index), |
| 293 | "BufferDescriptorA invalid buffer_index {}", buffer_index); | 293 | "BufferDescriptorA invalid buffer_index {}", buffer_index); |
| 294 | buffer.resize(BufferDescriptorA()[buffer_index].Size()); | 294 | buffer.resize(BufferDescriptorA()[buffer_index].Size()); |
| 295 | memory.ReadBlock(BufferDescriptorA()[buffer_index].Address(), buffer.data(), buffer.size()); | 295 | memory.ReadBlock(BufferDescriptorA()[buffer_index].Address(), buffer.data(), buffer.size()); |
| 296 | } else { | 296 | } else { |
| 297 | ASSERT_MSG(BufferDescriptorX().size() > buffer_index, | 297 | ASSERT_MSG(BufferDescriptorX().size() > std::size_t(buffer_index), |
| 298 | "BufferDescriptorX invalid buffer_index {}", buffer_index); | 298 | "BufferDescriptorX invalid buffer_index {}", buffer_index); |
| 299 | buffer.resize(BufferDescriptorX()[buffer_index].Size()); | 299 | buffer.resize(BufferDescriptorX()[buffer_index].Size()); |
| 300 | memory.ReadBlock(BufferDescriptorX()[buffer_index].Address(), buffer.data(), buffer.size()); | 300 | memory.ReadBlock(BufferDescriptorX()[buffer_index].Address(), buffer.data(), buffer.size()); |
| @@ -310,7 +310,7 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size, | |||
| 310 | return 0; | 310 | return 0; |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | const bool is_buffer_b{BufferDescriptorB().size() > buffer_index && | 313 | const bool is_buffer_b{BufferDescriptorB().size() > std::size_t(buffer_index) && |
| 314 | BufferDescriptorB()[buffer_index].Size()}; | 314 | BufferDescriptorB()[buffer_index].Size()}; |
| 315 | const std::size_t buffer_size{GetWriteBufferSize(buffer_index)}; | 315 | const std::size_t buffer_size{GetWriteBufferSize(buffer_index)}; |
| 316 | if (size > buffer_size) { | 316 | if (size > buffer_size) { |
| @@ -321,13 +321,13 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size, | |||
| 321 | 321 | ||
| 322 | auto& memory = Core::System::GetInstance().Memory(); | 322 | auto& memory = Core::System::GetInstance().Memory(); |
| 323 | if (is_buffer_b) { | 323 | if (is_buffer_b) { |
| 324 | ASSERT_MSG(BufferDescriptorB().size() > buffer_index, | 324 | ASSERT_MSG(BufferDescriptorB().size() > std::size_t(buffer_index), |
| 325 | "BufferDescriptorB invalid buffer_index {}", buffer_index); | 325 | "BufferDescriptorB invalid buffer_index {}", buffer_index); |
| 326 | ASSERT_MSG(BufferDescriptorB()[buffer_index].Size() >= size, | 326 | ASSERT_MSG(BufferDescriptorB()[buffer_index].Size() >= size, |
| 327 | "BufferDescriptorB buffer_index {} is not large enough", buffer_index); | 327 | "BufferDescriptorB buffer_index {} is not large enough", buffer_index); |
| 328 | memory.WriteBlock(BufferDescriptorB()[buffer_index].Address(), buffer, size); | 328 | memory.WriteBlock(BufferDescriptorB()[buffer_index].Address(), buffer, size); |
| 329 | } else { | 329 | } else { |
| 330 | ASSERT_MSG(BufferDescriptorC().size() > buffer_index, | 330 | ASSERT_MSG(BufferDescriptorC().size() > std::size_t(buffer_index), |
| 331 | "BufferDescriptorC invalid buffer_index {}", buffer_index); | 331 | "BufferDescriptorC invalid buffer_index {}", buffer_index); |
| 332 | ASSERT_MSG(BufferDescriptorC()[buffer_index].Size() >= size, | 332 | ASSERT_MSG(BufferDescriptorC()[buffer_index].Size() >= size, |
| 333 | "BufferDescriptorC buffer_index {} is not large enough", buffer_index); | 333 | "BufferDescriptorC buffer_index {} is not large enough", buffer_index); |
| @@ -338,16 +338,16 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size, | |||
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | std::size_t HLERequestContext::GetReadBufferSize(int buffer_index) const { | 340 | std::size_t HLERequestContext::GetReadBufferSize(int buffer_index) const { |
| 341 | const bool is_buffer_a{BufferDescriptorA().size() > buffer_index && | 341 | const bool is_buffer_a{BufferDescriptorA().size() > std::size_t(buffer_index) && |
| 342 | BufferDescriptorA()[buffer_index].Size()}; | 342 | BufferDescriptorA()[buffer_index].Size()}; |
| 343 | if (is_buffer_a) { | 343 | if (is_buffer_a) { |
| 344 | ASSERT_MSG(BufferDescriptorA().size() > buffer_index, | 344 | ASSERT_MSG(BufferDescriptorA().size() > std::size_t(buffer_index), |
| 345 | "BufferDescriptorA invalid buffer_index {}", buffer_index); | 345 | "BufferDescriptorA invalid buffer_index {}", buffer_index); |
| 346 | ASSERT_MSG(BufferDescriptorA()[buffer_index].Size() > 0, | 346 | ASSERT_MSG(BufferDescriptorA()[buffer_index].Size() > 0, |
| 347 | "BufferDescriptorA buffer_index {} is empty", buffer_index); | 347 | "BufferDescriptorA buffer_index {} is empty", buffer_index); |
| 348 | return BufferDescriptorA()[buffer_index].Size(); | 348 | return BufferDescriptorA()[buffer_index].Size(); |
| 349 | } else { | 349 | } else { |
| 350 | ASSERT_MSG(BufferDescriptorX().size() > buffer_index, | 350 | ASSERT_MSG(BufferDescriptorX().size() > std::size_t(buffer_index), |
| 351 | "BufferDescriptorX invalid buffer_index {}", buffer_index); | 351 | "BufferDescriptorX invalid buffer_index {}", buffer_index); |
| 352 | ASSERT_MSG(BufferDescriptorX()[buffer_index].Size() > 0, | 352 | ASSERT_MSG(BufferDescriptorX()[buffer_index].Size() > 0, |
| 353 | "BufferDescriptorX buffer_index {} is empty", buffer_index); | 353 | "BufferDescriptorX buffer_index {} is empty", buffer_index); |
| @@ -356,14 +356,14 @@ std::size_t HLERequestContext::GetReadBufferSize(int buffer_index) const { | |||
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | std::size_t HLERequestContext::GetWriteBufferSize(int buffer_index) const { | 358 | std::size_t HLERequestContext::GetWriteBufferSize(int buffer_index) const { |
| 359 | const bool is_buffer_b{BufferDescriptorB().size() > buffer_index && | 359 | const bool is_buffer_b{BufferDescriptorB().size() > std::size_t(buffer_index) && |
| 360 | BufferDescriptorB()[buffer_index].Size()}; | 360 | BufferDescriptorB()[buffer_index].Size()}; |
| 361 | if (is_buffer_b) { | 361 | if (is_buffer_b) { |
| 362 | ASSERT_MSG(BufferDescriptorB().size() > buffer_index, | 362 | ASSERT_MSG(BufferDescriptorB().size() > std::size_t(buffer_index), |
| 363 | "BufferDescriptorB invalid buffer_index {}", buffer_index); | 363 | "BufferDescriptorB invalid buffer_index {}", buffer_index); |
| 364 | return BufferDescriptorB()[buffer_index].Size(); | 364 | return BufferDescriptorB()[buffer_index].Size(); |
| 365 | } else { | 365 | } else { |
| 366 | ASSERT_MSG(BufferDescriptorC().size() > buffer_index, | 366 | ASSERT_MSG(BufferDescriptorC().size() > std::size_t(buffer_index), |
| 367 | "BufferDescriptorC invalid buffer_index {}", buffer_index); | 367 | "BufferDescriptorC invalid buffer_index {}", buffer_index); |
| 368 | return BufferDescriptorC()[buffer_index].Size(); | 368 | return BufferDescriptorC()[buffer_index].Size(); |
| 369 | } | 369 | } |
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 82a5dbf14..175cabf45 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -129,7 +129,7 @@ private: | |||
| 129 | LOG_DEBUG(Service_Audio, "called. rendering_time_limit_percent={}", | 129 | LOG_DEBUG(Service_Audio, "called. rendering_time_limit_percent={}", |
| 130 | rendering_time_limit_percent); | 130 | rendering_time_limit_percent); |
| 131 | 131 | ||
| 132 | ASSERT(rendering_time_limit_percent >= 0 && rendering_time_limit_percent <= 100); | 132 | ASSERT(rendering_time_limit_percent <= 100); |
| 133 | 133 | ||
| 134 | IPC::ResponseBuilder rb{ctx, 2}; | 134 | IPC::ResponseBuilder rb{ctx, 2}; |
| 135 | rb.Push(RESULT_SUCCESS); | 135 | rb.Push(RESULT_SUCCESS); |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 102017d73..cadc03805 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -451,7 +451,8 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy | |||
| 451 | 451 | ||
| 452 | if (res != Loader::ResultStatus::Success) { | 452 | if (res != Loader::ResultStatus::Success) { |
| 453 | FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; | 453 | FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()}; |
| 454 | auto [nacp_unique, discard] = pm.GetControlMetadata(); | 454 | const auto metadata = pm.GetControlMetadata(); |
| 455 | const auto& nacp_unique = metadata.first; | ||
| 455 | 456 | ||
| 456 | if (nacp_unique != nullptr) { | 457 | if (nacp_unique != nullptr) { |
| 457 | new_size = {nacp_unique->GetDefaultNormalSaveSize(), | 458 | new_size = {nacp_unique->GetDefaultNormalSaveSize(), |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index e6811d5b5..61045c75c 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -575,6 +575,7 @@ private: | |||
| 575 | 0, | 575 | 0, |
| 576 | user_id->GetSize(), | 576 | user_id->GetSize(), |
| 577 | {}, | 577 | {}, |
| 578 | {}, | ||
| 578 | }); | 579 | }); |
| 579 | 580 | ||
| 580 | continue; | 581 | continue; |
| @@ -595,6 +596,7 @@ private: | |||
| 595 | stoull_be(title_id->GetName()), | 596 | stoull_be(title_id->GetName()), |
| 596 | title_id->GetSize(), | 597 | title_id->GetSize(), |
| 597 | {}, | 598 | {}, |
| 599 | {}, | ||
| 598 | }); | 600 | }); |
| 599 | } | 601 | } |
| 600 | } | 602 | } |
| @@ -619,6 +621,7 @@ private: | |||
| 619 | stoull_be(title_id->GetName()), | 621 | stoull_be(title_id->GetName()), |
| 620 | title_id->GetSize(), | 622 | title_id->GetSize(), |
| 621 | {}, | 623 | {}, |
| 624 | {}, | ||
| 622 | }); | 625 | }); |
| 623 | } | 626 | } |
| 624 | } | 627 | } |
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 07b553a43..c8159bcd5 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -309,7 +309,7 @@ static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | |||
| 309 | offset = GetTZName(name, offset); | 309 | offset = GetTZName(name, offset); |
| 310 | std_len = offset; | 310 | std_len = offset; |
| 311 | } | 311 | } |
| 312 | if (!std_len) { | 312 | if (std_len == 0) { |
| 313 | return {}; | 313 | return {}; |
| 314 | } | 314 | } |
| 315 | if (!GetOffset(name, offset, std_offset)) { | 315 | if (!GetOffset(name, offset, std_offset)) { |
| @@ -320,7 +320,7 @@ static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | |||
| 320 | int dest_len{}; | 320 | int dest_len{}; |
| 321 | int dest_offset{}; | 321 | int dest_offset{}; |
| 322 | const char* dest_name{name + offset}; | 322 | const char* dest_name{name + offset}; |
| 323 | if (rule.chars.size() < char_count) { | 323 | if (rule.chars.size() < std::size_t(char_count)) { |
| 324 | return {}; | 324 | return {}; |
| 325 | } | 325 | } |
| 326 | 326 | ||
| @@ -343,7 +343,7 @@ static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | |||
| 343 | return {}; | 343 | return {}; |
| 344 | } | 344 | } |
| 345 | char_count += dest_len + 1; | 345 | char_count += dest_len + 1; |
| 346 | if (rule.chars.size() < char_count) { | 346 | if (rule.chars.size() < std::size_t(char_count)) { |
| 347 | return {}; | 347 | return {}; |
| 348 | } | 348 | } |
| 349 | if (name[offset] != '\0' && name[offset] != ',' && name[offset] != ';') { | 349 | if (name[offset] != '\0' && name[offset] != ',' && name[offset] != ';') { |
| @@ -414,7 +414,7 @@ static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | |||
| 414 | if (is_reversed || | 414 | if (is_reversed || |
| 415 | (start_time < end_time && | 415 | (start_time < end_time && |
| 416 | (end_time - start_time < (year_seconds + (std_offset - dest_offset))))) { | 416 | (end_time - start_time < (year_seconds + (std_offset - dest_offset))))) { |
| 417 | if (rule.ats.size() - 2 < time_count) { | 417 | if (rule.ats.size() - 2 < std::size_t(time_count)) { |
| 418 | break; | 418 | break; |
| 419 | } | 419 | } |
| 420 | 420 | ||
| @@ -609,7 +609,7 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi | |||
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | const u64 position{(read_offset - sizeof(TzifHeader))}; | 611 | const u64 position{(read_offset - sizeof(TzifHeader))}; |
| 612 | const std::size_t bytes_read{vfs_file->GetSize() - sizeof(TzifHeader) - position}; | 612 | const s64 bytes_read = s64(vfs_file->GetSize() - sizeof(TzifHeader) - position); |
| 613 | if (bytes_read < 0) { | 613 | if (bytes_read < 0) { |
| 614 | return {}; | 614 | return {}; |
| 615 | } | 615 | } |
| @@ -621,11 +621,11 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi | |||
| 621 | std::array<char, time_zone_name_max + 1> temp_name{}; | 621 | std::array<char, time_zone_name_max + 1> temp_name{}; |
| 622 | vfs_file->ReadArray(temp_name.data(), bytes_read, read_offset); | 622 | vfs_file->ReadArray(temp_name.data(), bytes_read, read_offset); |
| 623 | if (bytes_read > 2 && temp_name[0] == '\n' && temp_name[bytes_read - 1] == '\n' && | 623 | if (bytes_read > 2 && temp_name[0] == '\n' && temp_name[bytes_read - 1] == '\n' && |
| 624 | time_zone_rule.type_count + 2 <= time_zone_rule.ttis.size()) { | 624 | std::size_t(time_zone_rule.type_count) + 2 <= time_zone_rule.ttis.size()) { |
| 625 | temp_name[bytes_read - 1] = '\0'; | 625 | temp_name[bytes_read - 1] = '\0'; |
| 626 | 626 | ||
| 627 | std::array<char, time_zone_name_max> name{}; | 627 | std::array<char, time_zone_name_max> name{}; |
| 628 | std::memcpy(name.data(), temp_name.data() + 1, bytes_read - 1); | 628 | std::memcpy(name.data(), temp_name.data() + 1, std::size_t(bytes_read - 1)); |
| 629 | 629 | ||
| 630 | TimeZoneRule temp_rule; | 630 | TimeZoneRule temp_rule; |
| 631 | if (ParsePosixName(name.data(), temp_rule)) { | 631 | if (ParsePosixName(name.data(), temp_rule)) { |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index fdc62d05b..7f109f4eb 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -101,8 +101,8 @@ public: | |||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | std::u16string ReadInterfaceToken() { | 103 | std::u16string ReadInterfaceToken() { |
| 104 | u32 unknown = Read<u32_le>(); | 104 | [[maybe_unused]] const u32 unknown = Read<u32_le>(); |
| 105 | u32 length = Read<u32_le>(); | 105 | const u32 length = Read<u32_le>(); |
| 106 | 106 | ||
| 107 | std::u16string token{}; | 107 | std::u16string token{}; |
| 108 | 108 | ||
diff --git a/src/core/memory/dmnt_cheat_vm.cpp b/src/core/memory/dmnt_cheat_vm.cpp index 4f4fa5099..5bb26a36f 100644 --- a/src/core/memory/dmnt_cheat_vm.cpp +++ b/src/core/memory/dmnt_cheat_vm.cpp | |||
| @@ -55,7 +55,7 @@ void DmntCheatVm::LogOpcode(const CheatVmOpcode& opcode) { | |||
| 55 | fmt::format("Cond Type: {:X}", static_cast<u32>(begin_cond->cond_type))); | 55 | fmt::format("Cond Type: {:X}", static_cast<u32>(begin_cond->cond_type))); |
| 56 | callbacks->CommandLog(fmt::format("Rel Addr: {:X}", begin_cond->rel_address)); | 56 | callbacks->CommandLog(fmt::format("Rel Addr: {:X}", begin_cond->rel_address)); |
| 57 | callbacks->CommandLog(fmt::format("Value: {:X}", begin_cond->value.bit64)); | 57 | callbacks->CommandLog(fmt::format("Value: {:X}", begin_cond->value.bit64)); |
| 58 | } else if (auto end_cond = std::get_if<EndConditionalOpcode>(&opcode.opcode)) { | 58 | } else if (std::holds_alternative<EndConditionalOpcode>(opcode.opcode)) { |
| 59 | callbacks->CommandLog("Opcode: End Conditional"); | 59 | callbacks->CommandLog("Opcode: End Conditional"); |
| 60 | } else if (auto ctrl_loop = std::get_if<ControlLoopOpcode>(&opcode.opcode)) { | 60 | } else if (auto ctrl_loop = std::get_if<ControlLoopOpcode>(&opcode.opcode)) { |
| 61 | if (ctrl_loop->start_loop) { | 61 | if (ctrl_loop->start_loop) { |
| @@ -399,6 +399,7 @@ bool DmntCheatVm::DecodeNextOpcode(CheatVmOpcode& out) { | |||
| 399 | // 8kkkkkkk | 399 | // 8kkkkkkk |
| 400 | // Just parse the mask. | 400 | // Just parse the mask. |
| 401 | begin_keypress_cond.key_mask = first_dword & 0x0FFFFFFF; | 401 | begin_keypress_cond.key_mask = first_dword & 0x0FFFFFFF; |
| 402 | opcode.opcode = begin_keypress_cond; | ||
| 402 | } break; | 403 | } break; |
| 403 | case CheatVmOpcodeType::PerformArithmeticRegister: { | 404 | case CheatVmOpcodeType::PerformArithmeticRegister: { |
| 404 | PerformArithmeticRegisterOpcode perform_math_reg{}; | 405 | PerformArithmeticRegisterOpcode perform_math_reg{}; |
| @@ -779,7 +780,7 @@ void DmntCheatVm::Execute(const CheatProcessMetadata& metadata) { | |||
| 779 | if (!cond_met) { | 780 | if (!cond_met) { |
| 780 | SkipConditionalBlock(); | 781 | SkipConditionalBlock(); |
| 781 | } | 782 | } |
| 782 | } else if (auto end_cond = std::get_if<EndConditionalOpcode>(&cur_opcode.opcode)) { | 783 | } else if (std::holds_alternative<EndConditionalOpcode>(cur_opcode.opcode)) { |
| 783 | // Decrement the condition depth. | 784 | // Decrement the condition depth. |
| 784 | // We will assume, graciously, that mismatched conditional block ends are a nop. | 785 | // We will assume, graciously, that mismatched conditional block ends are a nop. |
| 785 | if (condition_depth > 0) { | 786 | if (condition_depth > 0) { |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 0f3685d1c..fd5a3ee9f 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -153,9 +153,9 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) { | |||
| 153 | app_loader.ReadTitle(name); | 153 | app_loader.ReadTitle(name); |
| 154 | 154 | ||
| 155 | if (name.empty()) { | 155 | if (name.empty()) { |
| 156 | auto [nacp, icon_file] = FileSys::PatchManager(program_id).GetControlMetadata(); | 156 | const auto metadata = FileSys::PatchManager(program_id).GetControlMetadata(); |
| 157 | if (nacp != nullptr) { | 157 | if (metadata.first != nullptr) { |
| 158 | name = nacp->GetApplicationName(); | 158 | name = metadata.first->GetApplicationName(); |
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| 161 | 161 | ||