diff --git a/stratosphere/ncm/source/lr_addoncontentlocationresolver.cpp b/stratosphere/ncm/source/lr_addoncontentlocationresolver.cpp index 9fc4b5cae..78f5fa8a0 100644 --- a/stratosphere/ncm/source/lr_addoncontentlocationresolver.cpp +++ b/stratosphere/ncm/source/lr_addoncontentlocationresolver.cpp @@ -20,7 +20,6 @@ namespace sts::lr { Result AddOnContentLocationResolverInterface::ResolveAddOnContentPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; ncm::StorageId storage_id = ncm::StorageId::None; if (!this->registered_storages.Find(&storage_id, tid)) { @@ -35,8 +34,7 @@ namespace sts::lr { std::shared_ptr content_storage; R_TRY(ncm::impl::OpenContentStorage(&content_storage, storage_id)); - R_ASSERT(content_storage->GetPath(&path, data_content_id)); - *out.pointer = path; + R_ASSERT(content_storage->GetPath(out.pointer, data_content_id)); return ResultSuccess; } diff --git a/stratosphere/ncm/source/lr_contentlocationresolver.cpp b/stratosphere/ncm/source/lr_contentlocationresolver.cpp index 6bebe6bca..807eed5b6 100644 --- a/stratosphere/ncm/source/lr_contentlocationresolver.cpp +++ b/stratosphere/ncm/source/lr_contentlocationresolver.cpp @@ -28,10 +28,7 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->program_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->program_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -43,8 +40,7 @@ namespace sts::lr { } } R_END_TRY_CATCH; - R_ASSERT(this->content_storage->GetPath(&path, program_content_id)); - *out.pointer = path; + R_ASSERT(this->content_storage->GetPath(out.pointer, program_content_id)); return ResultSuccess; } @@ -54,10 +50,7 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->app_control_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->app_control_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -65,10 +58,7 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->html_docs_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->html_docs_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -76,12 +66,10 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; ncm::ContentId data_content_id; R_TRY(this->content_meta_database->GetLatestData(&data_content_id, tid)); - R_ASSERT(this->content_storage->GetPath(&path, data_content_id)); - *out.pointer = path; + R_ASSERT(this->content_storage->GetPath(out.pointer, data_content_id)); return ResultSuccess; } @@ -96,10 +84,7 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->legal_info_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->legal_info_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -163,20 +148,16 @@ namespace sts::lr { } Result ContentLocationResolverInterface::ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->debug_program_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->debug_program_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } - R_TRY_CATCH(this->ResolveProgramPath(&path, tid)) { + R_TRY_CATCH(this->ResolveProgramPath(out.pointer, tid)) { R_CATCH(ResultLrProgramNotFound) { return ResultLrDebugProgramNotFound; } } R_END_TRY_CATCH; - *out.pointer = path; return ResultSuccess; } diff --git a/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp b/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp index 2a36c5f3e..97f8592fd 100644 --- a/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp +++ b/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp @@ -28,10 +28,7 @@ namespace sts::lr { } Result RedirectOnlyLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->program_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->program_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -44,10 +41,7 @@ namespace sts::lr { } Result RedirectOnlyLocationResolverInterface::ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->app_control_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->app_control_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -55,10 +49,7 @@ namespace sts::lr { } Result RedirectOnlyLocationResolverInterface::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->html_docs_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->html_docs_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -80,10 +71,7 @@ namespace sts::lr { } Result RedirectOnlyLocationResolverInterface::ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->legal_info_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->legal_info_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } @@ -139,20 +127,16 @@ namespace sts::lr { } Result RedirectOnlyLocationResolverInterface::ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (this->debug_program_redirector.FindRedirection(&path, tid)) { - *out.pointer = path; + if (this->debug_program_redirector.FindRedirection(out.pointer, tid)) { return ResultSuccess; } - R_TRY_CATCH(this->ResolveProgramPath(&path, tid)) { + R_TRY_CATCH(this->ResolveProgramPath(out.pointer, tid)) { R_CATCH(ResultLrProgramNotFound) { return ResultLrDebugProgramNotFound; } } R_END_TRY_CATCH; - *out.pointer = path; return ResultSuccess; } diff --git a/stratosphere/ncm/source/lr_registeredlocationresolver.cpp b/stratosphere/ncm/source/lr_registeredlocationresolver.cpp index 8e4dea648..4a491f928 100644 --- a/stratosphere/ncm/source/lr_registeredlocationresolver.cpp +++ b/stratosphere/ncm/source/lr_registeredlocationresolver.cpp @@ -25,20 +25,17 @@ namespace sts::lr { } Result RegisteredLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (!this->program_redirector.FindRedirection(&path, tid)) { - if (!this->registered_program_locations.Find(&path, tid)) { + if (!this->program_redirector.FindRedirection(out.pointer, tid)) { + if (!this->registered_program_locations.Find(out.pointer, tid)) { return ResultLrProgramNotFound; } } - *out.pointer = path; return ResultSuccess; } Result RegisteredLocationResolverInterface::RegisterProgramPath(InPointer path, ncm::TitleId tid) { - Path tmp_path = *path.pointer; + const Path& tmp_path = *path.pointer; if (!this->registered_program_locations.Register(tid, tmp_path)) { this->registered_program_locations.Clear(); @@ -60,20 +57,17 @@ namespace sts::lr { } Result RegisteredLocationResolverInterface::ResolveHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) { - Path path; - - if (!this->html_docs_redirector.FindRedirection(&path, tid)) { - if (!this->registered_html_docs_locations.Find(&path, tid)) { + if (!this->html_docs_redirector.FindRedirection(out.pointer, tid)) { + if (!this->registered_html_docs_locations.Find(out.pointer, tid)) { return ResultLrProgramNotFound; } } - *out.pointer = path; return ResultLrHtmlDocumentNotFound; } Result RegisteredLocationResolverInterface::RegisterHtmlDocumentPath(InPointer path, ncm::TitleId tid) { - Path tmp_path = *path.pointer; + const Path& tmp_path = *path.pointer; if (!this->registered_html_docs_locations.Register(tid, tmp_path)) { this->registered_html_docs_locations.Clear();