Fix some type conversion warnings
This commit is contained in:
@@ -254,8 +254,8 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo
|
||||
|
||||
while (cv->size() > offset) {
|
||||
Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID, TCP_MTU);
|
||||
const uint to_send = (uint)std::min<uint>(cv->size() - offset, max_per_packet);
|
||||
p->Send_uint8(to_send);
|
||||
const uint to_send = std::min<uint>(static_cast<uint>(cv->size() - offset), max_per_packet);
|
||||
p->Send_uint8(static_cast<uint8>(to_send));
|
||||
|
||||
for (uint i = 0; i < to_send; i++) {
|
||||
const ContentInfo *ci = (*cv)[offset + i];
|
||||
|
@@ -474,7 +474,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendDesyncLog(const std::strin
|
||||
for (size_t offset = 0; offset < log.size();) {
|
||||
Packet *p = new Packet(PACKET_SERVER_DESYNC_LOG, SHRT_MAX);
|
||||
size_t size = std::min<size_t>(log.size() - offset, SHRT_MAX - 2 - p->Size());
|
||||
p->Send_uint16(size);
|
||||
p->Send_uint16(static_cast<uint16>(size));
|
||||
p->Send_binary(log.data() + offset, size);
|
||||
this->SendPacket(p);
|
||||
|
||||
|
@@ -329,7 +329,7 @@ void ServerNetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(Packet *p, Networ
|
||||
if (in_reply.empty()) return;
|
||||
|
||||
Packet packet(PACKET_UDP_SERVER_NEWGRFS);
|
||||
packet.Send_uint8(in_reply.size());
|
||||
packet.Send_uint8(static_cast<uint8>(in_reply.size()));
|
||||
for (const GRFInfo &info : in_reply) {
|
||||
char name[NETWORK_GRF_NAME_LENGTH];
|
||||
|
||||
|
Reference in New Issue
Block a user