From f272261c210877fadc486d6a0413f4770f04ca89 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 19 Sep 2018 13:46:32 -0400 Subject: xts_archive: Ensure NAX's type member is always initialized Ensures that the member always has a deterministic value. --- src/core/file_sys/xts_archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/xts_archive.h') diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h index 55d2154a6..0dd0536f1 100644 --- a/src/core/file_sys/xts_archive.h +++ b/src/core/file_sys/xts_archive.h @@ -60,7 +60,7 @@ private: VirtualFile file; Loader::ResultStatus status; - NAXContentType type; + NAXContentType type{}; VirtualFile dec_file; -- cgit v1.2.3 From 2752183883604673e5058a3a6f62defcdca49a72 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 19 Sep 2018 14:16:22 -0400 Subject: xts_archive: Make AsNCA() return a std::unique_ptr instead of a std::shared_ptr std::shared_ptr isn't strictly necessary here and is only ever used in contexts where the object doesn't depend on being shared. This also makes the interface more flexible, as it's possible to create a std::shared_ptr from a std::unique_ptr (std::shared_ptr has a constructor that accepts a std::unique_ptr), but not the other way around. --- src/core/file_sys/xts_archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/file_sys/xts_archive.h') diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h index 0dd0536f1..6e2fc4d2e 100644 --- a/src/core/file_sys/xts_archive.h +++ b/src/core/file_sys/xts_archive.h @@ -38,7 +38,7 @@ public: VirtualFile GetDecrypted() const; - std::shared_ptr AsNCA() const; + std::unique_ptr AsNCA() const; NAXContentType GetContentType() const; -- cgit v1.2.3