From 47c0c87c4735fafe943eaa0281d8229ca3c315da Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 1 Nov 2017 11:47:39 +0200 Subject: [PATCH 1/2] video_core: clean format warnings --- src/video_core/regs_framebuffer.h | 6 +++--- .../renderer_opengl/gl_rasterizer.cpp | 3 ++- .../renderer_opengl/gl_shader_gen.cpp | 14 ++++++++------ src/video_core/renderer_opengl/pica_to_gl.h | 10 +++++----- .../shader/shader_jit_x64_compiler.cpp | 2 +- src/video_core/swrasterizer/framebuffer.cpp | 17 ++++++++++------- src/video_core/swrasterizer/lighting.cpp | 3 ++- src/video_core/swrasterizer/rasterizer.cpp | 2 +- 8 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/video_core/regs_framebuffer.h b/src/video_core/regs_framebuffer.h index 7b565f911..8020faee8 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(); } } @@ -258,7 +258,7 @@ struct FramebufferRegs { return 4; } - ASSERT_MSG(false, "Unknown depth format %u", format); + ASSERT_MSG(false, "Unknown depth format %u", static_cast(format)); } // Returns the number of bits per depth component of the specified depth format @@ -271,7 +271,7 @@ struct FramebufferRegs { return 24; } - ASSERT_MSG(false, "Unknown depth format %u", format); + ASSERT_MSG(false, "Unknown depth format %u", static_cast(format)); } INSERT_PADDING_WORDS(0x20); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 7e09e4712..16f0726ad 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1338,7 +1338,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 %u", + 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 9fe183944..531247d2a 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -265,7 +265,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; } } @@ -323,7 +323,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; } } @@ -372,7 +372,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; } } @@ -416,7 +416,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 @@ -456,7 +457,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)"; @@ -486,7 +488,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 c7fa1f873..640c6ea51 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -103,7 +103,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 %u", static_cast(equation)); UNREACHABLE(); return GL_FUNC_ADD; @@ -133,7 +133,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 %u", static_cast(factor)); UNREACHABLE(); return GL_ONE; @@ -164,7 +164,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 %u", static_cast(op)); UNREACHABLE(); return GL_COPY; @@ -187,7 +187,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 %u", static_cast(func)); UNREACHABLE(); return GL_ALWAYS; @@ -210,7 +210,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 %u", 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 1b31623bd..5a856dcaa 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.cpp +++ b/src/video_core/shader/shader_jit_x64_compiler.cpp @@ -853,7 +853,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 f34eab6cf..fb41ce4f5 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.Value())); 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.Value())); 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.Value())); 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.Value())); UNIMPLEMENTED(); break; } @@ -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 0x%x", static_cast(equation)); UNIMPLEMENTED(); } diff --git a/src/video_core/swrasterizer/lighting.cpp b/src/video_core/swrasterizer/lighting.cpp index 5fa748611..04f81ef40 100644 --- a/src/video_core/swrasterizer/lighting.cpp +++ b/src/video_core/swrasterizer/lighting.cpp @@ -43,7 +43,8 @@ std::tuple, Math::Vec4> ComputeFragmentsColors( surface_normal = Math::MakeVec(0.0f, 0.0f, 1.0f); surface_tangent = perturbation; } else { - LOG_ERROR(HW_GPU, "Unknown bump mode %u", lighting.config0.bump_mode.Value()); + LOG_ERROR(HW_GPU, "Unknown bump mode %u", + static_cast(lighting.config0.bump_mode.Value())); } } else { surface_normal = Math::MakeVec(0.0f, 0.0f, 1.0f); diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 586587eb8..533ee6f01 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -801,7 +801,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; } From 499508389c7701f11ab07dd7cdc19b2c7cbba53f Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 1 Nov 2017 12:19:51 +0200 Subject: [PATCH 2/2] 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; } }