mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +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:
@@ -69,7 +69,7 @@ inline bool StrEmpty(const char *s)
|
||||
inline size_t ttd_strnlen(const char *str, size_t maxlen)
|
||||
{
|
||||
const char *t;
|
||||
for (t = str; (size_t)(t - str) < maxlen && *t != '\0'; t++) {}
|
||||
for (t = str; static_cast<size_t>(t - str) < maxlen && *t != '\0'; t++) {}
|
||||
return t - str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user