1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

(svn r23193) -Codechange: don't cast away const unneededly

This commit is contained in:
rubidium
2011-11-12 08:10:22 +00:00
parent a8d33a4d89
commit bd64bf6372
6 changed files with 29 additions and 29 deletions

View File

@@ -39,10 +39,10 @@ uint16 NetworkAddress::GetPort() const
switch (this->address.ss_family) {
case AF_UNSPEC:
case AF_INET:
return ntohs(((struct sockaddr_in *)&this->address)->sin_port);
return ntohs(((const struct sockaddr_in *)&this->address)->sin_port);
case AF_INET6:
return ntohs(((struct sockaddr_in6 *)&this->address)->sin6_port);
return ntohs(((const struct sockaddr_in6 *)&this->address)->sin6_port);
default:
NOT_REACHED();

View File

@@ -101,7 +101,7 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a
#endif
/* Send the buffer */
int res = sendto(s->second, (const char*)p->buffer, p->size, 0, (struct sockaddr *)send.GetAddress(), send.GetAddressLength());
int res = sendto(s->second, (const char*)p->buffer, p->size, 0, (const struct sockaddr *)send.GetAddress(), send.GetAddressLength());
DEBUG(net, 7, "[udp] sendto(%s)", send.GetAddressAsString());
/* Check for any errors, but ignore it otherwise */