From: Mike Hommey Date: Sun, 6 Jul 2008 06:37:28 +0000 (+0200) Subject: Fixed some alignment problems on sparc X-Git-Tag: archive/raspbian/4%4.8.7+dfsg-16+rpi1^2~33 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=40ccbc544d54e312c4280463ba25f5d34aa993ff;p=qt4-x11.git Fixed some alignment problems on sparc Fixed some alignment problems on sparc (and some that might occur on arm, too). Some compiler warnings about alignment remain, but I don't know if they are a real problem yet. Gbp-Pq: Name 30_webkit_unaligned_access.diff --- diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/ListHashSet.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/ListHashSet.h index 25b73c188..f54559631 100644 --- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/ListHashSet.h +++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/ListHashSet.h @@ -145,7 +145,7 @@ namespace WTF { : m_freeList(pool()) , m_isDoneWithInitialFreeList(false) { - memset(m_pool.pool, 0, sizeof(m_pool.pool)); + memset(m_pool, 0, sizeof(m_pool)); } Node* allocate() @@ -189,7 +189,7 @@ namespace WTF { } private: - Node* pool() { return reinterpret_cast_ptr(m_pool.pool); } + Node* pool() { return reinterpret_cast_ptr(m_pool); } Node* pastPool() { return pool() + m_poolSize; } bool inPool(Node* node) @@ -200,10 +200,7 @@ namespace WTF { Node* m_freeList; bool m_isDoneWithInitialFreeList; static const size_t m_poolSize = inlineCapacity; - union { - char pool[sizeof(Node) * m_poolSize]; - double forAlignment; - } m_pool; + uint32_t m_pool[(sizeof(Node) * m_poolSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)]; }; template struct ListHashSetNode {