Commit Graph

58 Commits (c17a59b58e4c78dfee976dabddd13c3c6fdf95b7)

Author SHA1 Message Date
Lioncash 1da72c7792 file_sys: Resolve cases of variable shadowing
Brings us closer to enabling -Wshadow as an error in the core code.
4 years ago
ReinUsesLisp 4f13e270c8 core: Silence warnings when compiling without asserts 4 years ago
Lioncash 67a8e73101 registered_cache: Make use of ends_with for string suffix checking
Simplifies code.
5 years ago
Lioncash f83c6e1e0c registered_cache: Make use of designated initializers
Removes the need for comments to indicate the fields being assigned.
5 years ago
Lioncash c4ed791164 common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.

This also allows for high-traffic FS related code to alias the
filesystem function namespace as

namespace FS = Common::FS;

for more concise typing.
5 years ago
bunnei a971667d1f
Merge pull request #4468 from lioncash/regcache
registered_cache: Resolve -Wmaybe_uninitialized warnings
5 years ago
Lioncash 4ca0014479 registered_cache: Resolve -Wmaybe_uninitialized warnings
While we're at it, we can avoid a redundant map lookup.
5 years ago
Morph 2ec852dd9f registered_cache: Add support for removing folder ncas 5 years ago
Morph f66e3181dc Check for empty section0 and CNMT prior to install 5 years ago
Morph 1bbc61f5f1 Use proper install result when overwriting files 5 years ago
Morph 8794e623d9 Remove global system instance and address feedback 5 years ago
Morph a82fdea1ac registered_cache: Remove previous update/dlc if it exists on install
- This checks for and removes old updates or dlc based on title id. If a content meta nca exists within the registered cache, it will attempt to remove all the ncas associated with the content meta before installing a new update/dlc
5 years ago
FearlessTobi 9f82a9a244 crypto: Make KeyManager a singleton class
Previously, we were reading the keys everytime a KeyManager object was created, causing yuzu to reread the keys file multiple hundreds of times when loading the game list.
With this change, it is only loaded once.
On my system, this decreased game list loading times by a factor of 20.
5 years ago
Lioncash 1c340c6efa CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as
implicit fallthrough cases, etc.

We currently ignore unused parameters, since we currently have many
cases where this is intentional (virtual interfaces).

While we're at it, we can also tidy up any existing code that causes
warnings. This also uncovered a few bugs as well.
5 years ago
Lioncash e0c46e6879 core: Migrate off deprecated mbedtls functions
These functions are marked for deprecation and it's recommended that the
*_ret variants be used instead.
6 years ago
Zach Hilman 038bcec111 configure_debug: Move reporting option to logging 6 years ago
Zach Hilman c6ff4a6f4d yuzu: Port old usages of Filesystem namespace to FilesystemController 6 years ago
Zach Hilman 9d9fc8a675 registered_cache: Process *.cnmt.nca files
Needed to use the RegisteredCache/PlaceholderCache on gamecards.
6 years ago
Zach Hilman 8500ca797f registered_cache: Implement PlaceholderCache to manage placeholder and installing content 6 years ago
Bakugo b50557d1f0 file_sys: Rename other ContentRecordType members 6 years ago
Bakugo c72ef5f405 file_sys/registered_cache: Improve missing metadata error
This can happen when installing NSPs too, not just XCIs.
6 years ago
Bakugo 79163fca80 file_sys/registered_cache: Ignore DeltaFragment NCAs during installation
DeltaFragments are only used to download and apply partial patches on a real console, and are not useful to us at all. Most patch NSPs do not include them, and when they do, it's a waste of space to install them.
6 years ago
Zach Hilman d10fc2d727 glue: Correct missing bytes in ApplicationLaunchParameter 6 years ago
Zach Hilman db2e5e5fa6 registered_cache: Add getter to determine source slot in content provider union
Used to determine StorageId source for application data.
6 years ago
Lioncash a62088539e
common/hex_util: Combine HexVectorToString() and HexArrayToString()
These can be generified together by using a concept type to designate
them. This also has the benefit of not making copies of potentially very
large arrays.
6 years ago
Zach Hilman a6c7ae6fe8 file_sys: Create ContentProvider interface and default implementations 6 years ago
Lioncash b8c7072206 file_sys/content_archive: Amend name of Data_Unknown5 enum entry
While we're at it, give each entry some documentation.
6 years ago
Lioncash efbcff0af0 file_sys/registered_cache: Eliminate variable shadowing
Also inverts if statements where applicable to allow unindenting code a
little bit.
7 years ago
Lioncash d72c809030 file_sys/registered_cache: Use regular const references instead of std::shared_ptr for InstallEntry()
These parameters don't need to utilize a shared lifecycle directly in
the interface. Instead, the caller should provide a regular reference
for the function to use. This also allows the type system to flag
attempts to pass nullptr and makes it more generic, since it can now be
used in contexts where a shared_ptr isn't being used (in other words, we
don't constrain the usage of the interface to a particular mode of
memory management).
7 years ago
Zach Hilman 97d425c304 file_sys: Use common KeyManager in NCA container types
Creates a single KeyManager for the entire container and then passes it into the NCA constructor, eliminating several unnecessary KeyManager reads.
7 years ago
Frederic L 7a5eda5914 global: Use std::optional instead of boost::optional (#1578)
* get rid of boost::optional

* Remove optional references

* Use std::reference_wrapper for optional references

* Fix clang format

* Fix clang format part 2

* Adressed feedback

* Fix clang format and MacOS build
7 years ago
Zach Hilman 9d0fb0f815 qt: Add support for dumping a DLC Data RomFS 7 years ago
Zach Hilman 59044862a9 registered_cache: Deduplicate results of ListEntry and ListEntryFilter
Prevents a Entry from appearing in the list twice if the user has it installed in two places (e.g. User NAND and SDMC)
7 years ago
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.
7 years ago
Lioncash 28bef31ea8 vfs_concat/vfs_layered: Remove friend declarations from ConcatenatedVfsFile
Given these are only added to the class to allow those functions to
access the private constructor, it's a better approach to just make them
static functions in the interface, to make the dependency explicit.
7 years ago
Zach Hilman b3c2ec362b fsmitm: Cleanup and modernize fsmitm port 7 years ago
Zach Hilman ba0873d33c qt: Add UI elements for LayeredFS and related tools 7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
Zach Hilman 9664ce255d bktr: Fix missing includes and optimize style 7 years ago
Zach Hilman 9951f6d054 registration: Add RegisteredCacheUnion
Aggregates multiple caches into one interface
7 years ago
Zach Hilman 87be4bc283 main: Only show DRD deprecation warning once 7 years ago
Zach Hilman f7eaea424d registration: Add support for installing NSP files 7 years ago
Lioncash a813c10e1c file_sys: Replace includes with forward declarations where applicable
Cuts down on include dependencies, resulting in less files that need to
be rebuilt when certain things are changed.
7 years ago
Lioncash a405373144 vfs_real: Forward declare IOFile
Eliminates the need to rebuild some source files if the file_util header
ever changes. This also uncovered some indirect inclusions, which have
also been fixed.
7 years ago
Lioncash d3934d7da7 registered_cache: Get rid of variable shadowing in ProcessFiles()
Prevents compiler warnings.
7 years ago
Zach Hilman a7e8d10969 file_sys: Cut down on includes and copies 7 years ago
Zach Hilman 8b52d6682a registration: Add GetEntryUnparsed methods
Returns the file before calling parser on it.
7 years ago
Zach Hilman e8cb6f5c9b registration: Add Data_Unknown5 NCAContentType 7 years ago
Zach Hilman 27da7bc9da filesystem: Add support for loading of system archives 7 years ago
Lioncash b39cd70cd4 common: Namespace hex_util.h/.cpp
It's in the common code, so it should be under the Common namespace like
everything else.
7 years ago