mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-10 06:52:05 +01:00
Codefix: Use of nullptr instead of std::nullopt. (#14590)
This commit is contained in:
@@ -407,7 +407,7 @@ std::optional<std::string> GetCurrentLocale(const char *)
|
||||
if (GetLocaleInfoA(userUiLocale, LOCALE_SISO639LANGNAME, lang, static_cast<int>(std::size(lang))) == 0 ||
|
||||
GetLocaleInfoA(userUiLocale, LOCALE_SISO3166CTRYNAME, country, static_cast<int>(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});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user