1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 18:02:37 +01:00

Codechange: Replace strtol, strtoll, stroul and strtoull with ParseInteger.

This commit is contained in:
frosch
2025-04-29 17:00:55 +02:00
committed by frosch
parent cdafc50c94
commit 98481ecc01
8 changed files with 52 additions and 16 deletions

View File

@@ -609,9 +609,11 @@ struct NewGRFInspectWindow : Window {
void OnQueryTextFinished(std::optional<std::string> str) override
{
if (!str.has_value() || str->empty()) return;
if (!str.has_value()) return;
NewGRFInspectWindow::var60params[GetFeatureNum(this->window_number)][this->current_edit_param - 0x60] = std::strtol(str->c_str(), nullptr, 16);
auto val = ParseInteger<int32_t>(*str);
if (!val.has_value()) return;
NewGRFInspectWindow::var60params[GetFeatureNum(this->window_number)][this->current_edit_param - 0x60] = *val;
this->SetDirty();
}