(svn r8707) -Codechange: Turn IsValidStation into a method of Station

This commit is contained in:
celestar
2007-02-13 15:42:52 +00:00
parent 6f68ac46b8
commit 8eab3964b4
6 changed files with 18 additions and 17 deletions

View File

@@ -54,7 +54,7 @@ static void StationPoolCleanBlock(uint start_item, uint end_item)
for (i = start_item; i <= end_item; i++) {
Station *st = GetStation(i);
if (IsValidStation(st)) st->~Station();
if (st->IsValid()) st->~Station();
}
}
@@ -167,7 +167,7 @@ static Station *AllocateStation(void)
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
* TODO - This is just a temporary stage, this will be removed. */
for (st = GetStation(0); st != NULL; st = (st->index + 1U < GetStationPoolSize()) ? GetStation(st->index + 1U) : NULL) {
if (!IsValidStation(st)) {
if (!st->IsValid()) {
StationID index = st->index;
memset(st, 0, sizeof(Station));