mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 07:34:37 +01:00
Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast. This touches only simple value-type casts. * Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX Co-authored-by: Rubidium <rubidium@openttd.org>
This commit is contained in:
@@ -99,7 +99,7 @@ static uint16_t ParseCode(const char *start, const char *end)
|
||||
assert(start <= end);
|
||||
while (start < end && *start == ' ') start++;
|
||||
while (end > start && *end == ' ') end--;
|
||||
std::string_view str{start, (size_t)(end - start)};
|
||||
std::string_view str{start, static_cast<size_t>(end - start)};
|
||||
for (const auto &kn : _keycode_to_name) {
|
||||
if (StrEqualsIgnoreCase(str, kn.name)) {
|
||||
return kn.keycode;
|
||||
|
||||
Reference in New Issue
Block a user