summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-12 08:10:22 +0000
committerrubidium <rubidium@openttd.org>2011-11-12 08:10:22 +0000
commitbd64bf6372399bad1a92565ae7d3c243658d241f (patch)
tree7af646337e5ddafe68f0d701711c41ef89d21491 /src/network
parenta8d33a4d89f11c45b9690481b08df3c800292005 (diff)
downloadopenttd-bd64bf6372399bad1a92565ae7d3c243658d241f.tar.xz
(svn r23193) -Codechange: don't cast away const unneededly
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/address.cpp4
-rw-r--r--src/network/core/udp.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index 371f53403..3b3c9f4aa 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -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();
diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp
index 482f67d93..4a0029eed 100644
--- a/src/network/core/udp.cpp
+++ b/src/network/core/udp.cpp
@@ -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 */