Fix various warnings

This commit is contained in:
Marco Aurélio
2017-03-30 02:23:56 -03:00
parent eb8a7a92c1
commit f80c1cd820
22 changed files with 123 additions and 87 deletions

View File

@@ -62,7 +62,7 @@ ResultCode Applet::Create(Service::APT::AppletId id) {
applets[id] = std::make_shared<Mint>(id);
break;
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
return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
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) {
Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_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();

View File

@@ -73,7 +73,7 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address,
}
default:
LOG_ERROR(Kernel, "unknown type=%d", type);
LOG_ERROR(Kernel, "unknown type=%d", static_cast<int>(type));
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel,
ErrorSummary::WrongArgument, ErrorLevel::Usage);
}

View File

@@ -90,6 +90,9 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) {
mapping.size = Memory::PAGE_SIZE;
mapping.writable = true; // TODO: Not sure if correct
mapping.unk_flag = false;
// Missing line??
address_mappings.push_back(mapping);
} else if ((type & 0xFE0) == 0xFC0) { // 0x01FF
// Kernel version
kernel_version = descriptor & 0xFFFF;

View File

@@ -42,7 +42,7 @@ void FindContentInfos(Service::Interface* self) {
am_content_count[media_type] = cmd_buff[4];
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, "
LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016lx, content_cound=%u, "
"content_ids_pointer=0x%08x, content_info_pointer=0x%08x",
media_type, title_id, am_content_count[media_type], content_ids_pointer,
content_info_pointer);

View File

@@ -353,12 +353,12 @@ void PrepareToStartLibraryApplet(Service::Interface* self) {
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
auto applet = HLE::Applets::Applet::Get(applet_id);
if (applet) {
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
LOG_WARNING(Service_APT, "applet has already been started id=%08X", static_cast<u32>(applet_id));
cmd_buff[1] = RESULT_SUCCESS.raw;
} else {
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
}
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
}
void PreloadLibraryApplet(Service::Interface* self) {
@@ -366,12 +366,13 @@ void PreloadLibraryApplet(Service::Interface* self) {
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
auto applet = HLE::Applets::Applet::Get(applet_id);
if (applet) {
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
LOG_WARNING(Service_APT, "applet has already been started id=%08X",
static_cast<u32>(applet_id));
cmd_buff[1] = RESULT_SUCCESS.raw;
} else {
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
}
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
}
void StartLibraryApplet(Service::Interface* self) {
@@ -379,10 +380,10 @@ void StartLibraryApplet(Service::Interface* self) {
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
std::shared_ptr<HLE::Applets::Applet> applet = HLE::Applets::Applet::Get(applet_id);
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
if (applet == nullptr) {
LOG_ERROR(Service_APT, "unknown applet id=%08X", applet_id);
LOG_ERROR(Service_APT, "unknown applet id=%08X", static_cast<u32>(applet_id));
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
return;
}
@@ -415,7 +416,7 @@ void SetScreenCapPostPermission(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
screen_capture_post_permission);
static_cast<u32>(screen_capture_post_permission));
}
void GetScreenCapPostPermission(Service::Interface* self) {
@@ -425,7 +426,7 @@ void GetScreenCapPostPermission(Service::Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(screen_capture_post_permission);
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) {
@@ -444,7 +445,7 @@ void GetAppletInfo(Service::Interface* self) {
ErrorSummary::NotFound, ErrorLevel::Status)
.raw;
}
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", static_cast<int>(app_id));
}
void GetStartupArgument(Service::Interface* self) {
@@ -466,7 +467,7 @@ void GetStartupArgument(Service::Interface* self) {
}
LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
startup_argument_type, parameter_size);
static_cast<u32>(startup_argument_type), parameter_size);
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;

View File

@@ -296,7 +296,8 @@ static void WriteProcessPipe(Service::Interface* self) {
}
ASSERT_MSG(Memory::IsValidVirtualAddress(buffer),
"Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe, size, buffer);
"Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X",
static_cast<u32>(pipe), size, buffer);
std::vector<u8> message(size);
for (u32 i = 0; i < size; i++) {
@@ -336,7 +337,8 @@ static void ReadPipeIfPossible(Service::Interface* self) {
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown,
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X",
static_cast<u32>(pipe), unknown,
size, addr);
cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2);
@@ -380,8 +382,8 @@ static void ReadPipe(Service::Interface* self) {
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown,
size, addr);
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X",
static_cast<u32>(pipe), unknown, size, addr);
if (DSP::HLE::GetPipeReadableSize(pipe) >= size) {
std::vector<u8> response = DSP::HLE::PipeRead(pipe, size);

View File

@@ -106,7 +106,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
if (offset + length > backend->GetSize()) {
LOG_ERROR(Service_FS,
"Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX",
"Reading from out of bounds offset=0x%lX length=0x%08X file_size=0x%lX",
offset, length, backend->GetSize());
}
@@ -192,7 +192,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
// Unknown command...
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);
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
return;
@@ -232,7 +232,7 @@ void Directory::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serve
// Unknown command...
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);
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
return;
@@ -300,7 +300,7 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& 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<u32>(id_code));
return RESULT_SUCCESS;
}
@@ -475,7 +475,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) {
} else if (media_type == MediaType::SDMC) {
media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX);
} else {
LOG_ERROR(Service_FS, "Unsupported media type %u", media_type);
LOG_ERROR(Service_FS, "Unsupported media type %u", static_cast<u32>(media_type));
return ResultCode(-1); // TODO(Subv): Find the right error code
}

View File

@@ -304,7 +304,7 @@ static void CreateFile(Service::Interface* self) {
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
LOG_DEBUG(Service_FS, "type=%u size=%llu data=%s", static_cast<u32>(filename_type), file_size,
LOG_DEBUG(Service_FS, "type=%u size=%lu data=%s", static_cast<u32>(filename_type), file_size,
file_path.DebugStr().c_str());
cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw;

View File

@@ -32,7 +32,8 @@ void EnterExclusiveState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state);
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ",
static_cast<u32>(exclusive_state));
}
void LeaveExclusiveState(Service::Interface* self) {
@@ -41,7 +42,8 @@ void LeaveExclusiveState(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state);
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ",
static_cast<u32>(exclusive_state));
}
void QueryExclusiveMode(Service::Interface* self) {
@@ -50,7 +52,8 @@ void QueryExclusiveMode(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = static_cast<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) {
@@ -84,7 +87,8 @@ void SuspendDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask);
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ",
static_cast<u32>(daemon_bit_mask));
}
void ResumeDaemons(Service::Interface* self) {
@@ -99,7 +103,8 @@ void ResumeDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask);
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ",
static_cast<u32>(daemon_bit_mask));
}
void SuspendScheduler(Service::Interface* self) {
@@ -198,7 +203,8 @@ void OverrideDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask);
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ",
static_cast<u32>(default_daemon_bit_mask));
}
void ResetDefaultDaemons(Service::Interface* self) {
@@ -207,7 +213,8 @@ void ResetDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask);
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ",
static_cast<u32>(default_daemon_bit_mask));
}
void GetDefaultDaemons(Service::Interface* self) {
@@ -216,7 +223,8 @@ void GetDefaultDaemons(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = static_cast<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) {

View File

@@ -89,7 +89,7 @@ static void SetInputFormat(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format);
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast<int>(conversion.input_format));
}
static void GetInputFormat(Interface* self) {
@@ -99,7 +99,7 @@ static void GetInputFormat(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<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<int>(conversion.input_format));
}
static void SetOutputFormat(Interface* self) {
@@ -110,7 +110,8 @@ static void SetOutputFormat(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format);
LOG_DEBUG(Service_Y2R, "called output_format=%hhu",
static_cast<int>(conversion.output_format));
}
static void GetOutputFormat(Interface* self) {
@@ -120,7 +121,8 @@ static void GetOutputFormat(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<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<int>(conversion.output_format));
}
static void SetRotation(Interface* self) {
@@ -131,7 +133,7 @@ static void SetRotation(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation);
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<int>(conversion.rotation));
}
static void GetRotation(Interface* self) {
@@ -141,7 +143,7 @@ static void GetRotation(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<u32>(conversion.rotation);
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation);
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<int>(conversion.rotation));
}
static void SetBlockAlignment(Interface* self) {
@@ -152,7 +154,8 @@ static void SetBlockAlignment(Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment);
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu",
static_cast<int>(conversion.block_alignment));
}
static void GetBlockAlignment(Interface* self) {
@@ -162,7 +165,8 @@ static void GetBlockAlignment(Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = static_cast<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<int>(conversion.block_alignment));
}
/**
@@ -664,8 +668,10 @@ cleanup:
Service_Y2R,
"called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu "
"input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX",
params->input_format, params->output_format, params->rotation, params->block_alignment,
params->input_line_width, params->input_lines, params->standard_coefficient,
static_cast<int>(params->input_format), static_cast<int>(params->output_format),
static_cast<int>(params->rotation), static_cast<int>(params->block_alignment),
params->input_line_width, params->input_lines,
static_cast<int>(params->standard_coefficient),
params->padding, params->alpha);
}
@@ -784,4 +790,4 @@ Y2R_U::~Y2R_U() {
}
} // namespace Y2R
} // namespace Service
} // namespace Service