mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 16:53:48 -04:00
Replace std::make_tuple with simpler syntax (#77)
* boot2: Simplify g_additional_launch_programs It appears that Stratosphère is targeting C++17. In C++17, std::make_tuple is not required for initialisating a tuple anymore. Same thing, but less typing * Replace std::make_tuple with {} More readable and less noise. Also fixes two missing return statements.
This commit is contained in:
parent
cf50bad36c
commit
a097babe18
11 changed files with 155 additions and 155 deletions
|
@ -27,13 +27,13 @@ Result DebugMonitorService::dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64
|
|||
|
||||
std::tuple<Result> DebugMonitorService::add_title_to_launch_queue(u64 tid, InPointer<char> args) {
|
||||
fprintf(stderr, "Add to launch queue: %p, %X\n", args.pointer, args.num_elements);
|
||||
return std::make_tuple(LaunchQueue::add(tid, args.pointer, args.num_elements));
|
||||
return {LaunchQueue::add(tid, args.pointer, args.num_elements)};
|
||||
}
|
||||
|
||||
std::tuple<Result> DebugMonitorService::clear_launch_queue(u64 dat) {
|
||||
fprintf(stderr, "Clear launch queue: %lx\n", dat);
|
||||
LaunchQueue::clear();
|
||||
return std::make_tuple(0);
|
||||
return {0};
|
||||
}
|
||||
|
||||
std::tuple<Result, u32> DebugMonitorService::get_nso_info(u64 pid, OutPointerWithClientSize<Registration::NsoInfo> out) {
|
||||
|
@ -43,5 +43,5 @@ std::tuple<Result, u32> DebugMonitorService::get_nso_info(u64 pid, OutPointerWit
|
|||
|
||||
Result rc = Registration::GetNsoInfosForProcessId(out.pointer, out.num_elements, pid, &out_num_nsos);
|
||||
|
||||
return std::make_tuple(rc, out_num_nsos);
|
||||
}
|
||||
return {rc, out_num_nsos};
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@ std::tuple<Result, MovedHandle> ProcessManagerService::create_process(u64 flags,
|
|||
|
||||
rc = Registration::GetRegisteredTidSid(index, &tid_sid);
|
||||
if (R_FAILED(rc)) {
|
||||
std::make_tuple(rc, MovedHandle{process_h});
|
||||
return {rc, MovedHandle{process_h}};
|
||||
}
|
||||
|
||||
rc = ContentManagement::GetContentPathForTidSid(nca_path, &tid_sid);
|
||||
if (R_FAILED(rc)) {
|
||||
std::make_tuple(rc, MovedHandle{process_h});
|
||||
return {rc, MovedHandle{process_h}};
|
||||
}
|
||||
|
||||
launch_item = LaunchQueue::get_item(tid_sid.title_id);
|
||||
|
@ -55,7 +55,7 @@ std::tuple<Result, MovedHandle> ProcessManagerService::create_process(u64 flags,
|
|||
ContentManagement::SetCreatedTitle(tid_sid.title_id);
|
||||
}
|
||||
|
||||
return std::make_tuple(rc, MovedHandle{process_h});
|
||||
return {rc, MovedHandle{process_h}};
|
||||
}
|
||||
|
||||
std::tuple<Result> ProcessManagerService::get_program_info(Registration::TidSid tid_sid, OutPointerWithServerSize<ProcessManagerService::ProgramInfo, 0x1> out_program_info) {
|
||||
|
@ -67,40 +67,40 @@ std::tuple<Result> ProcessManagerService::get_program_info(Registration::TidSid
|
|||
rc = populate_program_info_buffer(out_program_info.pointer, &tid_sid);
|
||||
|
||||
if (R_FAILED(rc)) {
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
||||
if (tid_sid.title_id != out_program_info.pointer->title_id) {
|
||||
rc = ContentManagement::GetContentPathForTidSid(nca_path, &tid_sid);
|
||||
if (R_FAILED(rc)) {
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
||||
rc = ContentManagement::SetContentPath(nca_path, out_program_info.pointer->title_id, tid_sid.storage_id);
|
||||
if (R_FAILED(rc)) {
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
||||
rc = LaunchQueue::add_copy(tid_sid.title_id, out_program_info.pointer->title_id);
|
||||
}
|
||||
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
||||
std::tuple<Result, u64> ProcessManagerService::register_title(Registration::TidSid tid_sid) {
|
||||
u64 out_index = 0;
|
||||
if (Registration::RegisterTidSid(&tid_sid, &out_index)) {
|
||||
return std::make_tuple(0, out_index);
|
||||
return {0, out_index};
|
||||
} else {
|
||||
return std::make_tuple(0xE09, out_index);
|
||||
return {0xE09, out_index};
|
||||
}
|
||||
}
|
||||
|
||||
std::tuple<Result> ProcessManagerService::unregister_title(u64 index) {
|
||||
if (Registration::UnregisterIndex(index)) {
|
||||
return std::make_tuple(0);
|
||||
return {0};
|
||||
} else {
|
||||
return std::make_tuple(0x1009);
|
||||
return {0x1009};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,4 +161,4 @@ Result ProcessManagerService::populate_program_info_buffer(ProcessManagerService
|
|||
|
||||
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ std::tuple<Result, u64> RelocatableObjectsService::load_nro(PidDescriptor pid_de
|
|||
|
||||
rc = NroUtils::LoadNro(target_proc, this->process_handle, nro_address, nro_size, bss_address, bss_size, &out_address);
|
||||
LOAD_NRO_END:
|
||||
return std::make_tuple(rc, out_address);
|
||||
return {rc, out_address};
|
||||
}
|
||||
|
||||
std::tuple<Result> RelocatableObjectsService::unload_nro(PidDescriptor pid_desc, u64 nro_address) {
|
||||
|
@ -133,7 +133,7 @@ LOAD_NRR_END:
|
|||
nrr_info.Close();
|
||||
}
|
||||
}
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
||||
std::tuple<Result> RelocatableObjectsService::unload_nrr(PidDescriptor pid_desc, u64 nrr_address) {
|
||||
|
@ -166,5 +166,5 @@ std::tuple<Result> RelocatableObjectsService::initialize(PidDescriptor pid_desc,
|
|||
this->has_initialized = true;
|
||||
rc = 0;
|
||||
}
|
||||
return std::make_tuple(rc);
|
||||
return {rc};
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ Result ShellService::dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id
|
|||
|
||||
std::tuple<Result> ShellService::add_title_to_launch_queue(u64 tid, InPointer<char> args) {
|
||||
fprintf(stderr, "Add to launch queue: %p, %X\n", args.pointer, args.num_elements);
|
||||
return std::make_tuple(LaunchQueue::add(tid, args.pointer, args.num_elements));
|
||||
return {LaunchQueue::add(tid, args.pointer, args.num_elements)};
|
||||
}
|
||||
|
||||
std::tuple<Result> ShellService::clear_launch_queue(u64 dat) {
|
||||
fprintf(stderr, "Clear launch queue: %lx\n", dat);
|
||||
LaunchQueue::clear();
|
||||
return std::make_tuple(0);
|
||||
}
|
||||
return {0};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue