[Libreoffice-commits] .: 2 commits - cppu/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Thu Dec 1 12:25:53 PST 2011


 cppu/source/threadpool/threadident.cxx |    7 +++++--
 cppu/source/typelib/static_types.cxx   |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit beebf578ed20771495d2eda9e7fb898767f49d7c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 1 21:24:01 2011 +0100

    -Wstrict-aliasing fix

diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx
index b218c20..a4e76c4 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]) );
 }
 
commit db4017cb710b254ccc4e1980fdf419134afab252
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 1 21:22:34 2011 +0100

    The other uses of pReserved had been changed to nStaticRefCount in 2001.

diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 0727faf..32e4684 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -578,7 +578,7 @@ void SAL_CALL typelib_static_enum_type_init(
                 OSL_ASSERT( *ppRef == pReg->pWeakRef );
             }
             // another static ref:
-            ++(*(sal_Int32 *)&(*ppRef)->pReserved);
+            ++((*ppRef)->nStaticRefCount);
         }
     }
 }


More information about the Libreoffice-commits mailing list