mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 18:32:35 +01:00
Codechange: Replace atoi and atoll with ParseInteger.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "timer/timer.h"
|
||||
#include "timer/timer_window.h"
|
||||
#include "zoom_func.h"
|
||||
#include "core/string_consumer.hpp"
|
||||
|
||||
#include "widgets/newgrf_widget.h"
|
||||
#include "widgets/misc_widget.h"
|
||||
@@ -438,9 +439,10 @@ struct NewGRFParametersWindow : public Window {
|
||||
void OnQueryTextFinished(std::optional<std::string> str) override
|
||||
{
|
||||
if (!str.has_value() || str->empty()) return;
|
||||
int32_t value = atoi(str->c_str());
|
||||
auto value = ParseInteger<int32_t>(*str);
|
||||
if (!value.has_value()) return;
|
||||
GRFParameterInfo &par_info = this->GetParameterInfo(this->clicked_row);
|
||||
this->grf_config.SetValue(par_info, value);
|
||||
this->grf_config.SetValue(par_info, *value);
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user