diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp index c68fe753b..639e7d941 100644 --- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -25,8 +25,8 @@ namespace { QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) { QImage decoded_image(info.width, info.height, QImage::Format_ARGB32); - for (int y = 0; y < info.height; ++y) { - for (int x = 0; x < info.width; ++x) { + for (unsigned int y = 0; y < info.height; ++y) { + for (unsigned int x = 0; x < info.width; ++x) { Math::Vec4 color = Pica::Texture::LookupTexture(src, x, y, info, true); decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a())); } diff --git a/src/core/core.cpp b/src/core/core.cpp index 140ff6451..0be21a6a7 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -82,14 +82,15 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file ResultStatus init_result{Init(emu_window, system_mode.get())}; if (init_result != ResultStatus::Success) { - LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result); + LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", + static_cast(init_result)); System::Shutdown(); return init_result; } const Loader::ResultStatus load_result{app_loader->Load()}; if (Loader::ResultStatus::Success != load_result) { - LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result); + LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", static_cast(load_result)); System::Shutdown(); switch (load_result) { diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 123fe7cd4..6934fa5de 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -302,7 +302,9 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) { auto bp = p.find(addr); if (bp != p.end()) { LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: %08x bytes at %08x of type %d\n", - bp->second.len, bp->second.addr, type); + static_cast(bp->second.len), + static_cast(bp->second.addr), + static_cast(type)); p.erase(addr); } } @@ -348,7 +350,8 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) { if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) { LOG_DEBUG(Debug_GDBStub, - "Found breakpoint type %d @ %08x, range: %08x - %08x (%d bytes)\n", type, + "Found breakpoint type %d @ %08x, range: %08x - %08x (%d bytes)\n", + static_cast(type), addr, bp->second.addr, bp->second.addr + len, len); return true; } @@ -734,7 +737,8 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u32 len) { breakpoint.len = len; p.insert({addr, breakpoint}); - LOG_DEBUG(Debug_GDBStub, "gdb: added %d breakpoint: %08x bytes at %08x\n", type, breakpoint.len, + LOG_DEBUG(Debug_GDBStub, "gdb: added %d breakpoint: %08x bytes at %08x\n", + static_cast(type), breakpoint.len, breakpoint.addr); return true; diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 9c43ed2fd..879dfff0d 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -62,7 +62,7 @@ ResultCode Applet::Create(Service::APT::AppletId id) { applets[id] = std::make_shared(id); break; default: - LOG_ERROR(Service_APT, "Could not create applet %u", id); + LOG_ERROR(Service_APT, "Could not create applet %u", static_cast(id)); // TODO(Subv): Find the right error code return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotSupported, ErrorLevel::Permanent); @@ -82,7 +82,7 @@ std::shared_ptr Applet::Get(Service::APT::AppletId id) { static void AppletUpdateEvent(u64 applet_id, int cycles_late) { Service::APT::AppletId id = static_cast(applet_id); std::shared_ptr applet = Applet::Get(id); - ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", id); + ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", static_cast(id)); applet->Update(); diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 01fab123e..5381d32e4 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -73,7 +73,7 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, } default: - LOG_ERROR(Kernel, "unknown type=%d", type); + LOG_ERROR(Kernel, "unknown type=%d", static_cast(type)); return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage); } diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index ba80fe7f8..f76b56d7f 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -90,6 +90,9 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { mapping.size = Memory::PAGE_SIZE; mapping.writable = true; // TODO: Not sure if correct mapping.unk_flag = false; + + // Missing line?? + address_mappings.push_back(mapping); } else if ((type & 0xFE0) == 0xFC0) { // 0x01FF // Kernel version kernel_version = descriptor & 0xFFFF; diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d344a622f..68ffe5222 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -42,7 +42,7 @@ void FindContentInfos(Service::Interface* self) { am_content_count[media_type] = cmd_buff[4]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, " + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016lx, content_cound=%u, " "content_ids_pointer=0x%08x, content_info_pointer=0x%08x", media_type, title_id, am_content_count[media_type], content_ids_pointer, content_info_pointer); diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 1517d3a2f..4c5c09897 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -353,12 +353,12 @@ void PrepareToStartLibraryApplet(Service::Interface* self) { AppletId applet_id = static_cast(cmd_buff[1]); auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { - LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id); + LOG_WARNING(Service_APT, "applet has already been started id=%08X", static_cast(applet_id)); cmd_buff[1] = RESULT_SUCCESS.raw; } else { cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw; } - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); } void PreloadLibraryApplet(Service::Interface* self) { @@ -366,12 +366,13 @@ void PreloadLibraryApplet(Service::Interface* self) { AppletId applet_id = static_cast(cmd_buff[1]); auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { - LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id); + LOG_WARNING(Service_APT, "applet has already been started id=%08X", + static_cast(applet_id)); cmd_buff[1] = RESULT_SUCCESS.raw; } else { cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw; } - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); } void StartLibraryApplet(Service::Interface* self) { @@ -379,10 +380,10 @@ void StartLibraryApplet(Service::Interface* self) { AppletId applet_id = static_cast(cmd_buff[1]); std::shared_ptr applet = HLE::Applets::Applet::Get(applet_id); - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); if (applet == nullptr) { - LOG_ERROR(Service_APT, "unknown applet id=%08X", applet_id); + LOG_ERROR(Service_APT, "unknown applet id=%08X", static_cast(applet_id)); cmd_buff[1] = -1; // TODO(Subv): Find the right error code return; } @@ -415,7 +416,7 @@ void SetScreenCapPostPermission(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", - screen_capture_post_permission); + static_cast(screen_capture_post_permission)); } void GetScreenCapPostPermission(Service::Interface* self) { @@ -425,7 +426,7 @@ void GetScreenCapPostPermission(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(screen_capture_post_permission); LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", - screen_capture_post_permission); + static_cast(screen_capture_post_permission)); } void GetAppletInfo(Service::Interface* self) { @@ -444,7 +445,7 @@ void GetAppletInfo(Service::Interface* self) { ErrorSummary::NotFound, ErrorLevel::Status) .raw; } - LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id); + LOG_WARNING(Service_APT, "(stubbed) called appid=%u", static_cast(app_id)); } void GetStartupArgument(Service::Interface* self) { @@ -466,7 +467,7 @@ void GetStartupArgument(Service::Interface* self) { } LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x", - startup_argument_type, parameter_size); + static_cast(startup_argument_type), parameter_size); cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index fe8a6c2d6..b03eb0575 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -296,7 +296,8 @@ static void WriteProcessPipe(Service::Interface* self) { } ASSERT_MSG(Memory::IsValidVirtualAddress(buffer), - "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe, size, buffer); + "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", + static_cast(pipe), size, buffer); std::vector message(size); for (u32 i = 0; i < size; i++) { @@ -336,7 +337,8 @@ static void ReadPipeIfPossible(Service::Interface* self) { DSP::HLE::DspPipe pipe = static_cast(pipe_index); ASSERT_MSG(Memory::IsValidVirtualAddress(addr), - "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, + "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", + static_cast(pipe), unknown, size, addr); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2); @@ -380,8 +382,8 @@ static void ReadPipe(Service::Interface* self) { DSP::HLE::DspPipe pipe = static_cast(pipe_index); ASSERT_MSG(Memory::IsValidVirtualAddress(addr), - "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, - size, addr); + "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", + static_cast(pipe), unknown, size, addr); if (DSP::HLE::GetPipeReadableSize(pipe) >= size) { std::vector response = DSP::HLE::PipeRead(pipe, size); diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 6cddc1fdb..c0c936881 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -106,7 +106,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr server_ses if (offset + length > backend->GetSize()) { LOG_ERROR(Service_FS, - "Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX", + "Reading from out of bounds offset=0x%lX length=0x%08X file_size=0x%lX", offset, length, backend->GetSize()); } @@ -192,7 +192,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr server_ses // Unknown command... default: - LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); + LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast(cmd)); ResultCode error = UnimplementedFunction(ErrorModule::FS); cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. return; @@ -232,7 +232,7 @@ void Directory::HandleSyncRequest(Kernel::SharedPtr serve // Unknown command... default: - LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); + LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast(cmd)); ResultCode error = UnimplementedFunction(ErrorModule::FS); cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. return; @@ -300,7 +300,7 @@ ResultCode RegisterArchiveType(std::unique_ptr&& factor auto& archive = result.first->second; LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), - id_code); + static_cast(id_code)); return RESULT_SUCCESS; } @@ -475,7 +475,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) { } else if (media_type == MediaType::SDMC) { media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX); } else { - LOG_ERROR(Service_FS, "Unsupported media type %u", media_type); + LOG_ERROR(Service_FS, "Unsupported media type %u", static_cast(media_type)); return ResultCode(-1); // TODO(Subv): Find the right error code } diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 33b290699..746e7be29 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -304,7 +304,7 @@ static void CreateFile(Service::Interface* self) { FileSys::Path file_path(filename_type, filename_size, filename_ptr); - LOG_DEBUG(Service_FS, "type=%u size=%llu data=%s", static_cast(filename_type), file_size, + LOG_DEBUG(Service_FS, "type=%u size=%lu data=%s", static_cast(filename_type), file_size, file_path.DebugStr().c_str()); cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index 5eb97f0d3..86baf4c44 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -32,7 +32,8 @@ void EnterExclusiveState(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); + LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", + static_cast(exclusive_state)); } void LeaveExclusiveState(Service::Interface* self) { @@ -41,7 +42,8 @@ void LeaveExclusiveState(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); + LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", + static_cast(exclusive_state)); } void QueryExclusiveMode(Service::Interface* self) { @@ -50,7 +52,8 @@ void QueryExclusiveMode(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(exclusive_state); - LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); + LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", + static_cast(exclusive_state)); } void LockState(Service::Interface* self) { @@ -84,7 +87,8 @@ void SuspendDaemons(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", + static_cast(daemon_bit_mask)); } void ResumeDaemons(Service::Interface* self) { @@ -99,7 +103,8 @@ void ResumeDaemons(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", + static_cast(daemon_bit_mask)); } void SuspendScheduler(Service::Interface* self) { @@ -198,7 +203,8 @@ void OverrideDefaultDaemons(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", + static_cast(default_daemon_bit_mask)); } void ResetDefaultDaemons(Service::Interface* self) { @@ -207,7 +213,8 @@ void ResetDefaultDaemons(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", + static_cast(default_daemon_bit_mask)); } void GetDefaultDaemons(Service::Interface* self) { @@ -216,7 +223,8 @@ void GetDefaultDaemons(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(default_daemon_bit_mask); - LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", + static_cast(default_daemon_bit_mask)); } void ClearHalfAwakeMacFilter(Service::Interface* self) { diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 907d9c8fa..3fe861f4f 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -89,7 +89,7 @@ static void SetInputFormat(Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format); + LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast(conversion.input_format)); } static void GetInputFormat(Interface* self) { @@ -99,7 +99,7 @@ static void GetInputFormat(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(conversion.input_format); - LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format); + LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast(conversion.input_format)); } static void SetOutputFormat(Interface* self) { @@ -110,7 +110,8 @@ static void SetOutputFormat(Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format); + LOG_DEBUG(Service_Y2R, "called output_format=%hhu", + static_cast(conversion.output_format)); } static void GetOutputFormat(Interface* self) { @@ -120,7 +121,8 @@ static void GetOutputFormat(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(conversion.output_format); - LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format); + LOG_DEBUG(Service_Y2R, "called output_format=%hhu", + static_cast(conversion.output_format)); } static void SetRotation(Interface* self) { @@ -131,7 +133,7 @@ static void SetRotation(Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation); + LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast(conversion.rotation)); } static void GetRotation(Interface* self) { @@ -141,7 +143,7 @@ static void GetRotation(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(conversion.rotation); - LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation); + LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast(conversion.rotation)); } static void SetBlockAlignment(Interface* self) { @@ -152,7 +154,8 @@ static void SetBlockAlignment(Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment); + LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", + static_cast(conversion.block_alignment)); } static void GetBlockAlignment(Interface* self) { @@ -162,7 +165,8 @@ static void GetBlockAlignment(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(conversion.block_alignment); - LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment); + LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", + static_cast(conversion.block_alignment)); } /** @@ -664,8 +668,10 @@ cleanup: Service_Y2R, "called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " "input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX", - params->input_format, params->output_format, params->rotation, params->block_alignment, - params->input_line_width, params->input_lines, params->standard_coefficient, + static_cast(params->input_format), static_cast(params->output_format), + static_cast(params->rotation), static_cast(params->block_alignment), + params->input_line_width, params->input_lines, + static_cast(params->standard_coefficient), params->padding, params->alpha); } @@ -784,4 +790,4 @@ Y2R_U::~Y2R_U() { } } // namespace Y2R -} // namespace Service \ No newline at end of file +} // namespace Service diff --git a/src/core/hw/aes/ccm.cpp b/src/core/hw/aes/ccm.cpp index dc7035ab6..4f852c13b 100644 --- a/src/core/hw/aes/ccm.cpp +++ b/src/core/hw/aes/ccm.cpp @@ -46,7 +46,7 @@ public: std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& nonce, size_t slot_id) { if (!IsNormalKeyAvailable(slot_id)) { - LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", slot_id); + LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", static_cast(slot_id)); } const AESKey normal = GetNormalKey(slot_id); std::vector cipher(pdata.size() + CCM_MAC_SIZE); @@ -67,7 +67,8 @@ std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& non std::vector DecryptVerifyCCM(const std::vector& cipher, const CCMNonce& nonce, size_t slot_id) { if (!IsNormalKeyAvailable(slot_id)) { - LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", slot_id); + LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", + static_cast(slot_id)); } const AESKey normal = GetNormalKey(slot_id); const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE; diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 42809c731..a60ee9eb4 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -64,7 +64,7 @@ static Math::Vec4 DecodePixel(Regs::PixelFormat input_format, const u8* src_ return Color::DecodeRGBA4(src_pixel); default: - LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", input_format); + LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", static_cast(input_format)); return {0, 0, 0, 0}; } } @@ -302,7 +302,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { default: LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x", - config.output_format.Value()); + static_cast(config.output_format.Value())); break; } } diff --git a/src/video_core/regs_framebuffer.h b/src/video_core/regs_framebuffer.h index 366782080..d8a135744 100644 --- a/src/video_core/regs_framebuffer.h +++ b/src/video_core/regs_framebuffer.h @@ -193,7 +193,7 @@ struct FramebufferRegs { case ColorFormat::RGBA4: return 2; default: - LOG_CRITICAL(HW_GPU, "Unknown color format %u", format); + LOG_CRITICAL(HW_GPU, "Unknown color format %u", static_cast(format)); UNIMPLEMENTED(); } } @@ -256,7 +256,7 @@ struct FramebufferRegs { case DepthFormat::D24S8: return 4; default: - LOG_CRITICAL(HW_GPU, "Unknown depth format %u", format); + LOG_CRITICAL(HW_GPU, "Unknown depth format %u", static_cast(format)); UNIMPLEMENTED(); } } @@ -270,7 +270,7 @@ struct FramebufferRegs { case DepthFormat::D24S8: return 24; default: - LOG_CRITICAL(HW_GPU, "Unknown depth format %u", format); + LOG_CRITICAL(HW_GPU, "Unknown depth format %u", static_cast(format)); UNIMPLEMENTED(); } } diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index de1d5eba7..27a6b3962 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1125,7 +1125,8 @@ void RasterizerOpenGL::SyncCullMode() { break; default: - LOG_CRITICAL(Render_OpenGL, "Unknown cull mode %d", regs.rasterizer.cull_mode.Value()); + LOG_CRITICAL(Render_OpenGL, "Unknown cull mode %d", + static_cast(regs.rasterizer.cull_mode.Value())); UNIMPLEMENTED(); break; } diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 7abdeba05..f00bb9b8b 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -83,7 +83,7 @@ static void AppendSource(std::string& out, const PicaShaderConfig& config, break; default: out += "vec4(0.0)"; - LOG_CRITICAL(Render_OpenGL, "Unknown source op %u", source); + LOG_CRITICAL(Render_OpenGL, "Unknown source op %u", static_cast(source)); break; } } @@ -141,7 +141,7 @@ static void AppendColorModifier(std::string& out, const PicaShaderConfig& config break; default: out += "vec3(0.0)"; - LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op %u", modifier); + LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op %u", static_cast(modifier)); break; } } @@ -190,7 +190,7 @@ static void AppendAlphaModifier(std::string& out, const PicaShaderConfig& config break; default: out += "0.0"; - LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op %u", modifier); + LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op %u", static_cast(modifier)); break; } } @@ -235,7 +235,8 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper break; default: out += "vec3(0.0)"; - LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: %u", operation); + LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: %u", + static_cast(operation)); break; } out += ", vec3(0.0), vec3(1.0))"; // Clamp result to 0.0, 1.0 @@ -275,7 +276,8 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper break; default: out += "0.0"; - LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: %u", operation); + LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: %u", + static_cast(operation)); break; } out += ", 0.0, 1.0)"; @@ -305,7 +307,7 @@ static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareF default: out += "false"; - LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition %u", func); + LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition %u", static_cast(func)); break; } } diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h index 93d7b0b71..6f9903d78 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -89,7 +89,7 @@ inline GLenum BlendEquation(Pica::FramebufferRegs::BlendEquation equation) { // Range check table for input if (static_cast(equation) >= ARRAY_SIZE(blend_equation_table)) { - LOG_CRITICAL(Render_OpenGL, "Unknown blend equation %d", equation); + LOG_CRITICAL(Render_OpenGL, "Unknown blend equation %d", static_cast(equation)); UNREACHABLE(); return GL_FUNC_ADD; @@ -119,7 +119,7 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) { // Range check table for input if (static_cast(factor) >= ARRAY_SIZE(blend_func_table)) { - LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", factor); + LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", static_cast(factor)); UNREACHABLE(); return GL_ONE; @@ -150,7 +150,7 @@ inline GLenum LogicOp(Pica::FramebufferRegs::LogicOp op) { // Range check table for input if (static_cast(op) >= ARRAY_SIZE(logic_op_table)) { - LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", op); + LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", static_cast(op)); UNREACHABLE(); return GL_COPY; @@ -173,7 +173,7 @@ inline GLenum CompareFunc(Pica::FramebufferRegs::CompareFunc func) { // Range check table for input if (static_cast(func) >= ARRAY_SIZE(compare_func_table)) { - LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", func); + LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", static_cast(func)); UNREACHABLE(); return GL_ALWAYS; @@ -196,7 +196,7 @@ inline GLenum StencilOp(Pica::FramebufferRegs::StencilAction action) { // Range check table for input if (static_cast(action) >= ARRAY_SIZE(stencil_op_table)) { - LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", action); + LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", static_cast(action)); UNREACHABLE(); return GL_KEEP; diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp index 2dbc8b147..f1d4621d6 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.cpp +++ b/src/video_core/shader/shader_jit_x64_compiler.cpp @@ -808,7 +808,7 @@ void JitShader::Compile_NextInstr() { } else { // Unhandled instruction LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x%02x (0x%08x)", - instr.opcode.Value().EffectiveOpCode(), instr.hex); + static_cast(instr.opcode.Value().EffectiveOpCode()), instr.hex); } } diff --git a/src/video_core/swrasterizer/framebuffer.cpp b/src/video_core/swrasterizer/framebuffer.cpp index 7de3aac75..dfc26df87 100644 --- a/src/video_core/swrasterizer/framebuffer.cpp +++ b/src/video_core/swrasterizer/framebuffer.cpp @@ -58,7 +58,7 @@ void DrawPixel(int x, int y, const Math::Vec4& color) { default: LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x", - framebuffer.color_format.Value()); + static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } } @@ -94,7 +94,7 @@ const Math::Vec4 GetPixel(int x, int y) { default: LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x", - framebuffer.color_format.Value()); + static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } @@ -123,7 +123,8 @@ u32 GetDepth(int x, int y) { case FramebufferRegs::DepthFormat::D24S8: return Color::DecodeD24S8(src_pixel).x; default: - LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format); + LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", + static_cast(framebuffer.depth_format)); UNIMPLEMENTED(); return 0; } @@ -151,7 +152,7 @@ u8 GetStencil(int x, int y) { LOG_WARNING( HW_GPU, "GetStencil called for function which doesn't have a stencil component (format %u)", - framebuffer.depth_format); + static_cast(framebuffer.depth_format)); return 0; } } @@ -184,7 +185,8 @@ void SetDepth(int x, int y, u32 value) { break; default: - LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format); + LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", + static_cast(framebuffer.depth_format)); UNIMPLEMENTED(); break; } @@ -215,7 +217,8 @@ void SetStencil(int x, int y, u8 value) { break; default: - LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format); + LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", + static_cast(framebuffer.depth_format)); UNIMPLEMENTED(); break; } @@ -250,7 +253,7 @@ u8 PerformStencilAction(FramebufferRegs::StencilAction action, u8 old_stencil, u return old_stencil - 1; default: - LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action); + LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", static_cast(action)); UNIMPLEMENTED(); return 0; } @@ -294,7 +297,7 @@ Math::Vec4 EvaluateBlendEquation(const Math::Vec4& src, const Math::Vec4 break; default: - LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation %x", equation); + LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation %x", static_cast(equation)); UNIMPLEMENTED(); } diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 7557fcb89..d7e60e814 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -309,8 +309,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder && (t < 0 || static_cast(t) >= texture.config.height))) { auto border_color = texture.config.border_color; - texture_color[i] = {border_color.r, border_color.g, border_color.b, - border_color.a}; + texture_color[i] = {static_cast(border_color.r), + static_cast(border_color.r), + static_cast(border_color.r), + static_cast(border_color.r)}; } else { // Textures are laid out from bottom to top, hence we invert the t coordinate. // NOTE: This may not be the right place for the inversion. @@ -342,10 +344,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve Math::Vec4 combiner_output; Math::Vec4 combiner_buffer = {0, 0, 0, 0}; Math::Vec4 next_combiner_buffer = { - regs.texturing.tev_combiner_buffer_color.r, - regs.texturing.tev_combiner_buffer_color.g, - regs.texturing.tev_combiner_buffer_color.b, - regs.texturing.tev_combiner_buffer_color.a, + static_cast(regs.texturing.tev_combiner_buffer_color.r), + static_cast(regs.texturing.tev_combiner_buffer_color.g), + static_cast(regs.texturing.tev_combiner_buffer_color.b), + static_cast(regs.texturing.tev_combiner_buffer_color.a), }; for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); @@ -378,8 +380,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve return combiner_buffer; case Source::Constant: - return {tev_stage.const_r, tev_stage.const_g, tev_stage.const_b, - tev_stage.const_a}; + return {static_cast(tev_stage.const_r), + static_cast(tev_stage.const_g), + static_cast(tev_stage.const_b), + static_cast(tev_stage.const_a)}; case Source::Previous: return combiner_output; @@ -697,7 +701,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve return std::min(combiner_output.a(), static_cast(255 - dest.a())); default: - LOG_CRITICAL(HW_GPU, "Unknown blend factor %x", factor); + LOG_CRITICAL(HW_GPU, "Unknown blend factor %x", static_cast(factor)); UNIMPLEMENTED(); break; }