From a2f3d59707d8794fedf3a7c55499a67535ff400b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 5 Sep 2025 14:05:02 +0100 Subject: [PATCH] Codefix: Use of nullptr instead of std::nullopt. (#14590) --- src/os/windows/win32.cpp | 2 +- src/video/cocoa/cocoa_wnd.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index ba4e2aa539..2e005d2e9b 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -407,7 +407,7 @@ std::optional GetCurrentLocale(const char *) if (GetLocaleInfoA(userUiLocale, LOCALE_SISO639LANGNAME, lang, static_cast(std::size(lang))) == 0 || GetLocaleInfoA(userUiLocale, LOCALE_SISO3166CTRYNAME, country, static_cast(std::size(country))) == 0) { /* Unable to retrieve the locale. */ - return nullptr; + return std::nullopt; } /* Format it as 'en_us'. */ return fmt::format("{}_{}", std::string_view{lang, 2}, std::string_view{country, 2}); diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm index 99e3dc3f3b..43f8ee266b 100644 --- a/src/video/cocoa/cocoa_wnd.mm +++ b/src/video/cocoa/cocoa_wnd.mm @@ -401,7 +401,7 @@ void CocoaDialog(std::string_view title, std::string_view message, std::string_v bool wasstarted = _cocoa_video_started; if (VideoDriver::GetInstance() == nullptr) { CocoaSetupApplication(); // Setup application before showing dialog - } else if (!_cocoa_video_started && VideoDriver::GetInstance()->Start({}) != nullptr) { + } else if (!_cocoa_video_started && VideoDriver::GetInstance()->Start({}).has_value()) { fmt::print(stderr, "{}: {}\n", title, message); return; }