summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-04-03 12:48:11 +0000
committerglx <glx@openttd.org>2009-04-03 12:48:11 +0000
commitd84fb358f5e8628bc9dc89edf9494248e6fe0a97 (patch)
tree6386ed8078c4f72028922298868f2ca555e36bf3 /src/network/core
parentab06ed241f4c1a91c0888ced2249fb42e2174ebc (diff)
downloadopenttd-d84fb358f5e8628bc9dc89edf9494248e6fe0a97.tar.xz
(svn r15930) -Fix (r15926): MSVC compilation
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/host.cpp4
-rw-r--r--src/network/core/host.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index e85bb3b3e..5db3b2e79 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -79,7 +79,7 @@ static int NetworkFindBroadcastIPsInternal(NetworkAddress *broadcast, int limit)
if (ip != INADDR_LOOPBACK && ip != INADDR_ANY) {
sockaddr_storage address;
memset(&address, 0, sizeof(address));
- ((sockaddr_in*)&storage)->sin_addr.s_addr = htonl(ip | ~netmask);
+ ((sockaddr_in*)&address)->sin_addr.s_addr = htonl(ip | ~netmask);
broadcast[index] = NetworkAddress(address, sizeof(sockaddr));
index++;
}
@@ -137,7 +137,7 @@ static int NetworkFindBroadcastIPsInternal(NetworkAddress *broadcast, int limit)
sockaddr_storage address;
memset(&address, 0, sizeof(address));
/* iiBroadcast is unusable, because it always seems to be set to 255.255.255.255. */
- ((sockaddr_in*)&storage)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr;
+ ((sockaddr_in*)&address)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr;
broadcast[index] = NetworkAddress(address, sizeof(sockaddr));
}
diff --git a/src/network/core/host.h b/src/network/core/host.h
index 32fb7fc5c..81cb0ff51 100644
--- a/src/network/core/host.h
+++ b/src/network/core/host.h
@@ -5,6 +5,7 @@
*/
#ifndef NETWORK_CORE_HOST_H
+#define NETWORK_CORE_HOST_H
void NetworkFindBroadcastIPs(NetworkAddress *broadcast, int limit);