From f7ad004fb0886ab1f1749f92d875a77b38cfb3f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 18 Apr 2020 19:45:12 -0400 Subject: [PATCH] kernel/shared_page: Silence missing return warning in GetInitTime() We can use UNREACHABLE_MSG to indicate that this path isn't intended to be reached, as it would indicate a wrong enum value. --- src/core/hle/kernel/shared_page.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/shared_page.cpp b/src/core/hle/kernel/shared_page.cpp index 8960551420..e65bf2491e 100644 --- a/src/core/hle/kernel/shared_page.cpp +++ b/src/core/hle/kernel/shared_page.cpp @@ -5,6 +5,7 @@ #include #include #include "common/archives.h" +#include "common/assert.h" #include "core/core.h" #include "core/core_timing.h" #include "core/hle/kernel/shared_page.h" @@ -30,8 +31,8 @@ template void load_construct_data(iarchive& ar, SharedPage::Handler* t namespace SharedPage { static std::chrono::seconds GetInitTime() { - u64 override_init_time = Core::Movie::GetInstance().GetOverrideInitTime(); - if (override_init_time) { + const u64 override_init_time = Core::Movie::GetInstance().GetOverrideInitTime(); + if (override_init_time != 0) { // Override the clock init time with the one in the movie return std::chrono::seconds(override_init_time); } @@ -48,6 +49,9 @@ static std::chrono::seconds GetInitTime() { } case Settings::InitClock::FixedTime: return std::chrono::seconds(Settings::values.init_time); + default: + UNREACHABLE_MSG("Invalid InitClock value ({})", + static_cast(Settings::values.init_clock)); } }