From 499508389c7701f11ab07dd7cdc19b2c7cbba53f Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 1 Nov 2017 12:19:51 +0200 Subject: [PATCH] core: clear format warnings --- src/core/core.cpp | 5 ++-- src/core/gdbstub/gdbstub.cpp | 10 ++++---- src/core/hle/applets/applet.cpp | 4 ++-- src/core/hle/kernel/address_arbiter.cpp | 2 +- src/core/hle/service/apt/apt.cpp | 24 ++++++++++--------- src/core/hle/service/dsp_dsp.cpp | 10 ++++---- src/core/hle/service/fs/archive.cpp | 13 ++++++----- src/core/hle/service/fs/fs_user.cpp | 5 ++-- src/core/hle/service/ndm/ndm.cpp | 31 ++++++++++++++----------- src/core/hle/service/sm/srv.cpp | 5 ++-- src/core/hle/service/y2r_u.cpp | 25 +++++++++++--------- src/core/hw/aes/ccm.cpp | 4 ++-- src/core/hw/gpu.cpp | 4 ++-- 13 files changed, 77 insertions(+), 65 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 0c7a72987..41a972134 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -96,14 +96,15 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file ResultStatus init_result{Init(emu_window, system_mode.first.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 %u)!", + static_cast(init_result)); System::Shutdown(); return init_result; } const Loader::ResultStatus load_result{app_loader->Load(Kernel::g_current_process)}; 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 %u)!", static_cast(load_result)); System::Shutdown(); switch (load_result) { diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index d6be16ef6..68704e72e 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -302,7 +302,7 @@ 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); + bp->second.len, bp->second.addr, static_cast(type)); p.erase(addr); } } @@ -348,8 +348,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, - addr, bp->second.addr, bp->second.addr + len, len); + "Found breakpoint type %d @ %08x, range: %08x - %08x (%u bytes)\n", + static_cast(type), addr, bp->second.addr, bp->second.addr + len, len); return true; } } @@ -738,8 +738,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, - breakpoint.addr); + 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 776d342f0..fc71adc25 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -74,7 +74,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 ERR_INVALID_ENUM_VALUE_FND; } diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 59ea9823d..e82a32868 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -554,7 +554,7 @@ void ReceiveParameter(Service::Interface* self) { "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", buffer_size, static_buff_size); - LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08zX", app_id, buffer_size); + LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); if (!next_parameter) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -603,7 +603,7 @@ void GlanceParameter(Service::Interface* self) { "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", buffer_size, static_buff_size); - LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08zX", app_id, buffer_size); + LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); if (!next_parameter) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -767,7 +767,7 @@ void PrepareToStartLibraryApplet(Service::Interface* self) { IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x18, 1, 0); // 0x180040 AppletId applet_id = static_cast(rp.Pop()); - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -775,7 +775,8 @@ void PrepareToStartLibraryApplet(Service::Interface* self) { 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)); rb.Push(RESULT_SUCCESS); } else { rb.Push(HLE::Applets::Applet::Create(applet_id)); @@ -800,7 +801,7 @@ void PreloadLibraryApplet(Service::Interface* self) { IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x16, 1, 0); // 0x160040 AppletId applet_id = static_cast(rp.Pop()); - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -808,7 +809,8 @@ void PreloadLibraryApplet(Service::Interface* self) { 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)); rb.Push(RESULT_SUCCESS); } else { rb.Push(HLE::Applets::Applet::Create(applet_id)); @@ -823,7 +825,7 @@ void StartLibraryApplet(Service::Interface* self) { Kernel::Handle handle = rp.PopHandle(); VAddr buffer_addr = rp.PopStaticBuffer(); - LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); + LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -867,7 +869,7 @@ void SetScreenCapPostPermission(Service::Interface* self) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error 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) { @@ -877,7 +879,7 @@ void GetScreenCapPostPermission(Service::Interface* self) { rb.Push(RESULT_SUCCESS); // No error rb.Push(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) { @@ -899,7 +901,7 @@ void GetAppletInfo(Service::Interface* self) { rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, ErrorLevel::Status)); } - 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) { @@ -928,7 +930,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); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 42f8950f9..5ff2262a0 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -301,7 +301,7 @@ 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", pipe_index, size, buffer); std::vector message(size); for (u32 i = 0; i < size; i++) { @@ -359,8 +359,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, - size, addr); + "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe_index, + unknown, size, addr); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error @@ -403,8 +403,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", pipe_index, + 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 02911160b..ec1a65223 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include @@ -105,8 +106,8 @@ void File::HandleSyncRequest(Kernel::SharedPtr server_ses offset, length, address); if (offset + length > backend->GetSize()) { - LOG_ERROR(Service_FS, - "Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX", + LOG_ERROR(Service_FS, "Reading from out of bounds offset=0x%" PRIx64 + " length=0x%08X file_size=0x%" PRIx64, offset, length, backend->GetSize()); } @@ -191,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; @@ -231,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; @@ -297,7 +298,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; } @@ -472,7 +473,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 b9eab7838..4bd43d15d 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" @@ -311,8 +312,8 @@ 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, - file_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%u size=%" PRIx64 " 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 096c0cdac..9f57b3a5a 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -34,7 +34,7 @@ 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) { @@ -43,7 +43,7 @@ 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) { @@ -52,7 +52,7 @@ 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) { @@ -61,7 +61,7 @@ void LockState(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x4, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) daemon_lock_enabled=0x%08X ", daemon_lock_enabled); + LOG_WARNING(Service_NDM, "(STUBBED) called"); } void UnlockState(Service::Interface* self) { @@ -70,7 +70,7 @@ void UnlockState(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) daemon_lock_enabled=0x%08X ", daemon_lock_enabled); + LOG_WARNING(Service_NDM, "(STUBBED) called"); } void SuspendDaemons(Service::Interface* self) { @@ -86,7 +86,7 @@ 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) { @@ -101,7 +101,7 @@ 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) { @@ -157,7 +157,7 @@ void SetScanInterval(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x10, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X ", scan_interval); + LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X", scan_interval); } void GetScanInterval(Service::Interface* self) { @@ -166,7 +166,7 @@ void GetScanInterval(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x11, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = scan_interval; - LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X ", scan_interval); + LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x%08X", scan_interval); } void SetRetryInterval(Service::Interface* self) { @@ -175,7 +175,7 @@ void SetRetryInterval(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X ", retry_interval); + LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X", retry_interval); } void GetRetryInterval(Service::Interface* self) { @@ -184,7 +184,7 @@ void GetRetryInterval(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x13, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = retry_interval; - LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X ", retry_interval); + LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x%08X", retry_interval); } void OverrideDefaultDaemons(Service::Interface* self) { @@ -200,7 +200,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) { @@ -209,7 +210,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) { @@ -218,7 +220,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/sm/srv.cpp b/src/core/hle/service/sm/srv.cpp index 5c955cf54..4c3dd69ce 100644 --- a/src/core/hle/service/sm/srv.cpp +++ b/src/core/hle/service/sm/srv.cpp @@ -92,7 +92,7 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { if (name_len > Service::kMaxPortSize) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ERR_INVALID_NAME_SIZE); - LOG_ERROR(Service_SRV, "called name_len=0x%X -> ERR_INVALID_NAME_SIZE", name_len); + LOG_ERROR(Service_SRV, "called name_len=0x%zX -> ERR_INVALID_NAME_SIZE", name_len); return; } std::string name(name_buf.data(), name_len); @@ -122,7 +122,8 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { rb.Push(ERR_MAX_CONNECTIONS_REACHED); rb.PushObjects(std::move(client_port).Unwrap()); } else { - LOG_ERROR(Service_SRV, "called service=%s -> error 0x%08X", name.c_str(), session.Code()); + LOG_ERROR(Service_SRV, "called service=%s -> error 0x%08X", name.c_str(), + session.Code().raw); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(session.Code()); } diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 57172ddd6..3f1a0c452 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -91,7 +91,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) { @@ -101,7 +101,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) { @@ -112,7 +112,7 @@ 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) { @@ -122,7 +122,7 @@ 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) { @@ -133,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) { @@ -143,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) { @@ -154,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) { @@ -164,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,9 +666,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, - params->padding, params->alpha); + 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); } static void PingProcess(Interface* self) { diff --git a/src/core/hw/aes/ccm.cpp b/src/core/hw/aes/ccm.cpp index dc7035ab6..b28b579f3 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 %zu not available. Will use zero key.", slot_id); } const AESKey normal = GetNormalKey(slot_id); std::vector cipher(pdata.size() + CCM_MAC_SIZE); @@ -67,7 +67,7 @@ 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 %zu not available. Will use zero key.", 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 83ad9d898..03751dcac 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -65,7 +65,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}; } } @@ -303,7 +303,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; } }