diff --git a/libraries/libstratosphere/source/os/impl/os_inter_process_event.cpp b/libraries/libstratosphere/source/os/impl/os_inter_process_event.cpp index ae3e9863b..4db3e0b57 100644 --- a/libraries/libstratosphere/source/os/impl/os_inter_process_event.cpp +++ b/libraries/libstratosphere/source/os/impl/os_inter_process_event.cpp @@ -118,7 +118,7 @@ namespace ams::os::impl { while (true) { /* Continuously wait, until success. */ - R_TRY_CATCH(svcWaitSynchronizationSingle(handle, U64_MAX)) { + R_TRY_CATCH(svcWaitSynchronizationSingle(handle, std::numeric_limits::max())) { R_CATCH(svc::ResultCancelled) { continue; } } R_END_TRY_CATCH_WITH_ABORT_UNLESS; diff --git a/libraries/libstratosphere/source/os/impl/os_waitable_holder_base.hpp b/libraries/libstratosphere/source/os/impl/os_waitable_holder_base.hpp index 441ac04b5..d64fc1b12 100644 --- a/libraries/libstratosphere/source/os/impl/os_waitable_holder_base.hpp +++ b/libraries/libstratosphere/source/os/impl/os_waitable_holder_base.hpp @@ -38,7 +38,7 @@ namespace ams::os::impl { virtual Handle GetHandle() const = 0; /* Gets the amount of time remaining until this wakes up. */ virtual u64 GetWakeupTime() const { - return U64_MAX; + return std::numeric_limits::max(); } /* Interface with manager. */ diff --git a/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp b/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp index 2f66b7c0e..73691df56 100644 --- a/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp +++ b/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp @@ -51,7 +51,7 @@ namespace ams::os::impl{ WaitableHolderBase *objects[MaximumHandleCount]; const size_t count = this->BuildHandleArray(object_handles, objects); - const u64 end_time = infinite ? U64_MAX : armTicksToNs(armGetSystemTick()); + const u64 end_time = infinite ? std::numeric_limits::max() : armTicksToNs(armGetSystemTick()); while (true) { this->current_time = armTicksToNs(armGetSystemTick()); diff --git a/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp b/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp index be2fc7027..0c068dd4c 100644 --- a/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp +++ b/libraries/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp @@ -44,7 +44,7 @@ namespace ams::os::impl { public: /* Wait. */ WaitableHolderBase *WaitAny() { - return this->WaitAnyImpl(true, U64_MAX); + return this->WaitAnyImpl(true, std::numeric_limits::max()); } WaitableHolderBase *TryWaitAny() { diff --git a/libraries/libstratosphere/source/os/os_interrupt_event.cpp b/libraries/libstratosphere/source/os/os_interrupt_event.cpp index e700107c6..87e4f77f0 100644 --- a/libraries/libstratosphere/source/os/os_interrupt_event.cpp +++ b/libraries/libstratosphere/source/os/os_interrupt_event.cpp @@ -49,7 +49,7 @@ namespace ams::os { while (true) { /* Continuously wait, until success. */ - R_TRY_CATCH(svcWaitSynchronizationSingle(this->handle.Get(), U64_MAX)) { + R_TRY_CATCH(svcWaitSynchronizationSingle(this->handle.Get(), std::numeric_limits::max())) { R_CATCH(svc::ResultCancelled) { continue; } } R_END_TRY_CATCH_WITH_ABORT_UNLESS; diff --git a/libraries/libstratosphere/source/sf/hipc/sf_hipc_api.cpp b/libraries/libstratosphere/source/sf/hipc/sf_hipc_api.cpp index 4b109f96f..3f6658a6c 100644 --- a/libraries/libstratosphere/source/sf/hipc/sf_hipc_api.cpp +++ b/libraries/libstratosphere/source/sf/hipc/sf_hipc_api.cpp @@ -23,9 +23,9 @@ namespace ams::sf::hipc { s32 unused_index; if (message_buf == armGetTls()) { /* Consider: AMS_ABORT_UNLESS(message_buf_size == TlsMessageBufferSize); */ - return svcReplyAndReceive(&unused_index, &session_handle, 1, INVALID_HANDLE, U64_MAX); + return svcReplyAndReceive(&unused_index, &session_handle, 1, INVALID_HANDLE, std::numeric_limits::max()); } else { - return svcReplyAndReceiveWithUserBuffer(&unused_index, message_buf, message_buf_size, &session_handle, 1, INVALID_HANDLE, U64_MAX); + return svcReplyAndReceiveWithUserBuffer(&unused_index, message_buf, message_buf_size, &session_handle, 1, INVALID_HANDLE, std::numeric_limits::max()); } } diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp index ccd463fc7..43bd4cd8f 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp @@ -522,7 +522,7 @@ namespace ams::dmnt::cheat::impl { Event hook; while (true) { eventLoadRemote(&hook, this_ptr->HookToCreateApplicationProcess(), true); - if (R_SUCCEEDED(eventWait(&hook, U64_MAX))) { + if (R_SUCCEEDED(eventWait(&hook, std::numeric_limits::max()))) { this_ptr->AttachToApplicationProcess(true); } eventClose(&hook); @@ -535,7 +535,7 @@ namespace ams::dmnt::cheat::impl { /* Atomically wait (and clear) signal for new process. */ this_ptr->debug_events_event.Wait(); while (true) { - while (R_SUCCEEDED(svcWaitSynchronizationSingle(this_ptr->GetCheatProcessHandle(), U64_MAX))) { + while (R_SUCCEEDED(svcWaitSynchronizationSingle(this_ptr->GetCheatProcessHandle(), std::numeric_limits::max()))) { std::scoped_lock lk(this_ptr->cheat_lock); /* Handle any pending debug events. */ diff --git a/stratosphere/fatal/source/fatal_config.cpp b/stratosphere/fatal/source/fatal_config.cpp index 85c251213..0ee0edef9 100644 --- a/stratosphere/fatal/source/fatal_config.cpp +++ b/stratosphere/fatal/source/fatal_config.cpp @@ -25,7 +25,7 @@ namespace ams::fatal::srv { /* Event creator. */ Handle GetFatalDirtyEventReadableHandle() { Event evt; - R_ABORT_UNLESS(setsysBindFatalDirtyFlagEvent(&evt)); + R_ABORT_UNLESS(setsysAcquireFatalDirtyFlagEventHandle(&evt)); return evt.revent; } diff --git a/stratosphere/fatal/source/fatal_task_screen.cpp b/stratosphere/fatal/source/fatal_task_screen.cpp index 5b94b9e2a..9d6262ca3 100644 --- a/stratosphere/fatal/source/fatal_task_screen.cpp +++ b/stratosphere/fatal/source/fatal_task_screen.cpp @@ -418,7 +418,7 @@ namespace ams::fatal::srv { Result ShowFatalTask::Run() { /* Don't show the fatal error screen until we've verified the battery is okay. */ - eventWait(const_cast(&this->context->battery_event), U64_MAX); + eventWait(const_cast(&this->context->battery_event), std::numeric_limits::max()); return ShowFatal(); }