summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-04-04 03:45:02 +0000
committerglx <glx@openttd.org>2009-04-04 03:45:02 +0000
commit5eed35ef542938a7ec493573ed955390e44c14e9 (patch)
tree49acce54322686a9fdb7ddf127fc17058aa44941 /src/network
parenta779611665dc04d1255b0ea5cfd5af3803f95d25 (diff)
downloadopenttd-5eed35ef542938a7ec493573ed955390e44c14e9.tar.xz
(svn r15950) -Fix (r15946): mingw compilation
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/address.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index a8ba5c076..56c49a83f 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -120,13 +120,13 @@ bool NetworkAddress::IsInNetmask(char *netmask)
uint32 *mask;
switch (this->address.ss_family) {
case AF_INET:
- ip = &((struct sockaddr_in*)&this->address)->sin_addr.s_addr;
- mask = &((struct sockaddr_in*)&mask_address.address)->sin_addr.s_addr;
+ ip = (uint32*)&((struct sockaddr_in*)&this->address)->sin_addr.s_addr;
+ mask = (uint32*)&((struct sockaddr_in*)&mask_address.address)->sin_addr.s_addr;
break;
case AF_INET6:
- ip = ((struct sockaddr_in6*)&this->address)->sin6_addr.s6_addr32;
- mask = ((struct sockaddr_in6*)&mask_address.address)->sin6_addr.s6_addr32;
+ ip = (uint32*)((struct sockaddr_in6*)&this->address)->sin6_addr.s6_addr32;
+ mask = (uint32*)((struct sockaddr_in6*)&mask_address.address)->sin6_addr.s6_addr32;
break;
default:
@@ -134,7 +134,7 @@ bool NetworkAddress::IsInNetmask(char *netmask)
}
while (cidr > 0) {
- uint32 msk = cidr >= 32 ? -1 : htonl(-(1 << (32 - cidr)));
+ uint32 msk = cidr >= 32 ? (uint32)-1 : htonl(-(1 << (32 - cidr)));
if ((*mask & msk) != (*ip & msk)) return false;
cidr -= 32;