summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-18 13:17:46 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-18 13:17:46 +0000
commit83bed3910675591326a77f11188ece7baa8e5d20 (patch)
tree1be40857750c8b591b52bf5cf52bc3ba767fa093 /network.c
parent8e121eea701fb4da7194a4b6eb9b429b2e24240e (diff)
downloadopenttd-83bed3910675591326a77f11188ece7baa8e5d20.tar.xz
(svn r6820) -Codechange: Some more const correctness, coding style.
-Codechange: Add FOR_ALL_ACTIVE_CLIENT_INFOS macro that will loop all clients skipping inactive ones.
Diffstat (limited to 'network.c')
-rw-r--r--network.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/network.c b/network.c
index 9d90a3a61..3100fda41 100644
--- a/network.c
+++ b/network.c
@@ -55,7 +55,7 @@ NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index)
{
NetworkClientInfo *ci;
- for (ci = _network_client_info; ci != &_network_client_info[MAX_CLIENT_INFO]; ci++) {
+ for (ci = _network_client_info; ci != endof(_network_client_info); ci++) {
if (ci->client_index == client_index) return ci;
}
@@ -70,7 +70,7 @@ NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip)
NetworkClientInfo *ci;
uint32 ip_number = inet_addr(ip);
- for (ci = _network_client_info; ci != &_network_client_info[MAX_CLIENT_INFO]; ci++) {
+ for (ci = _network_client_info; ci != endof(_network_client_info); ci++) {
if (ci->client_ip == ip_number) return ci;
}