summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar MerryMage2016-04-05 13:29:55 +0100
committerGravatar MerryMage2016-04-05 13:31:17 +0100
commita06dcfeb61d6769c562d6d50cfa3c0024176ae82 (patch)
treee1f81e5faebce62810ac079b8a6e616182c34959 /src/core/file_sys
parentMerge pull request #1302 from Subv/save_fix (diff)
downloadyuzu-a06dcfeb61d6769c562d6d50cfa3c0024176ae82.tar.gz
yuzu-a06dcfeb61d6769c562d6d50cfa3c0024176ae82.tar.xz
yuzu-a06dcfeb61d6769c562d6d50cfa3c0024176ae82.zip
Common: Remove Common::make_unique, use std::make_unique
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/archive_extsavedata.cpp4
-rw-r--r--src/core/file_sys/archive_romfs.cpp3
-rw-r--r--src/core/file_sys/archive_savedata.cpp4
-rw-r--r--src/core/file_sys/archive_savedatacheck.cpp4
-rw-r--r--src/core/file_sys/archive_sdmc.cpp4
-rw-r--r--src/core/file_sys/archive_systemsavedata.cpp4
-rw-r--r--src/core/file_sys/disk_archive.cpp8
-rw-r--r--src/core/file_sys/ivfc_archive.cpp5
8 files changed, 17 insertions, 19 deletions
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp
index 961264fe5..1d9eaefcb 100644
--- a/src/core/file_sys/archive_extsavedata.cpp
+++ b/src/core/file_sys/archive_extsavedata.cpp
@@ -3,12 +3,12 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <memory>
6#include <vector> 7#include <vector>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
9#include "common/file_util.h" 10#include "common/file_util.h"
10#include "common/logging/log.h" 11#include "common/logging/log.h"
11#include "common/make_unique.h"
12#include "common/string_util.h" 12#include "common/string_util.h"
13 13
14#include "core/file_sys/archive_extsavedata.h" 14#include "core/file_sys/archive_extsavedata.h"
@@ -84,7 +84,7 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_ExtSaveData::Open(cons
84 ErrorSummary::InvalidState, ErrorLevel::Status); 84 ErrorSummary::InvalidState, ErrorLevel::Status);
85 } 85 }
86 } 86 }
87 auto archive = Common::make_unique<DiskArchive>(fullpath); 87 auto archive = std::make_unique<DiskArchive>(fullpath);
88 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 88 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
89} 89}
90 90
diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp
index a9a29ebde..38828b546 100644
--- a/src/core/file_sys/archive_romfs.cpp
+++ b/src/core/file_sys/archive_romfs.cpp
@@ -7,7 +7,6 @@
7 7
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "common/logging/log.h" 9#include "common/logging/log.h"
10#include "common/make_unique.h"
11 10
12#include "core/file_sys/archive_romfs.h" 11#include "core/file_sys/archive_romfs.h"
13#include "core/file_sys/ivfc_archive.h" 12#include "core/file_sys/ivfc_archive.h"
@@ -25,7 +24,7 @@ ArchiveFactory_RomFS::ArchiveFactory_RomFS(Loader::AppLoader& app_loader) {
25} 24}
26 25
27ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_RomFS::Open(const Path& path) { 26ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_RomFS::Open(const Path& path) {
28 auto archive = Common::make_unique<IVFCArchive>(romfs_file, data_offset, data_size); 27 auto archive = std::make_unique<IVFCArchive>(romfs_file, data_offset, data_size);
29 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 28 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
30} 29}
31 30
diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp
index fe020d21c..fd5711e14 100644
--- a/src/core/file_sys/archive_savedata.cpp
+++ b/src/core/file_sys/archive_savedata.cpp
@@ -3,11 +3,11 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <memory>
6 7
7#include "common/common_types.h" 8#include "common/common_types.h"
8#include "common/file_util.h" 9#include "common/file_util.h"
9#include "common/logging/log.h" 10#include "common/logging/log.h"
10#include "common/make_unique.h"
11#include "common/string_util.h" 11#include "common/string_util.h"
12 12
13#include "core/file_sys/archive_savedata.h" 13#include "core/file_sys/archive_savedata.h"
@@ -53,7 +53,7 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveData::Open(const P
53 ErrorSummary::InvalidState, ErrorLevel::Status); 53 ErrorSummary::InvalidState, ErrorLevel::Status);
54 } 54 }
55 55
56 auto archive = Common::make_unique<DiskArchive>(std::move(concrete_mount_point)); 56 auto archive = std::make_unique<DiskArchive>(std::move(concrete_mount_point));
57 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 57 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
58} 58}
59 59
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp
index 3db11c500..9f65e5455 100644
--- a/src/core/file_sys/archive_savedatacheck.cpp
+++ b/src/core/file_sys/archive_savedatacheck.cpp
@@ -3,12 +3,12 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <memory>
6#include <vector> 7#include <vector>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
9#include "common/file_util.h" 10#include "common/file_util.h"
10#include "common/logging/log.h" 11#include "common/logging/log.h"
11#include "common/make_unique.h"
12#include "common/string_util.h" 12#include "common/string_util.h"
13 13
14#include "core/file_sys/archive_savedatacheck.h" 14#include "core/file_sys/archive_savedatacheck.h"
@@ -44,7 +44,7 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(co
44 } 44 }
45 auto size = file->GetSize(); 45 auto size = file->GetSize();
46 46
47 auto archive = Common::make_unique<IVFCArchive>(file, 0, size); 47 auto archive = std::make_unique<IVFCArchive>(file, 0, size);
48 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 48 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
49} 49}
50 50
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 657221cbf..9b218af58 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -3,10 +3,10 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <memory>
6 7
7#include "common/file_util.h" 8#include "common/file_util.h"
8#include "common/logging/log.h" 9#include "common/logging/log.h"
9#include "common/make_unique.h"
10 10
11#include "core/file_sys/archive_sdmc.h" 11#include "core/file_sys/archive_sdmc.h"
12#include "core/file_sys/disk_archive.h" 12#include "core/file_sys/disk_archive.h"
@@ -36,7 +36,7 @@ bool ArchiveFactory_SDMC::Initialize() {
36} 36}
37 37
38ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SDMC::Open(const Path& path) { 38ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SDMC::Open(const Path& path) {
39 auto archive = Common::make_unique<DiskArchive>(sdmc_directory); 39 auto archive = std::make_unique<DiskArchive>(sdmc_directory);
40 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 40 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
41} 41}
42 42
diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp
index e1780de2f..1bcc228a1 100644
--- a/src/core/file_sys/archive_systemsavedata.cpp
+++ b/src/core/file_sys/archive_systemsavedata.cpp
@@ -3,11 +3,11 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <memory>
6#include <vector> 7#include <vector>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
9#include "common/file_util.h" 10#include "common/file_util.h"
10#include "common/make_unique.h"
11#include "common/string_util.h" 11#include "common/string_util.h"
12 12
13#include "core/file_sys/archive_systemsavedata.h" 13#include "core/file_sys/archive_systemsavedata.h"
@@ -59,7 +59,7 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SystemSaveData::Open(c
59 return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, 59 return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS,
60 ErrorSummary::InvalidState, ErrorLevel::Status); 60 ErrorSummary::InvalidState, ErrorLevel::Status);
61 } 61 }
62 auto archive = Common::make_unique<DiskArchive>(fullpath); 62 auto archive = std::make_unique<DiskArchive>(fullpath);
63 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); 63 return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive));
64} 64}
65 65
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index 8e4ea01c5..489cc96fb 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -4,11 +4,11 @@
4 4
5#include <algorithm> 5#include <algorithm>
6#include <cstdio> 6#include <cstdio>
7#include <memory>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
9#include "common/file_util.h" 10#include "common/file_util.h"
10#include "common/logging/log.h" 11#include "common/logging/log.h"
11#include "common/make_unique.h"
12 12
13#include "core/file_sys/disk_archive.h" 13#include "core/file_sys/disk_archive.h"
14 14
@@ -19,7 +19,7 @@ namespace FileSys {
19 19
20ResultVal<std::unique_ptr<FileBackend>> DiskArchive::OpenFile(const Path& path, const Mode mode) const { 20ResultVal<std::unique_ptr<FileBackend>> DiskArchive::OpenFile(const Path& path, const Mode mode) const {
21 LOG_DEBUG(Service_FS, "called path=%s mode=%01X", path.DebugStr().c_str(), mode.hex); 21 LOG_DEBUG(Service_FS, "called path=%s mode=%01X", path.DebugStr().c_str(), mode.hex);
22 auto file = Common::make_unique<DiskFile>(*this, path, mode); 22 auto file = std::make_unique<DiskFile>(*this, path, mode);
23 ResultCode result = file->Open(); 23 ResultCode result = file->Open();
24 if (result.IsError()) 24 if (result.IsError())
25 return result; 25 return result;
@@ -83,7 +83,7 @@ bool DiskArchive::RenameDirectory(const Path& src_path, const Path& dest_path) c
83 83
84std::unique_ptr<DirectoryBackend> DiskArchive::OpenDirectory(const Path& path) const { 84std::unique_ptr<DirectoryBackend> DiskArchive::OpenDirectory(const Path& path) const {
85 LOG_DEBUG(Service_FS, "called path=%s", path.DebugStr().c_str()); 85 LOG_DEBUG(Service_FS, "called path=%s", path.DebugStr().c_str());
86 auto directory = Common::make_unique<DiskDirectory>(*this, path); 86 auto directory = std::make_unique<DiskDirectory>(*this, path);
87 if (!directory->Open()) 87 if (!directory->Open())
88 return nullptr; 88 return nullptr;
89 return std::move(directory); 89 return std::move(directory);
@@ -132,7 +132,7 @@ ResultCode DiskFile::Open() {
132 // Open the file in binary mode, to avoid problems with CR/LF on Windows systems 132 // Open the file in binary mode, to avoid problems with CR/LF on Windows systems
133 mode_string += "b"; 133 mode_string += "b";
134 134
135 file = Common::make_unique<FileUtil::IOFile>(path, mode_string.c_str()); 135 file = std::make_unique<FileUtil::IOFile>(path, mode_string.c_str());
136 if (file->IsOpen()) 136 if (file->IsOpen())
137 return RESULT_SUCCESS; 137 return RESULT_SUCCESS;
138 return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, ErrorSummary::NotFound, ErrorLevel::Status); 138 return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, ErrorSummary::NotFound, ErrorLevel::Status);
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp
index a8e9a72ef..c61791ef7 100644
--- a/src/core/file_sys/ivfc_archive.cpp
+++ b/src/core/file_sys/ivfc_archive.cpp
@@ -7,7 +7,6 @@
7 7
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "common/logging/log.h" 9#include "common/logging/log.h"
10#include "common/make_unique.h"
11 10
12#include "core/file_sys/ivfc_archive.h" 11#include "core/file_sys/ivfc_archive.h"
13 12
@@ -21,7 +20,7 @@ std::string IVFCArchive::GetName() const {
21} 20}
22 21
23ResultVal<std::unique_ptr<FileBackend>> IVFCArchive::OpenFile(const Path& path, const Mode mode) const { 22ResultVal<std::unique_ptr<FileBackend>> IVFCArchive::OpenFile(const Path& path, const Mode mode) const {
24 return MakeResult<std::unique_ptr<FileBackend>>(Common::make_unique<IVFCFile>(romfs_file, data_offset, data_size)); 23 return MakeResult<std::unique_ptr<FileBackend>>(std::make_unique<IVFCFile>(romfs_file, data_offset, data_size));
25} 24}
26 25
27ResultCode IVFCArchive::DeleteFile(const Path& path) const { 26ResultCode IVFCArchive::DeleteFile(const Path& path) const {
@@ -58,7 +57,7 @@ bool IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) c
58} 57}
59 58
60std::unique_ptr<DirectoryBackend> IVFCArchive::OpenDirectory(const Path& path) const { 59std::unique_ptr<DirectoryBackend> IVFCArchive::OpenDirectory(const Path& path) const {
61 return Common::make_unique<IVFCDirectory>(); 60 return std::make_unique<IVFCDirectory>();
62} 61}
63 62
64u64 IVFCArchive::GetFreeBytes() const { 63u64 IVFCArchive::GetFreeBytes() const {