summaryrefslogtreecommitdiff
path: root/src/core/pool_func.hpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2012-02-12 21:17:32 +0000
committersmatz <smatz@openttd.org>2012-02-12 21:17:32 +0000
commitb5525fd33dc965728ffc0e22efc0b1ba806ef807 (patch)
treec0d8203cd6c55766b17bbaeee2c83fc3ab2754a2 /src/core/pool_func.hpp
parentf4de9b8a371fa1817aa4c0a47d224eb3b9779b0e (diff)
downloadopenttd-b5525fd33dc965728ffc0e22efc0b1ba806ef807.tar.xz
(svn r23941) -Add: support for clang
Diffstat (limited to 'src/core/pool_func.hpp')
-rw-r--r--src/core/pool_func.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/pool_func.hpp b/src/core/pool_func.hpp
index 8f53c66f9..729f7d84a 100644
--- a/src/core/pool_func.hpp
+++ b/src/core/pool_func.hpp
@@ -107,7 +107,11 @@ DEFINE_POOL_METHOD(inline void *)::AllocateItem(size_t size, size_t index)
assert(sizeof(Titem) == size);
item = (Titem *)this->alloc_cache;
this->alloc_cache = this->alloc_cache->next;
- if (Tzero) MemSetT(item, 0);
+ if (Tzero) {
+ /* Explicitly casting to (void *) prevets a clang warning -
+ * we are actually memsetting a (not-yet-constructed) object */
+ memset((void *)item, 0, sizeof(Titem));
+ }
} else if (Tzero) {
item = (Titem *)CallocT<byte>(size);
} else {