diff options
| author | 2018-10-16 11:21:13 -0400 | |
|---|---|---|
| committer | 2018-10-16 11:21:13 -0400 | |
| commit | 59c1ca8b0c0051a63d57ccb433a96909acf8000c (patch) | |
| tree | 2df1a3b0722373a00173fae49df3be3c0445d92d /src/core/hle | |
| parent | Merge pull request #1507 from FearlessTobi/port-4327 (diff) | |
| parent | file_sys/registered_cache: Use unique_ptr and regular pointers instead of sha... (diff) | |
| download | yuzu-59c1ca8b0c0051a63d57ccb433a96909acf8000c.tar.gz yuzu-59c1ca8b0c0051a63d57ccb433a96909acf8000c.tar.xz yuzu-59c1ca8b0c0051a63d57ccb433a96909acf8000c.zip | |
Merge pull request #1508 from lioncash/unique-reg
file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicable
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index e06712603..e32a7c48e 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -319,13 +319,12 @@ ResultVal<FileSys::VirtualDir> OpenSDMC() { | |||
| 319 | return sdmc_factory->Open(); | 319 | return sdmc_factory->Open(); |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() { | 322 | std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() { |
| 323 | return std::make_shared<FileSys::RegisteredCacheUnion>( | 323 | return std::make_unique<FileSys::RegisteredCacheUnion>(std::vector<FileSys::RegisteredCache*>{ |
| 324 | std::vector<std::shared_ptr<FileSys::RegisteredCache>>{ | 324 | GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}); |
| 325 | GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}); | ||
| 326 | } | 325 | } |
| 327 | 326 | ||
| 328 | std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents() { | 327 | FileSys::RegisteredCache* GetSystemNANDContents() { |
| 329 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); | 328 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); |
| 330 | 329 | ||
| 331 | if (bis_factory == nullptr) | 330 | if (bis_factory == nullptr) |
| @@ -334,7 +333,7 @@ std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents() { | |||
| 334 | return bis_factory->GetSystemNANDContents(); | 333 | return bis_factory->GetSystemNANDContents(); |
| 335 | } | 334 | } |
| 336 | 335 | ||
| 337 | std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents() { | 336 | FileSys::RegisteredCache* GetUserNANDContents() { |
| 338 | LOG_TRACE(Service_FS, "Opening User NAND Contents"); | 337 | LOG_TRACE(Service_FS, "Opening User NAND Contents"); |
| 339 | 338 | ||
| 340 | if (bis_factory == nullptr) | 339 | if (bis_factory == nullptr) |
| @@ -343,7 +342,7 @@ std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents() { | |||
| 343 | return bis_factory->GetUserNANDContents(); | 342 | return bis_factory->GetUserNANDContents(); |
| 344 | } | 343 | } |
| 345 | 344 | ||
| 346 | std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents() { | 345 | FileSys::RegisteredCache* GetSDMCContents() { |
| 347 | LOG_TRACE(Service_FS, "Opening SDMC Contents"); | 346 | LOG_TRACE(Service_FS, "Opening SDMC Contents"); |
| 348 | 347 | ||
| 349 | if (sdmc_factory == nullptr) | 348 | if (sdmc_factory == nullptr) |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 2df1faeb0..6ca5c5636 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -47,11 +47,11 @@ ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space, | |||
| 47 | FileSys::SaveDataDescriptor save_struct); | 47 | FileSys::SaveDataDescriptor save_struct); |
| 48 | ResultVal<FileSys::VirtualDir> OpenSDMC(); | 48 | ResultVal<FileSys::VirtualDir> OpenSDMC(); |
| 49 | 49 | ||
| 50 | std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); | 50 | std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); |
| 51 | 51 | ||
| 52 | std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents(); | 52 | FileSys::RegisteredCache* GetSystemNANDContents(); |
| 53 | std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents(); | 53 | FileSys::RegisteredCache* GetUserNANDContents(); |
| 54 | std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents(); | 54 | FileSys::RegisteredCache* GetSDMCContents(); |
| 55 | 55 | ||
| 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); | 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); |
| 57 | 57 | ||
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 4b2f758a8..44accecb7 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -161,7 +161,7 @@ PL_U::PL_U() : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} { | |||
| 161 | }; | 161 | }; |
| 162 | RegisterHandlers(functions); | 162 | RegisterHandlers(functions); |
| 163 | // Attempt to load shared font data from disk | 163 | // Attempt to load shared font data from disk |
| 164 | const auto nand = FileSystem::GetSystemNANDContents(); | 164 | const auto* nand = FileSystem::GetSystemNANDContents(); |
| 165 | std::size_t offset = 0; | 165 | std::size_t offset = 0; |
| 166 | // Rebuild shared fonts from data ncas | 166 | // Rebuild shared fonts from data ncas |
| 167 | if (nand->HasEntry(static_cast<u64>(FontArchives::Standard), | 167 | if (nand->HasEntry(static_cast<u64>(FontArchives::Standard), |