mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-28 14:44:28 +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:
@@ -258,8 +258,8 @@ size_t Packet::Size() const
|
||||
*/
|
||||
bool Packet::ParsePacketSize()
|
||||
{
|
||||
size_t size = (size_t)this->buffer[0];
|
||||
size += (size_t)this->buffer[1] << 8;
|
||||
size_t size = static_cast<size_t>(this->buffer[0]);
|
||||
size += static_cast<size_t>(this->buffer[1]) << 8;
|
||||
|
||||
/* If the size of the packet is less than the bytes required for the size and type of
|
||||
* the packet, or more than the allowed limit, then something is wrong with the packet.
|
||||
|
||||
Reference in New Issue
Block a user