mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-22 19:54:06 +01:00
Codechange: Replace atoi and atoll with ParseInteger.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "../strings_func.h"
|
||||
#include "../timer/timer.h"
|
||||
#include "../timer/timer_window.h"
|
||||
#include "../core/string_consumer.hpp"
|
||||
|
||||
#include "script_gui.h"
|
||||
#include "script_log.hpp"
|
||||
@@ -495,10 +496,10 @@ struct ScriptSettingsWindow : public Window {
|
||||
|
||||
void OnQueryTextFinished(std::optional<std::string> str) override
|
||||
{
|
||||
if (!str.has_value() || str->empty()) return;
|
||||
int32_t value = atoi(str->c_str());
|
||||
|
||||
SetValue(value);
|
||||
if (!str.has_value()) return;
|
||||
auto value = ParseInteger<int32_t>(*str);
|
||||
if (!value.has_value()) return;
|
||||
SetValue(*value);
|
||||
}
|
||||
|
||||
void OnDropdownSelect(WidgetID widget, int index) override
|
||||
|
||||
Reference in New Issue
Block a user