diff options
author | LC <mathew1800@gmail.com> | 2020-10-21 01:19:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 01:19:12 +0200 |
commit | 88d5140cf2f80d51dc297af3a128a4212215149f (patch) | |
tree | cd524e8ab111fba79f75a48cc672cb875251a32f /src/core/hle/service/acc | |
parent | Merge pull request #4390 from ogniK5377/get-applet-inf-stub (diff) | |
parent | core: Fix clang build (diff) | |
download | yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.gz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.bz2 yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.lz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.xz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.zst yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.zip |
Diffstat (limited to 'src/core/hle/service/acc')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 9b829e957..9c302043a 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -41,12 +41,15 @@ constexpr char ACC_SAVE_AVATORS_BASE_PATH[] = "/system/save/8000000000000010/su/ ProfileManager::ProfileManager() { ParseUserSaveFile(); - if (user_count == 0) + if (user_count == 0) { CreateNewUser(UUID::Generate(), "yuzu"); + } - auto current = std::clamp<int>(Settings::values.current_user, 0, MAX_USERS - 1); - if (UserExistsIndex(current)) + auto current = static_cast<size_t>( + std::clamp(Settings::values.current_user, 0, static_cast<s32>(MAX_USERS - 1))); + if (UserExistsIndex(current)) { current = 0; + } OpenUser(*GetUser(current)); } @@ -189,8 +192,8 @@ std::size_t ProfileManager::GetUserCount() const { /// booting std::size_t ProfileManager::GetOpenUserCount() const { - return std::count_if(profiles.begin(), profiles.end(), - [](const ProfileInfo& p) { return p.is_open; }); + return static_cast<std::size_t>(std::count_if(profiles.begin(), profiles.end(), + [](const ProfileInfo& p) { return p.is_open; })); } /// Checks if a user id exists in our profile manager |