hos::Version: rename enum members

This commit is contained in:
Michael Scire 2020-04-13 22:19:44 -07:00
parent 79b9e07ee9
commit 6719abec65
78 changed files with 304 additions and 302 deletions

View file

@ -101,12 +101,12 @@ namespace ams::ncm {
/* Deprecated API. */
Result CloseContentStorageForcibly(StorageId storage_id) {
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_100);
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_1_0_0);
return g_content_manager->CloseContentStorageForcibly(storage_id);
}
Result CloseContentMetaDatabaseForcibly(StorageId storage_id) {
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_100);
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_1_0_0);
return g_content_manager->CloseContentMetaDatabaseForcibly(storage_id);
}
}

View file

@ -113,11 +113,11 @@ namespace ams::ncm {
ALWAYS_INLINE bool IsSignedSystemPartitionOnSdCardValid(const char *bis_mount_name) {
/* Signed system partition should never be checked on < 4.0.0, as it did not exist before then. */
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_400);
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_4_0_0);
/* If we're importing from system on SD, make sure that the signed system partition is valid. */
const auto version = hos::GetVersion();
if (version >= hos::Version_800) {
if (version >= hos::Version_8_0_0) {
/* On >= 8.0.0, a simpler method was added to check validity. */
/* This also works on < 4.0.0 (though the system partition will never be on-sd there), */
/* and so this will always return false. */
@ -156,7 +156,7 @@ namespace ams::ncm {
R_CATCH(fs::ResultTargetNotFound) {
/* On 1.0.0, not all flags existed. Mask when appropriate. */
constexpr u32 SaveDataFlags100Mask = fs::SaveDataFlags_KeepAfterResettingSystemSaveData;
const u32 flags = (hos::GetVersion() >= hos::Version_200) ? (info.flags) : (info.flags & SaveDataFlags100Mask);
const u32 flags = (hos::GetVersion() >= hos::Version_2_0_0) ? (info.flags) : (info.flags & SaveDataFlags100Mask);
R_TRY(fs::CreateSystemSaveData(info.space_id, info.id, OwnerId, info.size, info.journal_size, flags));
R_TRY(fs::MountSystemSaveData(mount_name, info.space_id, info.id));
}
@ -275,7 +275,7 @@ namespace ams::ncm {
}
Result ContentManagerImpl::BuildContentMetaDatabase(StorageId storage_id) {
if (hos::GetVersion() <= hos::Version_400) {
if (hos::GetVersion() <= hos::Version_4_0_0) {
/* Temporarily activate the database. */
R_TRY(this->ActivateContentMetaDatabase(storage_id));
ON_SCOPE_EXIT { this->InactivateContentMetaDatabase(storage_id); };
@ -357,7 +357,7 @@ namespace ams::ncm {
/* Ensure correct flags on the BuiltInSystem save data. */
/* NOTE: Nintendo does not check this succeeds, and it does on older system versions. */
/* We will not check the error, either, even though this kind of defeats the call's purpose. */
if (hos::GetVersion() >= hos::Version_200) {
if (hos::GetVersion() >= hos::Version_2_0_0) {
EnsureBuiltInSystemSaveDataFlags();
}
@ -472,7 +472,7 @@ namespace ams::ncm {
ContentStorageRoot *root;
R_TRY(this->GetContentStorageRoot(std::addressof(root), storage_id));
if (hos::GetVersion() >= hos::Version_200) {
if (hos::GetVersion() >= hos::Version_2_0_0) {
/* Obtain the content storage if already active. */
R_UNLESS(root->content_storage, GetContentStorageNotActiveResult(storage_id));
} else {
@ -493,7 +493,7 @@ namespace ams::ncm {
ContentMetaDatabaseRoot *root;
R_TRY(this->GetContentMetaDatabaseRoot(&root, storage_id));
if (hos::GetVersion() >= hos::Version_200) {
if (hos::GetVersion() >= hos::Version_2_0_0) {
/* Obtain the content meta database if already active. */
R_UNLESS(root->content_meta_database, GetContentMetaDatabaseNotActiveResult(storage_id));
} else {

View file

@ -425,7 +425,7 @@ namespace ams::ncm {
break;
case ContentMetaType::Application:
/* As of 9.0.0, applications can be dependent on a specific base application version. */
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_900);
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_9_0_0);
required_version = reader.GetExtendedHeader<ApplicationMetaExtendedHeader>()->required_application_version;
break;
AMS_UNREACHABLE_DEFAULT_CASE();

View file

@ -58,7 +58,7 @@ namespace ams::ncm {
R_SUCCEED_IF(max_level <= 0);
/* On 1.0.0, NotRequireFileSize was not a valid open mode. */
const auto open_dir_mode = hos::GetVersion() >= hos::Version_200 ? (fs::OpenDirectoryMode_All | fs::OpenDirectoryMode_NotRequireFileSize) : (fs::OpenDirectoryMode_All);
const auto open_dir_mode = hos::GetVersion() >= hos::Version_2_0_0 ? (fs::OpenDirectoryMode_All | fs::OpenDirectoryMode_NotRequireFileSize) : (fs::OpenDirectoryMode_All);
/* Retry traversal upon request. */
bool retry_dir_read = true;
@ -153,7 +153,7 @@ namespace ams::ncm {
}
Result CleanDirectoryRecursively(const PathString &path) {
if (hos::GetVersion() >= hos::Version_300) {
if (hos::GetVersion() >= hos::Version_3_0_0) {
R_TRY(fs::CleanDirectoryRecursively(path));
} else {
/* CleanDirectoryRecursively didn't exist on < 3.0.0, so we will polyfill it. */

View file

@ -35,7 +35,7 @@ namespace ams::ncm {
}
static Result GetRightsId(ncm::RightsId *out_rights_id, const Path &path) {
if (hos::GetVersion() >= hos::Version_300) {
if (hos::GetVersion() >= hos::Version_3_0_0) {
R_TRY(fs::GetRightsId(std::addressof(out_rights_id->id), std::addressof(out_rights_id->key_generation), path.str));
} else {
R_TRY(fs::GetRightsId(std::addressof(out_rights_id->id), path.str));