diff options
author | tron <tron@openttd.org> | 2006-10-28 11:08:52 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-10-28 11:08:52 +0000 |
commit | 1a4a7984a7d8ade87db3aef2a1b6427bc5a6a946 (patch) | |
tree | 9b76914d0edbe4e8f28e86b6c603b05e85a8b878 /engine.h | |
parent | da500bc3e6daf7f25852a64e04aaa96f65cb0b9a (diff) | |
download | openttd-1a4a7984a7d8ade87db3aef2a1b6427bc5a6a946.tar.xz |
(svn r6977) Use the pool macros for the EngineRenew pool
Diffstat (limited to 'engine.h')
-rw-r--r-- | engine.h | 22 |
1 files changed, 2 insertions, 20 deletions
@@ -236,15 +236,7 @@ typedef struct EngineRenew EngineRenew; * placed here so the only exception to this rule, the saveload code, can use * it. */ -extern MemoryPool _engine_renew_pool; - -/** - * Get the current size of the EngineRenewPool - */ -static inline uint16 GetEngineRenewPoolSize(void) -{ - return _engine_renew_pool.total_items; -} +DECLARE_POOL(EngineRenew, EngineRenew, 3, 8000) /** * Check if a EngineRenew really exists. @@ -259,19 +251,9 @@ static inline void DeleteEngineRenew(EngineRenew *er) er->from = INVALID_ENGINE; } -#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1 < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1) : NULL) if (er->from != INVALID_ENGINE) if (IsValidEngineRenew(er)) +#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1U < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1U) : NULL) if (er->from != INVALID_ENGINE) if (IsValidEngineRenew(er)) #define FOR_ALL_ENGINE_RENEWS(er) FOR_ALL_ENGINE_RENEWS_FROM(er, 0) -/** - * DO NOT USE outside of engine.c. Is - * placed here so the only exception to this rule, the saveload code, can use - * it. - */ -static inline EngineRenew *GetEngineRenew(uint16 index) -{ - return (EngineRenew*)GetItemFromPool(&_engine_renew_pool, index); -} - /** * A list to group EngineRenew directives together (such as per-player). |