Commit graph

8 commits

Author SHA1 Message Date
Lioncash
39ae73b356 file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicable
The data retrieved in these cases are ultimately chiefly owned by either
the RegisteredCache instance itself, or the filesystem factories. Both
these should live throughout the use of their contained data. If they
don't, it should be considered an interface/design issue, and using
shared_ptr instances here would mask that, as the data would always be
prolonged after the main owner's lifetime ended.

This makes the lifetime of the data explicit and makes it harder to
accidentally create cyclic references. It also makes the interface
slightly more flexible than the previous API, as a shared_ptr can be
created from a unique_ptr, but not the other way around, so this allows
for that use-case if it ever becomes necessary in some form.
2018-10-16 09:38:52 -04:00
Lioncash
6636f3ff47 patch_manager: Return a std::unique_ptr from ParseControlNCA() and GetControlMetadata() instead of a std::shared_ptr
Neither of these functions require the use of shared ownership of the
returned pointer. This makes it more difficult to create reference
cycles with, and makes the interface more generic, as std::shared_ptr
instances can be created from a std::unique_ptr, but the vice-versa
isn't possible. This also alters relevant functions to take NCA
arguments by const reference rather than a const reference to a
std::shared_ptr. These functions don't alter the ownership of the memory
used by the NCA instance, so we can make the interface more generic by
not assuming anything about the type of smart pointer the NCA is
contained within and make it the caller's responsibility to ensure the
supplied NCA is valid.
2018-10-09 14:38:03 -04:00
Zach Hilman
38c2ac95af romfs_factory: Extract packed update setter to new function 2018-10-05 08:53:51 -04:00
Zach Hilman
5acaeb04c4 patch_manager: Add support for NSP packed updates
Reads as Update (NSP) in add-ons
2018-10-05 08:48:44 -04:00
Zach Hilman
cf7aba4817 game_list: Add XCI update versioning to game list 2018-10-05 08:47:55 -04:00
Zach Hilman
4c2a94fa94 patch_manager: Use strings for patch type instead of enum 2018-10-01 16:02:50 -04:00
Lioncash
bd8065295c yuzu: Move compatibility list specifics to their own source files
Lets us keep the generic portions of the compatibility list code
together, and allows us to introduce a type alias that makes it so we
don't need to type out a very long type declaration anymore, making the
immediate readability of some code better.
2018-09-09 19:45:25 -04:00
Lioncash
564b7fdc9c yuzu: Move GameListWorker to its own source files
This has gotten sufficiently large enough to warrant moving it to its
own source files. Especially given it dumps the file_sys headers around
code that doesn't use it for the most part.

This'll also make it easier to introduce a type alias for the
compatibility list, so a large unordered_map type declaration doesn't
need to be specified all the time (we don't want to propagate the
game_list_p.h include via the main game_list.h header).
2018-09-07 16:25:28 -04:00