(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.
This commit is contained in:
Darkvater
2006-10-18 13:17:46 +00:00
parent ccc1ad52d9
commit 68314cf576
4 changed files with 18 additions and 28 deletions

View File

@@ -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;
}