diff options
| author | 2016-10-03 20:34:56 -0400 | |
|---|---|---|
| committer | 2016-10-03 20:34:56 -0400 | |
| commit | 7ed97fb89aa8cfe39a36f1958de61e69b2e5026c (patch) | |
| tree | 779a58d37d20674d97b648b9546413c1ce8f7d6a /src | |
| parent | Merge pull request #2103 from wwylele/gpu-reg-cleanup (diff) | |
| parent | fs: clean up log format (diff) | |
| download | yuzu-7ed97fb89aa8cfe39a36f1958de61e69b2e5026c.tar.gz yuzu-7ed97fb89aa8cfe39a36f1958de61e69b2e5026c.tar.xz yuzu-7ed97fb89aa8cfe39a36f1958de61e69b2e5026c.zip | |
Merge pull request #2106 from wwylele/delete-recursive
FS: implement DeleteDirectoryRecursively
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 7 | ||||
| -rw-r--r-- | src/core/file_sys/disk_archive.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/disk_archive.h | 1 | ||||
| -rw-r--r-- | src/core/file_sys/ivfc_archive.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/ivfc_archive.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 9 | ||||
| -rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 75 |
8 files changed, 93 insertions, 22 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index d69c3c785..06b8f2ed7 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h | |||
| @@ -112,6 +112,13 @@ public: | |||
| 112 | virtual bool DeleteDirectory(const Path& path) const = 0; | 112 | virtual bool DeleteDirectory(const Path& path) const = 0; |
| 113 | 113 | ||
| 114 | /** | 114 | /** |
| 115 | * Delete a directory specified by its path and anything under it | ||
| 116 | * @param path Path relative to the archive | ||
| 117 | * @return Whether the directory could be deleted | ||
| 118 | */ | ||
| 119 | virtual bool DeleteDirectoryRecursively(const Path& path) const = 0; | ||
| 120 | |||
| 121 | /** | ||
| 115 | * Create a file specified by its path | 122 | * Create a file specified by its path |
| 116 | * @param path Path relative to the Archive | 123 | * @param path Path relative to the Archive |
| 117 | * @param size The size of the new file, filled with zeroes | 124 | * @param size The size of the new file, filled with zeroes |
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 0f66998e1..2f05af361 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp | |||
| @@ -51,6 +51,10 @@ bool DiskArchive::DeleteDirectory(const Path& path) const { | |||
| 51 | return FileUtil::DeleteDir(mount_point + path.AsString()); | 51 | return FileUtil::DeleteDir(mount_point + path.AsString()); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | bool DiskArchive::DeleteDirectoryRecursively(const Path& path) const { | ||
| 55 | return FileUtil::DeleteDirRecursively(mount_point + path.AsString()); | ||
| 56 | } | ||
| 57 | |||
| 54 | ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const { | 58 | ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const { |
| 55 | std::string full_path = mount_point + path.AsString(); | 59 | std::string full_path = mount_point + path.AsString(); |
| 56 | 60 | ||
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 2165f27f9..59ebb2002 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h | |||
| @@ -38,6 +38,7 @@ public: | |||
| 38 | ResultCode DeleteFile(const Path& path) const override; | 38 | ResultCode DeleteFile(const Path& path) const override; |
| 39 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; | 39 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; |
| 40 | bool DeleteDirectory(const Path& path) const override; | 40 | bool DeleteDirectory(const Path& path) const override; |
| 41 | bool DeleteDirectoryRecursively(const Path& path) const override; | ||
| 41 | ResultCode CreateFile(const Path& path, u64 size) const override; | 42 | ResultCode CreateFile(const Path& path, u64 size) const override; |
| 42 | bool CreateDirectory(const Path& path) const override; | 43 | bool CreateDirectory(const Path& path) const override; |
| 43 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; | 44 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; |
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 49cc1de10..af59d296d 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp | |||
| @@ -43,6 +43,12 @@ bool IVFCArchive::DeleteDirectory(const Path& path) const { | |||
| 43 | return false; | 43 | return false; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | bool IVFCArchive::DeleteDirectoryRecursively(const Path& path) const { | ||
| 47 | LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).", | ||
| 48 | GetName().c_str()); | ||
| 49 | return false; | ||
| 50 | } | ||
| 51 | |||
| 46 | ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { | 52 | ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { |
| 47 | LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", | 53 | LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", |
| 48 | GetName().c_str()); | 54 | GetName().c_str()); |
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 0df6cf83a..2fbb3a568 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h | |||
| @@ -37,6 +37,7 @@ public: | |||
| 37 | ResultCode DeleteFile(const Path& path) const override; | 37 | ResultCode DeleteFile(const Path& path) const override; |
| 38 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; | 38 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; |
| 39 | bool DeleteDirectory(const Path& path) const override; | 39 | bool DeleteDirectory(const Path& path) const override; |
| 40 | bool DeleteDirectoryRecursively(const Path& path) const override; | ||
| 40 | ResultCode CreateFile(const Path& path, u64 size) const override; | 41 | ResultCode CreateFile(const Path& path, u64 size) const override; |
| 41 | bool CreateDirectory(const Path& path) const override; | 42 | bool CreateDirectory(const Path& path) const override; |
| 42 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; | 43 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; |
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 4dc7e1e3c..7f9696bfb 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -362,6 +362,18 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy | |||
| 362 | ErrorSummary::Canceled, ErrorLevel::Status); | 362 | ErrorSummary::Canceled, ErrorLevel::Status); |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | ResultCode DeleteDirectoryRecursivelyFromArchive(ArchiveHandle archive_handle, | ||
| 366 | const FileSys::Path& path) { | ||
| 367 | ArchiveBackend* archive = GetArchive(archive_handle); | ||
| 368 | if (archive == nullptr) | ||
| 369 | return ERR_INVALID_ARCHIVE_HANDLE; | ||
| 370 | |||
| 371 | if (archive->DeleteDirectoryRecursively(path)) | ||
| 372 | return RESULT_SUCCESS; | ||
| 373 | return ResultCode(ErrorDescription::NoData, ErrorModule::FS, // TODO: verify description | ||
| 374 | ErrorSummary::Canceled, ErrorLevel::Status); | ||
| 375 | } | ||
| 376 | |||
| 365 | ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, | 377 | ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, |
| 366 | u64 file_size) { | 378 | u64 file_size) { |
| 367 | ArchiveBackend* archive = GetArchive(archive_handle); | 379 | ArchiveBackend* archive = GetArchive(archive_handle); |
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 533be34a4..41a76285c 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -133,6 +133,15 @@ ResultCode RenameFileBetweenArchives(ArchiveHandle src_archive_handle, | |||
| 133 | ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSys::Path& path); | 133 | ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSys::Path& path); |
| 134 | 134 | ||
| 135 | /** | 135 | /** |
| 136 | * Delete a Directory and anything under it from an Archive | ||
| 137 | * @param archive_handle Handle to an open Archive object | ||
| 138 | * @param path Path to the Directory inside of the Archive | ||
| 139 | * @return Whether deletion succeeded | ||
| 140 | */ | ||
| 141 | ResultCode DeleteDirectoryRecursivelyFromArchive(ArchiveHandle archive_handle, | ||
| 142 | const FileSys::Path& path); | ||
| 143 | |||
| 144 | /** | ||
| 136 | * Create a File in an Archive | 145 | * Create a File in an Archive |
| 137 | * @param archive_handle Handle to an open Archive object | 146 | * @param archive_handle Handle to an open Archive object |
| 138 | * @param path Path to the File inside of the Archive | 147 | * @param path Path to the File inside of the Archive |
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 94f053dc2..00edc7622 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp | |||
| @@ -64,7 +64,7 @@ static void OpenFile(Service::Interface* self) { | |||
| 64 | u32 filename_ptr = cmd_buff[9]; | 64 | u32 filename_ptr = cmd_buff[9]; |
| 65 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 65 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 66 | 66 | ||
| 67 | LOG_DEBUG(Service_FS, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, | 67 | LOG_DEBUG(Service_FS, "path=%s, mode=%u attrs=%u", file_path.DebugStr().c_str(), mode.hex, |
| 68 | attributes); | 68 | attributes); |
| 69 | 69 | ||
| 70 | ResultVal<SharedPtr<File>> file_res = OpenFileFromArchive(archive_handle, file_path, mode); | 70 | ResultVal<SharedPtr<File>> file_res = OpenFileFromArchive(archive_handle, file_path, mode); |
| @@ -112,15 +112,15 @@ static void OpenFileDirectly(Service::Interface* self) { | |||
| 112 | FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); | 112 | FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); |
| 113 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 113 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 114 | 114 | ||
| 115 | LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s file_path=%s, mode=%u attributes=%d", | 115 | LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s file_path=%s, mode=%u attributes=%u", |
| 116 | archive_id, archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, | 116 | static_cast<u32>(archive_id), archive_path.DebugStr().c_str(), |
| 117 | attributes); | 117 | file_path.DebugStr().c_str(), mode.hex, attributes); |
| 118 | 118 | ||
| 119 | ResultVal<ArchiveHandle> archive_handle = OpenArchive(archive_id, archive_path); | 119 | ResultVal<ArchiveHandle> archive_handle = OpenArchive(archive_id, archive_path); |
| 120 | if (archive_handle.Failed()) { | 120 | if (archive_handle.Failed()) { |
| 121 | LOG_ERROR(Service_FS, | 121 | LOG_ERROR(Service_FS, |
| 122 | "failed to get a handle for archive archive_id=0x%08X archive_path=%s", | 122 | "failed to get a handle for archive archive_id=0x%08X archive_path=%s", |
| 123 | archive_id, archive_path.DebugStr().c_str()); | 123 | static_cast<u32>(archive_id), archive_path.DebugStr().c_str()); |
| 124 | cmd_buff[1] = archive_handle.Code().raw; | 124 | cmd_buff[1] = archive_handle.Code().raw; |
| 125 | cmd_buff[3] = 0; | 125 | cmd_buff[3] = 0; |
| 126 | return; | 126 | return; |
| @@ -133,7 +133,7 @@ static void OpenFileDirectly(Service::Interface* self) { | |||
| 133 | cmd_buff[3] = Kernel::g_handle_table.Create(*file_res).MoveFrom(); | 133 | cmd_buff[3] = Kernel::g_handle_table.Create(*file_res).MoveFrom(); |
| 134 | } else { | 134 | } else { |
| 135 | cmd_buff[3] = 0; | 135 | cmd_buff[3] = 0; |
| 136 | LOG_ERROR(Service_FS, "failed to get a handle for file %s mode=%u attributes=%d", | 136 | LOG_ERROR(Service_FS, "failed to get a handle for file %s mode=%u attributes=%u", |
| 137 | file_path.DebugStr().c_str(), mode.hex, attributes); | 137 | file_path.DebugStr().c_str(), mode.hex, attributes); |
| 138 | } | 138 | } |
| 139 | } | 139 | } |
| @@ -159,7 +159,7 @@ static void DeleteFile(Service::Interface* self) { | |||
| 159 | 159 | ||
| 160 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 160 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 161 | 161 | ||
| 162 | LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", filename_type, filename_size, | 162 | LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(filename_type), filename_size, |
| 163 | file_path.DebugStr().c_str()); | 163 | file_path.DebugStr().c_str()); |
| 164 | 164 | ||
| 165 | cmd_buff[1] = DeleteFileFromArchive(archive_handle, file_path).raw; | 165 | cmd_buff[1] = DeleteFileFromArchive(archive_handle, file_path).raw; |
| @@ -198,9 +198,10 @@ static void RenameFile(Service::Interface* self) { | |||
| 198 | FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr); | 198 | FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr); |
| 199 | 199 | ||
| 200 | LOG_DEBUG(Service_FS, | 200 | LOG_DEBUG(Service_FS, |
| 201 | "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", | 201 | "src_type=%u src_size=%u src_data=%s dest_type=%u dest_size=%u dest_data=%s", |
| 202 | src_filename_type, src_filename_size, src_file_path.DebugStr().c_str(), | 202 | static_cast<u32>(src_filename_type), src_filename_size, |
| 203 | dest_filename_type, dest_filename_size, dest_file_path.DebugStr().c_str()); | 203 | src_file_path.DebugStr().c_str(), static_cast<u32>(dest_filename_type), |
| 204 | dest_filename_size, dest_file_path.DebugStr().c_str()); | ||
| 204 | 205 | ||
| 205 | cmd_buff[1] = RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, | 206 | cmd_buff[1] = RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, |
| 206 | dest_file_path) | 207 | dest_file_path) |
| @@ -228,13 +229,42 @@ static void DeleteDirectory(Service::Interface* self) { | |||
| 228 | 229 | ||
| 229 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); | 230 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); |
| 230 | 231 | ||
| 231 | LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, | 232 | LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size, |
| 232 | dir_path.DebugStr().c_str()); | 233 | dir_path.DebugStr().c_str()); |
| 233 | 234 | ||
| 234 | cmd_buff[1] = DeleteDirectoryFromArchive(archive_handle, dir_path).raw; | 235 | cmd_buff[1] = DeleteDirectoryFromArchive(archive_handle, dir_path).raw; |
| 235 | } | 236 | } |
| 236 | 237 | ||
| 237 | /* | 238 | /* |
| 239 | * FS_User::DeleteDirectoryRecursively service function | ||
| 240 | * Inputs: | ||
| 241 | * 0 : Command header 0x08070142 | ||
| 242 | * 1 : Transaction | ||
| 243 | * 2 : Archive handle lower word | ||
| 244 | * 3 : Archive handle upper word | ||
| 245 | * 4 : Directory path string type | ||
| 246 | * 5 : Directory path string size | ||
| 247 | * 7 : Directory path string data | ||
| 248 | * Outputs: | ||
| 249 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 250 | */ | ||
| 251 | static void DeleteDirectoryRecursively(Service::Interface* self) { | ||
| 252 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 253 | |||
| 254 | ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); | ||
| 255 | auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]); | ||
| 256 | u32 dirname_size = cmd_buff[5]; | ||
| 257 | u32 dirname_ptr = cmd_buff[7]; | ||
| 258 | |||
| 259 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); | ||
| 260 | |||
| 261 | LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size, | ||
| 262 | dir_path.DebugStr().c_str()); | ||
| 263 | |||
| 264 | cmd_buff[1] = DeleteDirectoryRecursivelyFromArchive(archive_handle, dir_path).raw; | ||
| 265 | } | ||
| 266 | |||
| 267 | /* | ||
| 238 | * FS_User::CreateFile service function | 268 | * FS_User::CreateFile service function |
| 239 | * Inputs: | 269 | * Inputs: |
| 240 | * 0 : Command header 0x08080202 | 270 | * 0 : Command header 0x08080202 |
| @@ -258,7 +288,7 @@ static void CreateFile(Service::Interface* self) { | |||
| 258 | 288 | ||
| 259 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); | 289 | FileSys::Path file_path(filename_type, filename_size, filename_ptr); |
| 260 | 290 | ||
| 261 | LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, file_size, | 291 | LOG_DEBUG(Service_FS, "type=%u size=%llu data=%s", static_cast<u32>(filename_type), file_size, |
| 262 | file_path.DebugStr().c_str()); | 292 | file_path.DebugStr().c_str()); |
| 263 | 293 | ||
| 264 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; | 294 | cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; |
| @@ -285,7 +315,7 @@ static void CreateDirectory(Service::Interface* self) { | |||
| 285 | 315 | ||
| 286 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); | 316 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); |
| 287 | 317 | ||
| 288 | LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, | 318 | LOG_DEBUG(Service_FS, "type=%u size=%d data=%s", static_cast<u32>(dirname_type), dirname_size, |
| 289 | dir_path.DebugStr().c_str()); | 319 | dir_path.DebugStr().c_str()); |
| 290 | 320 | ||
| 291 | cmd_buff[1] = CreateDirectoryFromArchive(archive_handle, dir_path).raw; | 321 | cmd_buff[1] = CreateDirectoryFromArchive(archive_handle, dir_path).raw; |
| @@ -322,10 +352,10 @@ static void RenameDirectory(Service::Interface* self) { | |||
| 322 | FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr); | 352 | FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr); |
| 323 | FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr); | 353 | FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr); |
| 324 | 354 | ||
| 325 | LOG_DEBUG(Service_FS, | 355 | LOG_DEBUG( |
| 326 | "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", | 356 | Service_FS, "src_type=%u src_size=%u src_data=%s dest_type=%u dest_size=%u dest_data=%s", |
| 327 | src_dirname_type, src_dirname_size, src_dir_path.DebugStr().c_str(), | 357 | static_cast<u32>(src_dirname_type), src_dirname_size, src_dir_path.DebugStr().c_str(), |
| 328 | dest_dirname_type, dest_dirname_size, dest_dir_path.DebugStr().c_str()); | 358 | static_cast<u32>(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr().c_str()); |
| 329 | 359 | ||
| 330 | cmd_buff[1] = RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, | 360 | cmd_buff[1] = RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, |
| 331 | dest_archive_handle, dest_dir_path) | 361 | dest_archive_handle, dest_dir_path) |
| @@ -355,7 +385,7 @@ static void OpenDirectory(Service::Interface* self) { | |||
| 355 | 385 | ||
| 356 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); | 386 | FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); |
| 357 | 387 | ||
| 358 | LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, | 388 | LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size, |
| 359 | dir_path.DebugStr().c_str()); | 389 | dir_path.DebugStr().c_str()); |
| 360 | 390 | ||
| 361 | ResultVal<SharedPtr<Directory>> dir_res = OpenDirectoryFromArchive(archive_handle, dir_path); | 391 | ResultVal<SharedPtr<Directory>> dir_res = OpenDirectoryFromArchive(archive_handle, dir_path); |
| @@ -390,7 +420,7 @@ static void OpenArchive(Service::Interface* self) { | |||
| 390 | u32 archivename_ptr = cmd_buff[5]; | 420 | u32 archivename_ptr = cmd_buff[5]; |
| 391 | FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); | 421 | FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); |
| 392 | 422 | ||
| 393 | LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s", archive_id, | 423 | LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s", static_cast<u32>(archive_id), |
| 394 | archive_path.DebugStr().c_str()); | 424 | archive_path.DebugStr().c_str()); |
| 395 | 425 | ||
| 396 | ResultVal<ArchiveHandle> handle = OpenArchive(archive_id, archive_path); | 426 | ResultVal<ArchiveHandle> handle = OpenArchive(archive_id, archive_path); |
| @@ -402,7 +432,7 @@ static void OpenArchive(Service::Interface* self) { | |||
| 402 | cmd_buff[2] = cmd_buff[3] = 0; | 432 | cmd_buff[2] = cmd_buff[3] = 0; |
| 403 | LOG_ERROR(Service_FS, | 433 | LOG_ERROR(Service_FS, |
| 404 | "failed to get a handle for archive archive_id=0x%08X archive_path=%s", | 434 | "failed to get a handle for archive archive_id=0x%08X archive_path=%s", |
| 405 | archive_id, archive_path.DebugStr().c_str()); | 435 | static_cast<u32>(archive_id), archive_path.DebugStr().c_str()); |
| 406 | } | 436 | } |
| 407 | } | 437 | } |
| 408 | 438 | ||
| @@ -485,7 +515,8 @@ static void FormatSaveData(Service::Interface* self) { | |||
| 485 | LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str()); | 515 | LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str()); |
| 486 | 516 | ||
| 487 | if (archive_id != FS::ArchiveIdCode::SaveData) { | 517 | if (archive_id != FS::ArchiveIdCode::SaveData) { |
| 488 | LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, %u", archive_id); | 518 | LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, %u", |
| 519 | static_cast<u32>(archive_id)); | ||
| 489 | cmd_buff[1] = ResultCode(ErrorDescription::FS_InvalidPath, ErrorModule::FS, | 520 | cmd_buff[1] = ResultCode(ErrorDescription::FS_InvalidPath, ErrorModule::FS, |
| 490 | ErrorSummary::InvalidArgument, ErrorLevel::Usage) | 521 | ErrorSummary::InvalidArgument, ErrorLevel::Usage) |
| 491 | .raw; | 522 | .raw; |
| @@ -868,7 +899,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 868 | {0x08040142, DeleteFile, "DeleteFile"}, | 899 | {0x08040142, DeleteFile, "DeleteFile"}, |
| 869 | {0x08050244, RenameFile, "RenameFile"}, | 900 | {0x08050244, RenameFile, "RenameFile"}, |
| 870 | {0x08060142, DeleteDirectory, "DeleteDirectory"}, | 901 | {0x08060142, DeleteDirectory, "DeleteDirectory"}, |
| 871 | {0x08070142, nullptr, "DeleteDirectoryRecursively"}, | 902 | {0x08070142, DeleteDirectoryRecursively, "DeleteDirectoryRecursively"}, |
| 872 | {0x08080202, CreateFile, "CreateFile"}, | 903 | {0x08080202, CreateFile, "CreateFile"}, |
| 873 | {0x08090182, CreateDirectory, "CreateDirectory"}, | 904 | {0x08090182, CreateDirectory, "CreateDirectory"}, |
| 874 | {0x080A0244, RenameDirectory, "RenameDirectory"}, | 905 | {0x080A0244, RenameDirectory, "RenameDirectory"}, |