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:
@@ -133,7 +133,7 @@ void NetworkUDPSocketHandler::ReceivePackets()
|
||||
|
||||
/* If the size does not match the packet must be corrupted.
|
||||
* Otherwise it will be marked as corrupted later on. */
|
||||
if (!p.ParsePacketSize() || (size_t)nbytes != p.Size()) {
|
||||
if (!p.ParsePacketSize() || static_cast<size_t>(nbytes) != p.Size()) {
|
||||
Debug(net, 1, "Received a packet with mismatching size from {}", address.GetAddressAsString());
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user