From e00f7cdfc4a6c8083cc39ab655c872939c88864d Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sat, 24 Mar 2018 10:41:40 +0100 Subject: [PATCH 1/9] renderer_opengl.cpp: Cast framebuffer_transform_flags --- src/video_core/renderer_opengl/renderer_opengl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 78b50b227e..566c334027 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -306,7 +306,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x, } else { // Other transformations are unsupported LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags=%d", - framebuffer_transform_flags); + static_cast(framebuffer_transform_flags)); UNIMPLEMENTED(); } From 32b62d709a37770b01da26c65b5f0778e94aa5f8 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sat, 24 Mar 2018 10:43:47 +0100 Subject: [PATCH 2/9] fsp_srv.cpp: Correct Log Variable type for "unk" --- src/core/hle/service/filesystem/fsp_srv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 89fa70ae64..635f1a873f 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -189,7 +189,7 @@ private: IPC::RequestParser rp{ctx}; const u64 unk = rp.Pop(); - LOG_DEBUG(Service_FS, "called, unk=0x%llx", unk); + LOG_DEBUG(Service_FS, "called, unk=0x%" PRIx64, unk); // Calculate how many entries we can fit in the output buffer u64 count_entries = ctx.GetWriteBufferSize() / sizeof(FileSys::Entry); From 0236d34a72b7ae10c2f6bec0fccbf9914365ed50 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 12:29:24 +0200 Subject: [PATCH 3/9] arm_unicorn.cpp: Correct Variable Types --- src/core/arm/unicorn/arm_unicorn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index b0cdc24037..29098dc5a4 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -53,7 +53,7 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si void* user_data) { ARM_Interface::ThreadContext ctx{}; Core::CPU().SaveContext(ctx); - ASSERT_MSG(false, "Attempted to read from unmapped memory: 0x%lx, pc=0x%lx, lr=0x%lx", addr, + ASSERT_MSG(false, "Attempted to read from unmapped memory: 0x%" PRIx64 ", pc=0x%" PRIx64 ", lr=0x%" PRIx64, addr, ctx.pc, ctx.cpu_registers[30]); return {}; } From 493391818d01554022f755206912f32cb9efda21 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 12:40:11 +0200 Subject: [PATCH 4/9] object_address_table.cpp: Correct Variable Types --- src/core/hle/kernel/object_address_table.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/object_address_table.cpp b/src/core/hle/kernel/object_address_table.cpp index cd286f85d1..871cbb90bb 100644 --- a/src/core/hle/kernel/object_address_table.cpp +++ b/src/core/hle/kernel/object_address_table.cpp @@ -10,12 +10,12 @@ namespace Kernel { ObjectAddressTable g_object_address_table; void ObjectAddressTable::Insert(VAddr addr, SharedPtr obj) { - ASSERT_MSG(objects.find(addr) == objects.end(), "Object already exists with addr=0x%lx", addr); + ASSERT_MSG(objects.find(addr) == objects.end(), "Object already exists with addr=0x%" PRIx64, addr); objects[addr] = obj; } void ObjectAddressTable::Close(VAddr addr) { - ASSERT_MSG(objects.find(addr) != objects.end(), "Object does not exist with addr=0x%lx", addr); + ASSERT_MSG(objects.find(addr) != objects.end(), "Object does not exist with addr=0x%" PRIx64, addr); objects.erase(addr); } From 4f45534dec4079d134566c6e9c6a0a97f4839c1b Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 12:42:32 +0200 Subject: [PATCH 5/9] shared_memory.cpp: Correct Variable Types --- src/core/hle/kernel/shared_memory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index bc99993c81..3777148714 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -107,7 +107,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the requested permissions don't match what the creator process allows. if (static_cast(permissions) & ~static_cast(own_other_permissions)) { - LOG_ERROR(Kernel, "cannot map id=%u, address=0x%lx name=%s, permissions don't match", + LOG_ERROR(Kernel, "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", GetObjectId(), address, name.c_str()); return ERR_INVALID_COMBINATION; } @@ -115,7 +115,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the provided permissions are not compatible with what the creator process needs. if (other_permissions != MemoryPermission::DontCare && static_cast(this->permissions) & ~static_cast(other_permissions)) { - LOG_ERROR(Kernel, "cannot map id=%u, address=0x%lx name=%s, permissions don't match", + LOG_ERROR(Kernel, "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", GetObjectId(), address, name.c_str()); return ERR_WRONG_PERMISSION; } @@ -132,7 +132,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi target_address, backing_block, backing_block_offset, size, MemoryState::Shared); if (result.Failed()) { LOG_ERROR(Kernel, - "cannot map id=%u, target_address=0x%lx name=%s, error mapping to virtual memory", + "cannot map id=%u, target_address=0x%" PRIx64 " name=%s, error mapping to virtual memory", GetObjectId(), target_address, name.c_str()); return result.Code(); } From b94c495c23360dc27aaf69d33a9e8482efc90f0b Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 12:44:35 +0200 Subject: [PATCH 6/9] nvdisp_disp0.cpp: Correct Variable Type --- src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 87b3a2d747..6bb0a966ca 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp @@ -23,7 +23,7 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) { VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle); LOG_WARNING(Service, - "Drawing from address %lx offset %08X Width %u Height %u Stride %u Format %u", addr, + "Drawing from address %" PRIx64 " offset %08X Width %u Height %u Stride %u Format %u", addr, offset, width, height, stride, format); using PixelFormat = Tegra::FramebufferConfig::PixelFormat; From 771e8cfd6b56b653314825e5834cd01c7d9e4cb4 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 12:46:43 +0200 Subject: [PATCH 7/9] svc.cpp: Correct Variable Types --- src/core/hle/kernel/svc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 36ea23cd90..b3875e9616 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -39,7 +39,7 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { } static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state1) { - LOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x%lx", addr); + LOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x%" PRIx64, addr); return RESULT_SUCCESS; } @@ -762,7 +762,7 @@ static ResultCode ResetSignal(Handle handle) { /// Creates a TransferMemory object static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { - LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%lx, size=0x%lx, perms=%08X", addr, size, + LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%" PRIx64 ", size=0x%" PRIx64 ", perms=%08X", addr, size, permissions); *handle = 0; return RESULT_SUCCESS; From 91322e3bcdcde075af0d9d825757ffed3604a77c Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 13:02:11 +0200 Subject: [PATCH 8/9] Add cinttypes Include for Source Files affected by Warning Cleanups --- src/core/arm/unicorn/arm_unicorn.cpp | 1 + src/core/hle/kernel/hle_ipc.cpp | 1 + src/core/hle/kernel/object_address_table.cpp | 1 + src/core/hle/kernel/shared_memory.cpp | 1 + src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 1 + 5 files changed, 5 insertions(+) diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 29098dc5a4..32d7c6bebd 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include "common/assert.h" diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index bef4f15f53..5b5720a026 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "common/assert.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/hle/kernel/object_address_table.cpp b/src/core/hle/kernel/object_address_table.cpp index 871cbb90bb..d0426eea98 100644 --- a/src/core/hle/kernel/object_address_table.cpp +++ b/src/core/hle/kernel/object_address_table.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 "core/hle/kernel/object_address_table.h" diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 3777148714..5c3728d086 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "common/logging/log.h" #include "core/core.h" #include "core/hle/kernel/errors.h" diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 6bb0a966ca..18d13fbb0e 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.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/logging/log.h" #include "core/core.h" From ea5b35a630a61af09daf84f9c4b6aac54b1a9964 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Mar 2018 14:33:40 +0200 Subject: [PATCH 9/9] Ran clang-format --- src/core/arm/unicorn/arm_unicorn.cpp | 8 +++++--- src/core/hle/kernel/hle_ipc.cpp | 2 +- src/core/hle/kernel/object_address_table.cpp | 6 ++++-- src/core/hle/kernel/shared_memory.cpp | 11 +++++++---- src/core/hle/kernel/svc.cpp | 4 ++-- src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 5 +++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 32d7c6bebd..d578736802 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include +#include #include #include "common/assert.h" #include "common/microprofile.h" @@ -54,8 +54,10 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si void* user_data) { ARM_Interface::ThreadContext ctx{}; Core::CPU().SaveContext(ctx); - ASSERT_MSG(false, "Attempted to read from unmapped memory: 0x%" PRIx64 ", pc=0x%" PRIx64 ", lr=0x%" PRIx64, addr, - ctx.pc, ctx.cpu_registers[30]); + ASSERT_MSG(false, + "Attempted to read from unmapped memory: 0x%" PRIx64 ", pc=0x%" PRIx64 + ", lr=0x%" PRIx64, + addr, ctx.pc, ctx.cpu_registers[30]); return {}; } diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 5b5720a026..880b3132b4 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include +#include #include "common/assert.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/hle/kernel/object_address_table.cpp b/src/core/hle/kernel/object_address_table.cpp index d0426eea98..4aaedeea7f 100644 --- a/src/core/hle/kernel/object_address_table.cpp +++ b/src/core/hle/kernel/object_address_table.cpp @@ -11,12 +11,14 @@ namespace Kernel { ObjectAddressTable g_object_address_table; void ObjectAddressTable::Insert(VAddr addr, SharedPtr obj) { - ASSERT_MSG(objects.find(addr) == objects.end(), "Object already exists with addr=0x%" PRIx64, addr); + ASSERT_MSG(objects.find(addr) == objects.end(), "Object already exists with addr=0x%" PRIx64, + addr); objects[addr] = obj; } void ObjectAddressTable::Close(VAddr addr) { - ASSERT_MSG(objects.find(addr) != objects.end(), "Object does not exist with addr=0x%" PRIx64, addr); + ASSERT_MSG(objects.find(addr) != objects.end(), "Object does not exist with addr=0x%" PRIx64, + addr); objects.erase(addr); } diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 5c3728d086..b0db0a5d44 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include +#include #include "common/logging/log.h" #include "core/core.h" #include "core/hle/kernel/errors.h" @@ -108,7 +108,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the requested permissions don't match what the creator process allows. if (static_cast(permissions) & ~static_cast(own_other_permissions)) { - LOG_ERROR(Kernel, "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", + LOG_ERROR(Kernel, + "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", GetObjectId(), address, name.c_str()); return ERR_INVALID_COMBINATION; } @@ -116,7 +117,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the provided permissions are not compatible with what the creator process needs. if (other_permissions != MemoryPermission::DontCare && static_cast(this->permissions) & ~static_cast(other_permissions)) { - LOG_ERROR(Kernel, "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", + LOG_ERROR(Kernel, + "cannot map id=%u, address=0x%" PRIx64 " name=%s, permissions don't match", GetObjectId(), address, name.c_str()); return ERR_WRONG_PERMISSION; } @@ -133,7 +135,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi target_address, backing_block, backing_block_offset, size, MemoryState::Shared); if (result.Failed()) { LOG_ERROR(Kernel, - "cannot map id=%u, target_address=0x%" PRIx64 " name=%s, error mapping to virtual memory", + "cannot map id=%u, target_address=0x%" PRIx64 + " name=%s, error mapping to virtual memory", GetObjectId(), target_address, name.c_str()); return result.Code(); } diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index b3875e9616..f4c260982f 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -762,8 +762,8 @@ static ResultCode ResetSignal(Handle handle) { /// Creates a TransferMemory object static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { - LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%" PRIx64 ", size=0x%" PRIx64 ", perms=%08X", addr, size, - permissions); + LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%" PRIx64 ", size=0x%" PRIx64 ", perms=%08X", + addr, size, permissions); *handle = 0; return RESULT_SUCCESS; } diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 18d13fbb0e..b34ddae7c1 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp @@ -24,8 +24,9 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) { VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle); LOG_WARNING(Service, - "Drawing from address %" PRIx64 " offset %08X Width %u Height %u Stride %u Format %u", addr, - offset, width, height, stride, format); + "Drawing from address %" PRIx64 + " offset %08X Width %u Height %u Stride %u Format %u", + addr, offset, width, height, stride, format); using PixelFormat = Tegra::FramebufferConfig::PixelFormat; const Tegra::FramebufferConfig framebuffer{