summaryrefslogtreecommitdiff
path: root/src/oldpool.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-16 23:34:14 +0000
committersmatz <smatz@openttd.org>2009-05-16 23:34:14 +0000
commit6221d74644922ea4bbba3ed9cd8bbec42398f77b (patch)
tree0069bbd6bb7525754c5d9353132f5dc64a0996cc /src/oldpool.h
parent814f153b5a98e0030cbd221e6a89e083ce62bb1d (diff)
downloadopenttd-6221d74644922ea4bbba3ed9cd8bbec42398f77b.tar.xz
(svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index)
Diffstat (limited to 'src/oldpool.h')
-rw-r--r--src/oldpool.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/oldpool.h b/src/oldpool.h
index 9e49e22b3..14e31a1bd 100644
--- a/src/oldpool.h
+++ b/src/oldpool.h
@@ -277,6 +277,14 @@ struct PoolItem {
Tpool->UpdateFirstFreeIndex(pn->index);
}
+ /**
+ * Get item with given index
+ */
+ static FORCEINLINE T *Get(uint index)
+ {
+ return Tpool->Get(index);
+ }
+
private:
static T *AllocateSafeRaw(uint &first);
@@ -326,7 +334,6 @@ public:
#define OLD_POOL_ACCESSORS(name, type) \
- static inline type *Get##name(uint index) { return _##name##_pool.Get(index); } \
static inline uint Get##name##PoolSize() { return _##name##_pool.GetSize(); }
@@ -352,6 +359,7 @@ public:
#define STATIC_OLD_POOL(name, type, block_size_bits, max_blocks, new_block_proc, clean_block_proc) \
OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
static DEFINE_OLD_POOL(name, type, new_block_proc, clean_block_proc) \
- OLD_POOL_ACCESSORS(name, type)
+ OLD_POOL_ACCESSORS(name, type) \
+ static inline type *Get##name(uint index) { return _##name##_pool.Get(index); }
#endif /* OLDPOOL_H */