diff --git a/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp b/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp index 1f9e05ddc..87649c95c 100644 --- a/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp +++ b/stratosphere/ncm/source/impl/ncm_placeholder_accessor.cpp @@ -173,7 +173,7 @@ namespace ams::ncm::impl { /* Set the scope for the scoped_lock. */ { std::scoped_lock lock(this->cache_mutex); - + /* If the placeholder id is invalid, return success early. */ R_UNLESS(placeholder_id != InvalidPlaceHolderId, ResultSuccess()); @@ -187,7 +187,7 @@ namespace ams::ncm::impl { } this->StoreToCache(f, placeholder_id); - + R_UNLESS(fseek(f, 0L, SEEK_END) == 0, fsdevGetLastResult()); size_t size = ftell(f); R_UNLESS(fseek(f, 0L, SEEK_SET) == 0, fsdevGetLastResult()); diff --git a/stratosphere/ncm/source/ncm_fs.cpp b/stratosphere/ncm/source/ncm_fs.cpp index c92994043..df71bea82 100644 --- a/stratosphere/ncm/source/ncm_fs.cpp +++ b/stratosphere/ncm/source/ncm_fs.cpp @@ -36,7 +36,7 @@ namespace ams::ncm::fs { fopen_mode = "r+b"; } else if (mode & FsOpenMode_Read) { fopen_mode = "rb"; - } + } FILE *f = fopen(path, fopen_mode); R_UNLESS(f != nullptr, fsdevGetLastResult()); @@ -78,7 +78,7 @@ namespace ams::ncm::fs { } } R_END_TRY_CATCH; } - + return ResultSuccess(); } @@ -94,7 +94,7 @@ namespace ams::ncm::fs { } } R_END_TRY_CATCH; } - + return ResultSuccess(); } @@ -105,7 +105,7 @@ namespace ams::ncm::fs { bool has_root = false; R_TRY(HasDirectory(&has_root, root_path)); R_UNLESS(has_root, ncm::ResultContentStorageBaseNotFound()); - + path::GetContentRootPath(content_root, root_path); bool has_content_root = false; R_TRY(HasDirectory(&has_content_root, content_root)); @@ -213,7 +213,7 @@ namespace ams::ncm::fs { Result MountSystemSaveData(const char *mount_point, FsSaveDataSpaceId space_id, u64 save_id) { R_UNLESS(mount_point, ams::fs::ResultNullptrArgument()); - + FsSaveDataAttribute save = { .system_save_data_id = save_id, .save_data_type = FsSaveDataType_System, @@ -247,7 +247,7 @@ namespace ams::ncm::fs { case FsContentStorageId_System: g_mount_content_storage[mount_point] = SystemContentMountName; break; - + case FsContentStorageId_User: g_mount_content_storage[mount_point] = UserContentMountName; break; @@ -264,7 +264,7 @@ namespace ams::ncm::fs { Result MountGameCardPartition(const char *mount_point, const FsGameCardHandle handle, FsGameCardPartition partition) { AMS_ABORT_UNLESS(partition <= 2); - + FsFileSystem fs; R_TRY(fsOpenGameCardFileSystem(&fs, &handle, partition)); AMS_ABORT_UNLESS(fsdevMountDevice(mount_point, fs) != -1); @@ -302,7 +302,7 @@ namespace ams::ncm::fs { Result GetSaveDataFlags(u32 *out_flags, u64 save_id) { FsSaveDataExtraData extra_data; - + R_TRY(fsReadSaveDataFileSystemExtraData(&extra_data, sizeof(FsSaveDataExtraData), save_id)); *out_flags = extra_data.flags; return ResultSuccess(); @@ -310,7 +310,7 @@ namespace ams::ncm::fs { Result SetSaveDataFlags(u64 save_id, FsSaveDataSpaceId space_id, u32 flags) { FsSaveDataExtraData extra_data; - + R_TRY(fsReadSaveDataFileSystemExtraData(&extra_data, sizeof(FsSaveDataExtraData), save_id)); extra_data.flags = flags; R_TRY(fsWriteSaveDataFileSystemExtraData(&extra_data, sizeof(FsSaveDataExtraData), space_id, save_id)); diff --git a/stratosphere/ncm/source/ncm_fs.hpp b/stratosphere/ncm/source/ncm_fs.hpp index 7b0611f8d..6a7797c5b 100644 --- a/stratosphere/ncm/source/ncm_fs.hpp +++ b/stratosphere/ncm/source/ncm_fs.hpp @@ -55,7 +55,7 @@ namespace ams::ncm::fs { DIR *dir; struct dirent *dir_entry = nullptr; R_UNLESS(max_level >= 1, ResultSuccess()); - + bool retry_dir_read = true; while (retry_dir_read) { retry_dir_read = false; @@ -70,7 +70,7 @@ namespace ams::ncm::fs { char current_path[FS_MAX_PATH]; AMS_ABORT_UNLESS(snprintf(current_path, FS_MAX_PATH-1, "%s/%s", root_path, dir_entry->d_name) >= 0); - + bool should_continue = true; bool should_retry_dir_read = false; R_TRY(f(&should_continue, &should_retry_dir_read, current_path, dir_entry)); diff --git a/stratosphere/ncm/source/ncm_path_utils.hpp b/stratosphere/ncm/source/ncm_path_utils.hpp index 560d560f4..1e1a8669c 100644 --- a/stratosphere/ncm/source/ncm_path_utils.hpp +++ b/stratosphere/ncm/source/ncm_path_utils.hpp @@ -37,7 +37,7 @@ namespace ams::ncm::path { class PathView { private: - std::string_view path; /* Nintendo uses nn::util::string_view here. */ + std::string_view path; /* Nintendo uses nn::util::string_view here. */ public: PathView(std::string_view p) : path(p) { /* ...*/ } bool HasPrefix(std::string_view prefix) const; diff --git a/stratosphere/ncm/source/ncm_utils.cpp b/stratosphere/ncm/source/ncm_utils.cpp index 22c1b200c..89d383fe5 100644 --- a/stratosphere/ncm/source/ncm_utils.cpp +++ b/stratosphere/ncm/source/ncm_utils.cpp @@ -40,8 +40,8 @@ namespace ams::ncm { u64 converted_val; for (size_t i = 0; i < sizeof(PlaceHolderId); i++) { - char *name_char_pair = dir_entry->d_name + i * 2; - + char *name_char_pair = dir_entry->d_name + i * 2; + byte_string[0] = name_char_pair[0]; byte_string[1] = name_char_pair[1]; @@ -66,8 +66,8 @@ namespace ams::ncm { u64 converted_val; for (size_t i = 0; i < sizeof(ContentId); i++) { - const char *char_par = str + i * 2; - + const char *char_par = str + i * 2; + byte_string[0] = char_par[0]; byte_string[1] = char_par[1]; diff --git a/stratosphere/ncm/source/ncm_utils.hpp b/stratosphere/ncm/source/ncm_utils.hpp index b3b52a017..2c18a6e93 100644 --- a/stratosphere/ncm/source/ncm_utils.hpp +++ b/stratosphere/ncm/source/ncm_utils.hpp @@ -26,5 +26,5 @@ namespace ams::ncm { Result GetPlaceHolderIdFromDirEntry(PlaceHolderId *out, struct dirent *dir_entry); std::optional GetContentIdFromString(const char *str, size_t len); - + };