From beebf578ed20771495d2eda9e7fb898767f49d7c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 1 Dec 2011 21:24:01 +0100 Subject: -Wstrict-aliasing fix --- cppu/source/threadpool/threadident.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cppu/source') diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx index b218c202da50..a4e76c4b91e7 100644 --- a/cppu/source/threadpool/threadident.cxx +++ b/cppu/source/threadpool/threadident.cxx @@ -51,8 +51,11 @@ using namespace ::cppu; static inline void createLocalId( sal_Sequence **ppThreadId ) { rtl_byte_sequence_constructNoDefault( ppThreadId , 4 + 16 ); - *((sal_Int32*) ((*ppThreadId)->elements)) = osl_getThreadIdentifier(0); - + sal_uInt32 id = osl_getThreadIdentifier(0); + (*ppThreadId)->elements[0] = id & 0xFF; + (*ppThreadId)->elements[1] = (id >> 8) & 0xFF; + (*ppThreadId)->elements[2] = (id >> 16) & 0xFF; + (*ppThreadId)->elements[3] = (id >> 24) & 0xFF; rtl_getGlobalProcessId( (sal_uInt8 * ) &( (*ppThreadId)->elements[4]) ); } -- cgit v1.2.3