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:
+1
-1
@@ -117,7 +117,7 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound)
|
||||
assert(sound != nullptr);
|
||||
|
||||
/* Check for valid sound size. */
|
||||
if (sound->file_size == 0 || sound->file_size > ((size_t)-1) - 2) return false;
|
||||
if (sound->file_size == 0 || sound->file_size > SIZE_MAX - 2) return false;
|
||||
|
||||
int8_t *mem = MallocT<int8_t>(sound->file_size + 2);
|
||||
/* Add two extra bytes so rate conversion can read these
|
||||
|
||||
Reference in New Issue
Block a user