Fix narrowing warnings on MSVC

pull/621/head
Jonathan G Rennison 5 months ago
parent b23077b08c
commit a33544ee17

@ -223,7 +223,7 @@ void SerializeNetworkGameInfo(Packet *p, const NetworkServerGameInfo *info, bool
for (c = info->grfconfig; c != nullptr; c = c->next) {
if (!HasBit(c->flags, GCF_STATIC)) count++;
}
p->Send_uint8(std::min<uint>(count, NETWORK_MAX_GRF_COUNT)); // Send number of GRFs
p->Send_uint8(ClampTo<uint8>(std::min<uint>(count, NETWORK_MAX_GRF_COUNT))); // Send number of GRFs
/* Send actual GRF Identifications */
for (c = info->grfconfig; c != nullptr; c = c->next) {

@ -603,7 +603,7 @@ struct NewGRFInspectWindow : Window {
if (iter != lines.end() && iter->first == (int)highlight_tag) {
/* Already stored, don't insert again */
} else {
lines.insert(iter, std::make_pair<int, uint16>(highlight_tag, std::min<uint>(UINT16_MAX, i)));
lines.insert(iter, std::make_pair<int, uint16>(highlight_tag, ClampTo<uint16>(i)));
}
}

Loading…
Cancel
Save