core: clear format warnings

This commit is contained in:
wwylele 2017-11-01 12:19:51 +02:00
parent 47c0c87c47
commit 499508389c
13 changed files with 77 additions and 65 deletions

View file

@ -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())}; ResultStatus init_result{Init(emu_window, system_mode.first.get())};
if (init_result != ResultStatus::Success) { 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<u32>(init_result));
System::Shutdown(); System::Shutdown();
return init_result; return init_result;
} }
const Loader::ResultStatus load_result{app_loader->Load(Kernel::g_current_process)}; const Loader::ResultStatus load_result{app_loader->Load(Kernel::g_current_process)};
if (Loader::ResultStatus::Success != load_result) { 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<u32>(load_result));
System::Shutdown(); System::Shutdown();
switch (load_result) { switch (load_result) {

View file

@ -302,7 +302,7 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) {
auto bp = p.find(addr); auto bp = p.find(addr);
if (bp != p.end()) { if (bp != p.end()) {
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: %08x bytes at %08x of type %d\n", 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<int>(type));
p.erase(addr); 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)) { if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) {
LOG_DEBUG(Debug_GDBStub, LOG_DEBUG(Debug_GDBStub,
"Found breakpoint type %d @ %08x, range: %08x - %08x (%d bytes)\n", type, "Found breakpoint type %d @ %08x, range: %08x - %08x (%u bytes)\n",
addr, bp->second.addr, bp->second.addr + len, len); static_cast<int>(type), addr, bp->second.addr, bp->second.addr + len, len);
return true; return true;
} }
} }
@ -738,8 +738,8 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u32 len) {
breakpoint.len = len; breakpoint.len = len;
p.insert({addr, breakpoint}); 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",
breakpoint.addr); static_cast<int>(type), breakpoint.len, breakpoint.addr);
return true; return true;
} }

View file

@ -62,7 +62,7 @@ ResultCode Applet::Create(Service::APT::AppletId id) {
applets[id] = std::make_shared<Mint>(id); applets[id] = std::make_shared<Mint>(id);
break; break;
default: default:
LOG_ERROR(Service_APT, "Could not create applet %u", id); LOG_ERROR(Service_APT, "Could not create applet %u", static_cast<u32>(id));
// TODO(Subv): Find the right error code // TODO(Subv): Find the right error code
return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
ErrorSummary::NotSupported, ErrorLevel::Permanent); ErrorSummary::NotSupported, ErrorLevel::Permanent);
@ -82,7 +82,7 @@ std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) {
static void AppletUpdateEvent(u64 applet_id, int cycles_late) { static void AppletUpdateEvent(u64 applet_id, int cycles_late) {
Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id); Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);
std::shared_ptr<Applet> applet = Applet::Get(id); std::shared_ptr<Applet> 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<u32>(id));
applet->Update(); applet->Update();

View file

@ -74,7 +74,7 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address,
} }
default: default:
LOG_ERROR(Kernel, "unknown type=%d", type); LOG_ERROR(Kernel, "unknown type=%d", static_cast<u32>(type));
return ERR_INVALID_ENUM_VALUE_FND; return ERR_INVALID_ENUM_VALUE_FND;
} }

View file

@ -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 is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
buffer_size, static_buff_size); 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) { if (!next_parameter) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); 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 is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
buffer_size, static_buff_size); 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) { if (!next_parameter) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); 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 IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x18, 1, 0); // 0x180040
AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>()); AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>());
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -775,7 +775,8 @@ void PrepareToStartLibraryApplet(Service::Interface* self) {
auto applet = HLE::Applets::Applet::Get(applet_id); auto applet = HLE::Applets::Applet::Get(applet_id);
if (applet) { 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<u32>(applet_id));
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} else { } else {
rb.Push(HLE::Applets::Applet::Create(applet_id)); 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 IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x16, 1, 0); // 0x160040
AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>()); AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>());
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -808,7 +809,8 @@ void PreloadLibraryApplet(Service::Interface* self) {
auto applet = HLE::Applets::Applet::Get(applet_id); auto applet = HLE::Applets::Applet::Get(applet_id);
if (applet) { 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<u32>(applet_id));
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} else { } else {
rb.Push(HLE::Applets::Applet::Create(applet_id)); rb.Push(HLE::Applets::Applet::Create(applet_id));
@ -823,7 +825,7 @@ void StartLibraryApplet(Service::Interface* self) {
Kernel::Handle handle = rp.PopHandle(); Kernel::Handle handle = rp.PopHandle();
VAddr buffer_addr = rp.PopStaticBuffer(); 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<u32>(applet_id));
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -867,7 +869,7 @@ void SetScreenCapPostPermission(Service::Interface* self) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS); // No error rb.Push(RESULT_SUCCESS); // No error
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
screen_capture_post_permission); static_cast<u32>(screen_capture_post_permission));
} }
void GetScreenCapPostPermission(Service::Interface* self) { void GetScreenCapPostPermission(Service::Interface* self) {
@ -877,7 +879,7 @@ void GetScreenCapPostPermission(Service::Interface* self) {
rb.Push(RESULT_SUCCESS); // No error rb.Push(RESULT_SUCCESS); // No error
rb.Push(static_cast<u32>(screen_capture_post_permission)); rb.Push(static_cast<u32>(screen_capture_post_permission));
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
screen_capture_post_permission); static_cast<u32>(screen_capture_post_permission));
} }
void GetAppletInfo(Service::Interface* self) { void GetAppletInfo(Service::Interface* self) {
@ -899,7 +901,7 @@ void GetAppletInfo(Service::Interface* self) {
rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
ErrorLevel::Status)); ErrorLevel::Status));
} }
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id); LOG_WARNING(Service_APT, "(stubbed) called appid=%u", static_cast<u32>(app_id));
} }
void GetStartupArgument(Service::Interface* self) { 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", LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
startup_argument_type, parameter_size); static_cast<u32>(startup_argument_type), parameter_size);
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);

View file

@ -301,7 +301,7 @@ static void WriteProcessPipe(Service::Interface* self) {
} }
ASSERT_MSG(Memory::IsValidVirtualAddress(buffer), 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<u8> message(size); std::vector<u8> message(size);
for (u32 i = 0; i < size; i++) { for (u32 i = 0; i < size; i++) {
@ -359,8 +359,8 @@ static void ReadPipeIfPossible(Service::Interface* self) {
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index); DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
ASSERT_MSG(Memory::IsValidVirtualAddress(addr), 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", pipe_index,
size, addr); unknown, size, addr);
cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
@ -403,8 +403,8 @@ static void ReadPipe(Service::Interface* self) {
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index); DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
ASSERT_MSG(Memory::IsValidVirtualAddress(addr), 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", pipe_index,
size, addr); unknown, size, addr);
if (DSP::HLE::GetPipeReadableSize(pipe) >= size) { if (DSP::HLE::GetPipeReadableSize(pipe) >= size) {
std::vector<u8> response = DSP::HLE::PipeRead(pipe, size); std::vector<u8> response = DSP::HLE::PipeRead(pipe, size);

View file

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cinttypes>
#include <cstddef> #include <cstddef>
#include <memory> #include <memory>
#include <system_error> #include <system_error>
@ -105,8 +106,8 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
offset, length, address); offset, length, address);
if (offset + length > backend->GetSize()) { if (offset + length > backend->GetSize()) {
LOG_ERROR(Service_FS, LOG_ERROR(Service_FS, "Reading from out of bounds offset=0x%" PRIx64
"Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX", " length=0x%08X file_size=0x%" PRIx64,
offset, length, backend->GetSize()); offset, length, backend->GetSize());
} }
@ -191,7 +192,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
// Unknown command... // Unknown command...
default: default:
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast<u32>(cmd));
ResultCode error = UnimplementedFunction(ErrorModule::FS); ResultCode error = UnimplementedFunction(ErrorModule::FS);
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
return; return;
@ -231,7 +232,7 @@ void Directory::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serve
// Unknown command... // Unknown command...
default: default:
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast<u32>(cmd));
ResultCode error = UnimplementedFunction(ErrorModule::FS); ResultCode error = UnimplementedFunction(ErrorModule::FS);
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
return; return;
@ -297,7 +298,7 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor
auto& archive = result.first->second; auto& archive = result.first->second;
LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(),
id_code); static_cast<u32>(id_code));
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -472,7 +473,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) {
} else if (media_type == MediaType::SDMC) { } else if (media_type == MediaType::SDMC) {
media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX); media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX);
} else { } else {
LOG_ERROR(Service_FS, "Unsupported media type %u", media_type); LOG_ERROR(Service_FS, "Unsupported media type %u", static_cast<u32>(media_type));
return ResultCode(-1); // TODO(Subv): Find the right error code return ResultCode(-1); // TODO(Subv): Find the right error code
} }

View file

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cinttypes>
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/file_util.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); FileSys::Path file_path(filename_type, filename_size, filename_ptr);
LOG_DEBUG(Service_FS, "type=%u size=%llu data=%s", static_cast<u32>(filename_type), file_size, LOG_DEBUG(Service_FS, "type=%u size=%" PRIx64 " data=%s", static_cast<u32>(filename_type),
file_path.DebugStr().c_str()); file_size, file_path.DebugStr().c_str());
cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw;
} }

View file

@ -34,7 +34,7 @@ void EnterExclusiveState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(exclusive_state));
} }
void LeaveExclusiveState(Service::Interface* self) { void LeaveExclusiveState(Service::Interface* self) {
@ -43,7 +43,7 @@ void LeaveExclusiveState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(exclusive_state));
} }
void QueryExclusiveMode(Service::Interface* self) { void QueryExclusiveMode(Service::Interface* self) {
@ -52,7 +52,7 @@ void QueryExclusiveMode(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0); cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = static_cast<u32>(exclusive_state); cmd_buff[2] = static_cast<u32>(exclusive_state);
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state); LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X", static_cast<u32>(exclusive_state));
} }
void LockState(Service::Interface* self) { void LockState(Service::Interface* self) {
@ -61,7 +61,7 @@ void LockState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x4, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x4, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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) { void UnlockState(Service::Interface* self) {
@ -70,7 +70,7 @@ void UnlockState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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) { void SuspendDaemons(Service::Interface* self) {
@ -86,7 +86,7 @@ void SuspendDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(daemon_bit_mask));
} }
void ResumeDaemons(Service::Interface* self) { void ResumeDaemons(Service::Interface* self) {
@ -101,7 +101,7 @@ void ResumeDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(daemon_bit_mask));
} }
void SuspendScheduler(Service::Interface* self) { void SuspendScheduler(Service::Interface* self) {
@ -157,7 +157,7 @@ void SetScanInterval(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x10, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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) { void GetScanInterval(Service::Interface* self) {
@ -166,7 +166,7 @@ void GetScanInterval(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x11, 2, 0); cmd_buff[0] = IPC::MakeHeader(0x11, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = scan_interval; 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) { void SetRetryInterval(Service::Interface* self) {
@ -175,7 +175,7 @@ void SetRetryInterval(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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) { void GetRetryInterval(Service::Interface* self) {
@ -184,7 +184,7 @@ void GetRetryInterval(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x13, 2, 0); cmd_buff[0] = IPC::MakeHeader(0x13, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = retry_interval; 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) { void OverrideDefaultDaemons(Service::Interface* self) {
@ -200,7 +200,8 @@ void OverrideDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(default_daemon_bit_mask));
} }
void ResetDefaultDaemons(Service::Interface* self) { void ResetDefaultDaemons(Service::Interface* self) {
@ -209,7 +210,8 @@ void ResetDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error 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<u32>(default_daemon_bit_mask));
} }
void GetDefaultDaemons(Service::Interface* self) { void GetDefaultDaemons(Service::Interface* self) {
@ -218,7 +220,8 @@ void GetDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0); cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = static_cast<u32>(default_daemon_bit_mask); cmd_buff[2] = static_cast<u32>(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<u32>(default_daemon_bit_mask));
} }
void ClearHalfAwakeMacFilter(Service::Interface* self) { void ClearHalfAwakeMacFilter(Service::Interface* self) {

View file

@ -92,7 +92,7 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) {
if (name_len > Service::kMaxPortSize) { if (name_len > Service::kMaxPortSize) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(ERR_INVALID_NAME_SIZE); 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; return;
} }
std::string name(name_buf.data(), name_len); 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.Push(ERR_MAX_CONNECTIONS_REACHED);
rb.PushObjects(std::move(client_port).Unwrap()); rb.PushObjects(std::move(client_port).Unwrap());
} else { } 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); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(session.Code()); rb.Push(session.Code());
} }

View file

@ -91,7 +91,7 @@ static void SetInputFormat(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; 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<u8>(conversion.input_format));
} }
static void GetInputFormat(Interface* self) { static void GetInputFormat(Interface* self) {
@ -101,7 +101,7 @@ static void GetInputFormat(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(conversion.input_format); cmd_buff[2] = static_cast<u32>(conversion.input_format);
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format); LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast<u8>(conversion.input_format));
} }
static void SetOutputFormat(Interface* self) { static void SetOutputFormat(Interface* self) {
@ -112,7 +112,7 @@ static void SetOutputFormat(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; 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<u8>(conversion.output_format));
} }
static void GetOutputFormat(Interface* self) { static void GetOutputFormat(Interface* self) {
@ -122,7 +122,7 @@ static void GetOutputFormat(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(conversion.output_format); cmd_buff[2] = static_cast<u32>(conversion.output_format);
LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format); LOG_DEBUG(Service_Y2R, "called output_format=%hhu", static_cast<u8>(conversion.output_format));
} }
static void SetRotation(Interface* self) { static void SetRotation(Interface* self) {
@ -133,7 +133,7 @@ static void SetRotation(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation); LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<u8>(conversion.rotation));
} }
static void GetRotation(Interface* self) { static void GetRotation(Interface* self) {
@ -143,7 +143,7 @@ static void GetRotation(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(conversion.rotation); cmd_buff[2] = static_cast<u32>(conversion.rotation);
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation); LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<u8>(conversion.rotation));
} }
static void SetBlockAlignment(Interface* self) { static void SetBlockAlignment(Interface* self) {
@ -154,7 +154,8 @@ static void SetBlockAlignment(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; 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<u8>(conversion.block_alignment));
} }
static void GetBlockAlignment(Interface* self) { static void GetBlockAlignment(Interface* self) {
@ -164,7 +165,8 @@ static void GetBlockAlignment(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(conversion.block_alignment); cmd_buff[2] = static_cast<u32>(conversion.block_alignment);
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment); LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu",
static_cast<u8>(conversion.block_alignment));
} }
/** /**
@ -664,9 +666,10 @@ cleanup:
Service_Y2R, Service_Y2R,
"called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " "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", "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, static_cast<u8>(params->input_format), static_cast<u8>(params->output_format),
params->input_line_width, params->input_lines, params->standard_coefficient, static_cast<u8>(params->rotation), static_cast<u8>(params->block_alignment),
params->padding, params->alpha); params->input_line_width, params->input_lines,
static_cast<u8>(params->standard_coefficient), params->padding, params->alpha);
} }
static void PingProcess(Interface* self) { static void PingProcess(Interface* self) {

View file

@ -46,7 +46,7 @@ public:
std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce, std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce,
size_t slot_id) { size_t slot_id) {
if (!IsNormalKeyAvailable(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 AESKey normal = GetNormalKey(slot_id);
std::vector<u8> cipher(pdata.size() + CCM_MAC_SIZE); std::vector<u8> cipher(pdata.size() + CCM_MAC_SIZE);
@ -67,7 +67,7 @@ std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& non
std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce, std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce,
size_t slot_id) { size_t slot_id) {
if (!IsNormalKeyAvailable(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 AESKey normal = GetNormalKey(slot_id);
const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE; const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE;

View file

@ -65,7 +65,7 @@ static Math::Vec4<u8> DecodePixel(Regs::PixelFormat input_format, const u8* src_
return Color::DecodeRGBA4(src_pixel); return Color::DecodeRGBA4(src_pixel);
default: default:
LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", input_format); LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", static_cast<u32>(input_format));
return {0, 0, 0, 0}; return {0, 0, 0, 0};
} }
} }
@ -303,7 +303,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
default: default:
LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x", LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x",
config.output_format.Value()); static_cast<u32>(config.output_format.Value()));
break; break;
} }
} }