Author: pfg
Date: Wed Feb  8 15:21:17 2017
New Revision: 1782205

URL: http://svn.apache.org/viewvc?rev=1782205&view=rev
Log:
i101100 - Fix some aliasing issues.

This is a very small part of a patch submitted by Caolan McNamara on 
2009 to help OOo work with -fstrict-aliasing. It is not complete and for 
now I omitted adding -fno-strict-aliasing to many makefiles.

This does require a lot more attention and will have to be completed at 
some point because newer versions of GCC enable strict-aliasing with most
optimization levels.


Modified:
    openoffice/trunk/main/basctl/source/dlged/dlged.cxx
    openoffice/trunk/main/bridges/source/jni_uno/jni_data.cxx
    openoffice/trunk/main/cppu/inc/com/sun/star/uno/Any.hxx
    openoffice/trunk/main/cppu/source/threadpool/threadident.cxx
    openoffice/trunk/main/cppu/source/uno/copy.hxx
    openoffice/trunk/main/cppu/source/uno/data.cxx
    openoffice/trunk/main/cppu/source/uno/destr.hxx
    openoffice/trunk/main/cppu/source/uno/lbenv.cxx
    openoffice/trunk/main/sal/osl/unx/pipe.c
    openoffice/trunk/main/sal/osl/unx/sockimpl.h
    openoffice/trunk/main/sw/source/filter/xml/swxml.cxx
    openoffice/trunk/main/tools/source/stream/stream.cxx

Modified: openoffice/trunk/main/basctl/source/dlged/dlged.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/basctl/source/dlged/dlged.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/basctl/source/dlged/dlged.cxx (original)
+++ openoffice/trunk/main/basctl/source/dlged/dlged.cxx Wed Feb  8 15:21:17 2017
@@ -967,7 +967,7 @@ void DlgEditor::Paste()
                                                uno::UNO_QUERY );
 
                                bool bSourceIsLocalized = false;
-                               Sequence< sal_Int8 > DialogModelBytes;
+                               rtl::ByteSequence DialogModelBytes;
                                Sequence< sal_Int8 > aResData;
                                if( bLocalized && 
xTransf->isDataFlavorSupported( m_ClipboardDataFlavorsResource[1] ) )
                                {
@@ -1001,7 +1001,9 @@ void DlgEditor::Paste()
                                else
                                {
                                        Any aAny = xTransf->getTransferData( 
m_ClipboardDataFlavors[0] );
-                                       aAny >>= DialogModelBytes;
+                    Sequence< sal_Int8 > aTmp;
+                                       aAny >>= aTmp;
+                                       DialogModelBytes = rtl::ByteSequence( 
aTmp.getArray(), aTmp.getLength() );
                                }
 
                                if ( xClipDialogModel.is() )
@@ -1010,7 +1012,7 @@ void DlgEditor::Paste()
                     Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
                     OSL_ASSERT( xProps.is() );
                     OSL_VERIFY( xProps->getPropertyValue( 
OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
-                                       ::xmlscript::importDialogModel( 
::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) 
, xClipDialogModel, xContext );
+                                       ::xmlscript::importDialogModel( 
::xmlscript::createInputStream( DialogModelBytes ) , xClipDialogModel, xContext 
);
                                }
 
                                // get control models from clipboard dialog 
model

Modified: openoffice/trunk/main/bridges/source/jni_uno/jni_data.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/jni_uno/jni_data.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/bridges/source/jni_uno/jni_data.cxx (original)
+++ openoffice/trunk/main/bridges/source/jni_uno/jni_data.cxx Wed Feb  8 
15:21:17 2017
@@ -556,45 +556,46 @@ void Bridge::map_to_uno(
                 pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_CHAR:
-                *(jchar *) &pAny->pReserved = jni->CallCharMethodA(
+                pAny->pData = &pAny->pReserved;
+                *(jchar *) pAny->pData = jni->CallCharMethodA(
                     java_data.l, m_jni_info->m_method_Character_charValue, 0 );
                 jni.ensure_no_exception();
                 pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_BOOLEAN:
-                *(jboolean *) &pAny->pReserved = jni->CallBooleanMethodA(
+                pAny->pData = &pAny->pReserved;
+                *(jboolean *) pAny->pData = jni->CallBooleanMethodA(
                     java_data.l, m_jni_info->m_method_Boolean_booleanValue, 0 
);
                 jni.ensure_no_exception();
-                pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_BYTE:
-                *(jbyte *) &pAny->pReserved = jni->CallByteMethodA(
+                pAny->pData = &pAny->pReserved;
+                *(jbyte *) pAny->pData = jni->CallByteMethodA(
                     java_data.l, m_jni_info->m_method_Byte_byteValue, 0 );
                 jni.ensure_no_exception();
-                pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_SHORT:
             case typelib_TypeClass_UNSIGNED_SHORT:
-                *(jshort *) &pAny->pReserved = jni->CallShortMethodA(
+                pAny->pData = &pAny->pReserved;
+                *(jshort *) pAny->pData = jni->CallShortMethodA(
                     java_data.l, m_jni_info->m_method_Short_shortValue, 0 );
                 jni.ensure_no_exception();
-                pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_LONG:
             case typelib_TypeClass_UNSIGNED_LONG:
-                *(jint *) &pAny->pReserved = jni->CallIntMethodA(
+                pAny->pData = &pAny->pReserved;
+                *(jint *) pAny->pData = jni->CallIntMethodA(
                     java_data.l, m_jni_info->m_method_Integer_intValue, 0 );
                 jni.ensure_no_exception();
-                pAny->pData = &pAny->pReserved;
                 break;
             case typelib_TypeClass_HYPER:
             case typelib_TypeClass_UNSIGNED_HYPER:
                 if (sizeof (sal_Int64) <= sizeof (void *))
                 {
-                    *(jlong *) &pAny->pReserved = jni->CallLongMethodA(
+                    pAny->pData = &pAny->pReserved;
+                    *(jlong *) pAny->pData = jni->CallLongMethodA(
                         java_data.l, m_jni_info->m_method_Long_longValue, 0 );
                     jni.ensure_no_exception();
-                    pAny->pData = &pAny->pReserved;
                 }
                 else
                 {
@@ -609,10 +610,10 @@ void Bridge::map_to_uno(
             case typelib_TypeClass_FLOAT:
                 if (sizeof (float) <= sizeof (void *))
                 {
-                    *(jfloat *) &pAny->pReserved = jni->CallFloatMethodA(
+                    pAny->pData = &pAny->pReserved;
+                    *(jfloat *) pAny->pData = jni->CallFloatMethodA(
                         java_data.l, m_jni_info->m_method_Float_floatValue, 0 
);
                     jni.ensure_no_exception();
-                    pAny->pData = &pAny->pReserved;
                 }
                 else
                 {
@@ -627,12 +628,12 @@ void Bridge::map_to_uno(
             case typelib_TypeClass_DOUBLE:
                 if (sizeof (double) <= sizeof (void *))
                 {
-                    *(jdouble *) &pAny->pReserved =
+                    pAny->pData = &pAny->pReserved;
+                    *(jdouble *) pAny->pData =
                         jni->CallDoubleMethodA(
                             java_data.l,
                             m_jni_info->m_method_Double_doubleValue, 0 );
                     jni.ensure_no_exception();
-                    pAny->pData = &pAny->pReserved;
                 }
                 else
                 {
@@ -1653,7 +1654,7 @@ void Bridge::map_to_java(
             case typelib_TypeClass_UNSIGNED_SHORT:
             {
                 jvalue args[ 2 ];
-                args[ 0 ].s = *(jshort const *) &pAny->pReserved;
+                args[ 0 ].s = *(jshort const *) pAny->pData;
                 JLocalAutoRef jo_val(
                     jni, jni->NewObjectA(
                         m_jni_info->m_class_Short,
@@ -1672,7 +1673,7 @@ void Bridge::map_to_java(
             case typelib_TypeClass_UNSIGNED_LONG:
             {
                 jvalue args[ 2 ];
-                args[ 0 ].i = *(jint const *) &pAny->pReserved;
+                args[ 0 ].i = *(jint const *) pAny->pData;
                 JLocalAutoRef jo_val(
                     jni, jni->NewObjectA(
                         m_jni_info->m_class_Integer,

Modified: openoffice/trunk/main/cppu/inc/com/sun/star/uno/Any.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/inc/com/sun/star/uno/Any.hxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/inc/com/sun/star/uno/Any.hxx (original)
+++ openoffice/trunk/main/cppu/inc/com/sun/star/uno/Any.hxx Wed Feb  8 15:21:17 
2017
@@ -230,7 +230,7 @@ inline sal_Bool SAL_CALL operator >>= (
 {
        if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
        {
-               value = (* reinterpret_cast< const sal_Bool * >( 
&rAny.pReserved ) != sal_False);
+               value = (* reinterpret_cast< const sal_Bool * >( rAny.pData ) 
!= sal_False);
                return sal_True;
        }
        return sal_False;
@@ -239,7 +239,7 @@ inline sal_Bool SAL_CALL operator >>= (
 inline sal_Bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & 
value ) SAL_THROW( () )
 {
        return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
-                       (value != sal_False) == (* reinterpret_cast< const 
sal_Bool * >( &rAny.pReserved ) != sal_False));
+                       (value != sal_False) == (* reinterpret_cast< const 
sal_Bool * >( rAny.pData ) != sal_False));
 }
 
 
//______________________________________________________________________________
@@ -250,7 +250,7 @@ inline sal_Bool SAL_CALL operator >>= (
        if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
        {
                value = *reinterpret_cast< sal_Bool const * >(
-            &rAny.pReserved ) != sal_False;
+            rAny.pData ) != sal_False;
                return true;
        }
        return false;
@@ -263,7 +263,7 @@ inline sal_Bool SAL_CALL operator == ( A
 {
        return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
                        (value ==
-             (*reinterpret_cast< sal_Bool const * >( &rAny.pReserved )
+             (*reinterpret_cast< sal_Bool const * >( rAny.pData )
               != sal_False)));
 }
 
@@ -273,7 +273,7 @@ inline sal_Bool SAL_CALL operator >>= (
 {
        if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
        {
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        }
        return sal_False;
@@ -285,11 +285,11 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        default:
                return sal_False;
@@ -301,11 +301,11 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        default:
                return sal_False;
@@ -318,17 +318,17 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_LONG:
        case typelib_TypeClass_UNSIGNED_LONG:
-               value = * reinterpret_cast< const sal_Int32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
                return sal_True;
        default:
                return sal_False;
@@ -340,17 +340,17 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_LONG:
        case typelib_TypeClass_UNSIGNED_LONG:
-               value = * reinterpret_cast< const sal_uInt32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
                return sal_True;
        default:
                return sal_False;
@@ -363,24 +363,23 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_LONG:
-               value = * reinterpret_cast< const sal_Int32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_LONG:
-               value = * reinterpret_cast< const sal_uInt32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_HYPER:
        case typelib_TypeClass_UNSIGNED_HYPER:
-        value = * reinterpret_cast< const sal_Int64 * >(
-            (sizeof(void *) >= sizeof(sal_Int64)) ? (void *)&rAny.pReserved : 
rAny.pData );
+        value = * reinterpret_cast< const sal_Int64 * >( rAny.pData );
                return sal_True;
 
        default:
@@ -393,24 +392,23 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_LONG:
-               value = * reinterpret_cast< const sal_Int32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_LONG:
-               value = * reinterpret_cast< const sal_uInt32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_HYPER:
        case typelib_TypeClass_UNSIGNED_HYPER:
-        value = * reinterpret_cast< const sal_uInt64 * >(
-            (sizeof(void *) >= sizeof(sal_uInt64)) ? (void *)&rAny.pReserved : 
rAny.pData );
+        value = * reinterpret_cast< const sal_uInt64 * >( rAny.pData );
                return sal_True;
 
        default:
@@ -424,17 +422,16 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_FLOAT:
-        value = * reinterpret_cast< const float * >(
-            (sizeof(void *) >= sizeof(float)) ? (void *)&rAny.pReserved : 
rAny.pData );
+        value = * reinterpret_cast< const float * >( rAny.pData );
                return sal_True;
 
        default:
@@ -448,27 +445,25 @@ inline sal_Bool SAL_CALL operator >>= (
        switch (rAny.pType->eTypeClass)
        {
        case typelib_TypeClass_BYTE:
-               value = * reinterpret_cast< const sal_Int8 * >( &rAny.pReserved 
);
+               value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_SHORT:
-               value = * reinterpret_cast< const sal_Int16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_SHORT:
-               value = * reinterpret_cast< const sal_uInt16 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_LONG:
-               value = * reinterpret_cast< const sal_Int32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_UNSIGNED_LONG:
-               value = * reinterpret_cast< const sal_uInt32 * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_FLOAT:
-        value = * reinterpret_cast< const float * >(
-            (sizeof(void *) >= sizeof(float)) ? (void *)&rAny.pReserved : 
rAny.pData );
+        value = * reinterpret_cast< const float * >( rAny.pData );
                return sal_True;
        case typelib_TypeClass_DOUBLE:
-        value = * reinterpret_cast< const double * >(
-            (sizeof(void *) >= sizeof(double)) ? (void *)&rAny.pReserved : 
rAny.pData );
+        value = * reinterpret_cast< const double * >( rAny.pData );
                return sal_True;
 
        default:
@@ -481,7 +476,7 @@ inline sal_Bool SAL_CALL operator >>= (
 {
        if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
        {
-               value = * reinterpret_cast< const ::rtl::OUString * >( 
&rAny.pReserved );
+               value = * reinterpret_cast< const ::rtl::OUString * >( 
rAny.pData );
                return sal_True;
        }
        return sal_False;
@@ -490,7 +485,7 @@ inline sal_Bool SAL_CALL operator >>= (
 inline sal_Bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString 
& value ) SAL_THROW( () )
 {
        return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
-                       value.equals( * reinterpret_cast< const ::rtl::OUString 
* >( &rAny.pReserved ) ));
+                       value.equals( * reinterpret_cast< const ::rtl::OUString 
* >( rAny.pData ) ));
 }
 // type
 
//__________________________________________________________________________________________________
@@ -498,7 +493,7 @@ inline sal_Bool SAL_CALL operator >>= (
 {
        if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
        {
-               value = * reinterpret_cast< const Type * >( &rAny.pReserved );
+               value = * reinterpret_cast< const Type * >( rAny.pData );
                return sal_True;
        }
        return sal_False;
@@ -507,7 +502,7 @@ inline sal_Bool SAL_CALL operator >>= (
 inline sal_Bool SAL_CALL operator == ( const Any & rAny, const Type & value ) 
SAL_THROW( () )
 {
        return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
-                       value.equals( * reinterpret_cast< const Type * >( 
&rAny.pReserved ) ));
+                       value.equals( * reinterpret_cast< const Type * >( 
rAny.pData ) ));
 }
 // any
 
//__________________________________________________________________________________________________
@@ -527,7 +522,7 @@ inline sal_Bool SAL_CALL operator == ( c
 {
        if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
        {
-               return reinterpret_cast< const BaseReference * >( 
&rAny.pReserved )->operator == ( value );
+               return reinterpret_cast< const BaseReference * >( rAny.pData 
)->operator == ( value );
        }
        return sal_False;
 }

Modified: openoffice/trunk/main/cppu/source/threadpool/threadident.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/threadpool/threadident.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/threadpool/threadident.cxx (original)
+++ openoffice/trunk/main/cppu/source/threadpool/threadident.cxx Wed Feb  8 
15:21:17 2017
@@ -24,6 +24,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_cppu.hxx"
 #include <stdio.h>
+#include <string.h>
 
 #include <list>
 
@@ -47,10 +48,12 @@ using namespace ::cppu;
 
 static inline void createLocalId( sal_Sequence **ppThreadId )
 {
-       rtl_byte_sequence_constructNoDefault( ppThreadId , 4 + 16 );
-       *((sal_Int32*) ((*ppThreadId)->elements)) = osl_getThreadIdentifier(0);
+       rtl_byte_sequence_constructNoDefault( ppThreadId , 
sizeof(oslThreadIdentifier) + 16 );
 
-       rtl_getGlobalProcessId( (sal_uInt8 * ) &( (*ppThreadId)->elements[4]) );
+       oslThreadIdentifier hIdent = osl_getThreadIdentifier(0);
+       memcpy((*ppThreadId)->elements, &hIdent, sizeof(oslThreadIdentifier));
+
+       rtl_getGlobalProcessId( (sal_uInt8 * ) &( 
(*ppThreadId)->elements[sizeof(oslThreadIdentifier)]) );
 }
 
 

Modified: openoffice/trunk/main/cppu/source/uno/copy.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/uno/copy.hxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/uno/copy.hxx (original)
+++ openoffice/trunk/main/cppu/source/uno/copy.hxx Wed Feb  8 15:21:17 2017
@@ -179,32 +179,32 @@ inline void _copyConstructAnyFromData(
        {
        case typelib_TypeClass_CHAR:
                pDestAny->pData = &pDestAny->pReserved;
-               *(sal_Unicode *)&pDestAny->pReserved = *(sal_Unicode *)pSource;
+               *(sal_Unicode *)pDestAny->pData = *(sal_Unicode *)pSource;
                break;
        case typelib_TypeClass_BOOLEAN:
                pDestAny->pData = &pDestAny->pReserved;
-               *(sal_Bool *)&pDestAny->pReserved = (*(sal_Bool *)pSource != 
sal_False);
+               *(sal_Bool *)pDestAny->pData = (*(sal_Bool *)pSource != 
sal_False);
                break;
        case typelib_TypeClass_BYTE:
                pDestAny->pData = &pDestAny->pReserved;
-               *(sal_Int8 *)&pDestAny->pReserved = *(sal_Int8 *)pSource;
+               *(sal_Int8 *)pDestAny->pData = *(sal_Int8 *)pSource;
                break;
        case typelib_TypeClass_SHORT:
        case typelib_TypeClass_UNSIGNED_SHORT:
                pDestAny->pData = &pDestAny->pReserved;
-               *(sal_Int16 *)&pDestAny->pReserved = *(sal_Int16 *)pSource;
+               *(sal_Int16 *)pDestAny->pData = *(sal_Int16 *)pSource;
                break;
        case typelib_TypeClass_LONG:
        case typelib_TypeClass_UNSIGNED_LONG:
                pDestAny->pData = &pDestAny->pReserved;
-               *(sal_Int32 *)&pDestAny->pReserved = *(sal_Int32 *)pSource;
+               *(sal_Int32 *)pDestAny->pData = *(sal_Int32 *)pSource;
                break;
        case typelib_TypeClass_HYPER:
        case typelib_TypeClass_UNSIGNED_HYPER:
         if (sizeof(void *) >= sizeof(sal_Int64))
         {
             pDestAny->pData = &pDestAny->pReserved;
-            *(sal_Int64 *)&pDestAny->pReserved = *(sal_Int64 *)pSource;
+            *(sal_Int64 *)pDestAny->pData = *(sal_Int64 *)pSource;
         }
         else
         {
@@ -216,7 +216,7 @@ inline void _copyConstructAnyFromData(
         if (sizeof(void *) >= sizeof(float))
         {
             pDestAny->pData = &pDestAny->pReserved;
-            *(float *)&pDestAny->pReserved = *(float *)pSource;
+            *(float *)pDestAny->pData = *(float *)pSource;
         }
         else
         {
@@ -228,7 +228,7 @@ inline void _copyConstructAnyFromData(
         if (sizeof(void *) >= sizeof(double))
         {
             pDestAny->pData = &pDestAny->pReserved;
-            *(double *)&pDestAny->pReserved = *(double *)pSource;
+            *(double *)pDestAny->pData = *(double *)pSource;
         }
         else
         {
@@ -239,12 +239,12 @@ inline void _copyConstructAnyFromData(
        case typelib_TypeClass_STRING:
                ::rtl_uString_acquire( *(rtl_uString **)pSource );
                pDestAny->pData = &pDestAny->pReserved;
-               *(rtl_uString **)&pDestAny->pReserved = *(rtl_uString 
**)pSource;
+               *(rtl_uString **)pDestAny->pData = *(rtl_uString **)pSource;
                break;
        case typelib_TypeClass_TYPE:
                TYPE_ACQUIRE( *(typelib_TypeDescriptionReference **)pSource );
                pDestAny->pData = &pDestAny->pReserved;
-               *(typelib_TypeDescriptionReference **)&pDestAny->pReserved = 
*(typelib_TypeDescriptionReference **)pSource;
+               *(typelib_TypeDescriptionReference **)pDestAny->pData = 
*(typelib_TypeDescriptionReference **)pSource;
                break;
        case typelib_TypeClass_ANY:
                OSL_ENSURE( 0, "### unexpected nested any!" );
@@ -252,7 +252,7 @@ inline void _copyConstructAnyFromData(
        case typelib_TypeClass_ENUM:
                pDestAny->pData = &pDestAny->pReserved;
         // enum is forced to 32bit long
-               *(sal_Int32 *)&pDestAny->pReserved = *(sal_Int32 *)pSource;
+               *(sal_Int32 *)pDestAny->pData = *(sal_Int32 *)pSource;
                break;
        case typelib_TypeClass_STRUCT:
        case typelib_TypeClass_EXCEPTION:
@@ -313,7 +313,7 @@ inline void _copyConstructAnyFromData(
                pDestAny->pData = &pDestAny->pReserved;
                if (pTypeDescr)
                {
-                       *(uno_Sequence **)&pDestAny->pReserved = 
copyConstructSequence(
+                       *(uno_Sequence **)pDestAny->pData = 
copyConstructSequence(
                                *(uno_Sequence **)pSource,
                                ((typelib_IndirectTypeDescription 
*)pTypeDescr)->pType,
                                acquire, mapping );
@@ -321,7 +321,7 @@ inline void _copyConstructAnyFromData(
                else
                {
                        TYPELIB_DANGER_GET( &pTypeDescr, pType );
-                       *(uno_Sequence **)&pDestAny->pReserved = 
copyConstructSequence(
+                       *(uno_Sequence **)pDestAny->pData = 
copyConstructSequence(
                                *(uno_Sequence **)pSource,
                                ((typelib_IndirectTypeDescription 
*)pTypeDescr)->pType,
                                acquire, mapping );
@@ -388,32 +388,32 @@ inline void _copyConstructAny(
                        {
                        case typelib_TypeClass_CHAR:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(sal_Unicode *)&pDestAny->pReserved = '\0';
+                               *(sal_Unicode *)pDestAny->pData = '\0';
                                break;
                        case typelib_TypeClass_BOOLEAN:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(sal_Bool *)&pDestAny->pReserved = sal_False;
+                               *(sal_Bool *)pDestAny->pData = sal_False;
                                break;
                        case typelib_TypeClass_BYTE:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(sal_Int8 *)&pDestAny->pReserved = 0;
+                               *(sal_Int8 *)pDestAny->pData = 0;
                                break;
                        case typelib_TypeClass_SHORT:
                        case typelib_TypeClass_UNSIGNED_SHORT:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(sal_Int16 *)&pDestAny->pReserved = 0;
+                               *(sal_Int16 *)pDestAny->pData = 0;
                                break;
                        case typelib_TypeClass_LONG:
                        case typelib_TypeClass_UNSIGNED_LONG:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(sal_Int32 *)&pDestAny->pReserved = 0;
+                               *(sal_Int32 *)pDestAny->pData = 0;
                                break;
                        case typelib_TypeClass_HYPER:
                        case typelib_TypeClass_UNSIGNED_HYPER:
                 if (sizeof(void *) >= sizeof(sal_Int64))
                 {
                     pDestAny->pData = &pDestAny->pReserved;
-                    *(sal_Int64 *)&pDestAny->pReserved = 0;
+                    *(sal_Int64 *)pDestAny->pData = 0;
                 }
                 else
                 {
@@ -425,7 +425,7 @@ inline void _copyConstructAny(
                 if (sizeof(void *) >= sizeof(float))
                 {
                     pDestAny->pData = &pDestAny->pReserved;
-                    *(float *)&pDestAny->pReserved = 0.0;
+                    *(float *)pDestAny->pData = 0.0;
                 }
                 else
                 {
@@ -437,7 +437,7 @@ inline void _copyConstructAny(
                 if (sizeof(void *) >= sizeof(double))
                 {
                     pDestAny->pData = &pDestAny->pReserved;
-                    *(double *)&pDestAny->pReserved = 0.0;
+                    *(double *)pDestAny->pData = 0.0;
                 }
                 else
                 {
@@ -447,23 +447,23 @@ inline void _copyConstructAny(
                                break;
                        case typelib_TypeClass_STRING:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(rtl_uString **)&pDestAny->pReserved = 0;
+                               *(rtl_uString **)pDestAny->pData = 0;
                                ::rtl_uString_new( (rtl_uString 
**)&pDestAny->pReserved );
                                break;
                        case typelib_TypeClass_TYPE:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(typelib_TypeDescriptionReference 
**)&pDestAny->pReserved = _getVoidType();
+                               *(typelib_TypeDescriptionReference 
**)pDestAny->pData = _getVoidType();
                                break;
                        case typelib_TypeClass_ENUM:
                                pDestAny->pData = &pDestAny->pReserved;
                                if (pTypeDescr)
                                {
-                                       *(sal_Int32 *)&pDestAny->pReserved = 
((typelib_EnumTypeDescription *)pTypeDescr)->nDefaultEnumValue;
+                                       *(sal_Int32 *)pDestAny->pData = 
((typelib_EnumTypeDescription *)pTypeDescr)->nDefaultEnumValue;
                                }
                                else
                                {
                                        TYPELIB_DANGER_GET( &pTypeDescr, pType 
);
-                                       *(sal_Int32 *)&pDestAny->pReserved = 
((typelib_EnumTypeDescription *)pTypeDescr)->nDefaultEnumValue;
+                                       *(sal_Int32 *)pDestAny->pData = 
((typelib_EnumTypeDescription *)pTypeDescr)->nDefaultEnumValue;
                                        TYPELIB_DANGER_RELEASE( pTypeDescr );
                                }
                                break;
@@ -516,7 +516,7 @@ inline void _copyConstructAny(
                                break;
                        case typelib_TypeClass_SEQUENCE:
                                pDestAny->pData = &pDestAny->pReserved;
-                               *(uno_Sequence **)&pDestAny->pReserved = 
createEmptySequence();
+                               *(uno_Sequence **)pDestAny->pData = 
createEmptySequence();
                                break;
                        case typelib_TypeClass_INTERFACE:
                                pDestAny->pData = &pDestAny->pReserved;

Modified: openoffice/trunk/main/cppu/source/uno/data.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/uno/data.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/uno/data.cxx (original)
+++ openoffice/trunk/main/cppu/source/uno/data.cxx Wed Feb  8 15:21:17 2017
@@ -64,12 +64,12 @@ void * binuno_queryInterface( void * pUn
                {
             typelib_TypeDescriptionReference * type_XInterface =
                 * typelib_static_type_getByTypeClass( 
typelib_TypeClass_INTERFACE );
-                       typelib_InterfaceTypeDescription * pTXInterfaceDescr = 
0;
-                       TYPELIB_DANGER_GET( (typelib_TypeDescription **) 
&pTXInterfaceDescr, type_XInterface );
-                       OSL_ASSERT( pTXInterfaceDescr->ppAllMembers );
+                       typelib_TypeDescription * pTXInterfaceDescr = 0;
+                       TYPELIB_DANGER_GET( &pTXInterfaceDescr, type_XInterface 
);
+                       OSL_ASSERT( 
((typelib_InterfaceTypeDescription*)pTXInterfaceDescr)->ppAllMembers );
                        typelib_typedescriptionreference_getDescription(
-                               &g_pQITD, pTXInterfaceDescr->ppAllMembers[ 0 ] 
);
-                       TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) 
pTXInterfaceDescr );
+                               &g_pQITD, 
((typelib_InterfaceTypeDescription*)pTXInterfaceDescr)->ppAllMembers[ 0 ] );
+                       TYPELIB_DANGER_RELEASE( pTXInterfaceDescr );
                }
        }
 

Modified: openoffice/trunk/main/cppu/source/uno/destr.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/uno/destr.hxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/uno/destr.hxx (original)
+++ openoffice/trunk/main/cppu/source/uno/destr.hxx Wed Feb  8 15:21:17 2017
@@ -171,7 +171,7 @@ inline void _destructAny(
     case typelib_TypeClass_SEQUENCE:
     {
         destructSequence(
-            *(uno_Sequence **) &pAny->pReserved, pType, 0, release );
+            *(uno_Sequence **) pAny->pData, pType, 0, release );
         break;
     }
     case typelib_TypeClass_INTERFACE:

Modified: openoffice/trunk/main/cppu/source/uno/lbenv.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cppu/source/uno/lbenv.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/cppu/source/uno/lbenv.cxx (original)
+++ openoffice/trunk/main/cppu/source/uno/lbenv.cxx Wed Feb  8 15:21:17 2017
@@ -257,7 +257,7 @@ static void SAL_CALL defenv_registerInte
     rtl_uString * pOId, typelib_InterfaceTypeDescription * pTypeDescr )
 {
     OSL_ENSURE( pEnv && ppInterface && pOId && pTypeDescr, "### null ptr!" );
-    OUString const & rOId = OUString::unacquired( &pOId );
+    OUString sOId( pOId );
     
     uno_DefaultEnvironment * that =
         static_cast< uno_DefaultEnvironment * >( pEnv );
@@ -265,10 +265,10 @@ static void SAL_CALL defenv_registerInte
     
     // try to insert dummy 0:
     std::pair<OId2ObjectMap::iterator, bool> const insertion(
-        that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, 0 ) ) );
+        that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( sOId, 0 ) ) );
     if (insertion.second)
     {
-        ObjectEntry * pOEntry = new ObjectEntry( rOId );
+        ObjectEntry * pOEntry = new ObjectEntry( sOId );
         insertion.first->second = pOEntry;
         ++pOEntry->nRef; // another register call on object
         pOEntry->append( that, *ppInterface, pTypeDescr, 0 );
@@ -305,7 +305,7 @@ static void SAL_CALL defenv_registerProx
 {
     OSL_ENSURE( pEnv && ppInterface && pOId && pTypeDescr && freeProxy,
                 "### null ptr!" );
-    OUString const & rOId = OUString::unacquired( &pOId );
+    OUString sOId( pOId );
     
     uno_DefaultEnvironment * that =
         static_cast< uno_DefaultEnvironment * >( pEnv );
@@ -313,10 +313,10 @@ static void SAL_CALL defenv_registerProx
     
     // try to insert dummy 0:
     std::pair<OId2ObjectMap::iterator, bool> const insertion(
-        that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, 0 ) ) );
+        that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( sOId, 0 ) ) );
     if (insertion.second)
     {
-        ObjectEntry * pOEntry = new ObjectEntry( rOId );
+        ObjectEntry * pOEntry = new ObjectEntry( sOId );
         insertion.first->second = pOEntry;
         ++pOEntry->nRef; // another register call on object
         pOEntry->append( that, *ppInterface, pTypeDescr, freeProxy );
@@ -494,13 +494,13 @@ static void SAL_CALL defenv_getRegistere
         *ppInterface = 0;
     }
 
-    OUString const & rOId = OUString::unacquired( &pOId );
+    OUString sOId( pOId );
     uno_DefaultEnvironment * that =
         static_cast< uno_DefaultEnvironment * >( pEnv );
     ::osl::MutexGuard guard( that->mutex );
 
     OId2ObjectMap::const_iterator const iFind
-        ( that->aOId2ObjectMap.find( rOId ) );
+        ( that->aOId2ObjectMap.find( sOId ) );
     if (iFind != that->aOId2ObjectMap.end())
     {
         InterfaceEntry const * pIEntry = iFind->second->find( pTypeDescr );

Modified: openoffice/trunk/main/sal/osl/unx/pipe.c
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/unx/pipe.c?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/unx/pipe.c (original)
+++ openoffice/trunk/main/sal/osl/unx/pipe.c Wed Feb  8 15:21:17 2017
@@ -163,7 +163,11 @@ oslPipe SAL_CALL osl_psz_createPipe(cons
 {
        int    Flags;
        size_t     len;
-       struct sockaddr_un addr;
+    union
+    {
+           struct sockaddr addr;
+           struct sockaddr_un addr_un;
+    } s;
 
        sal_Char         name[PATH_MAX + 1];
        const sal_Char   *pPath;
@@ -218,16 +222,16 @@ oslPipe SAL_CALL osl_psz_createPipe(cons
                }
        }
 
-       memset(&addr, 0, sizeof(addr));
+       memset(&s.addr_un, 0, sizeof(s.addr_un));
 
     OSL_TRACE("osl_createPipe : Pipe Name '%s'",name);
 
-       addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, name, sizeof(addr.sun_path));
+       s.addr_un.sun_family = AF_UNIX;
+       strncpy(s.addr_un.sun_path, name, sizeof(s.addr_un.sun_path));
 #if defined(FREEBSD)
-       len = SUN_LEN(&addr);
+       len = SUN_LEN(&s.addr_un);
 #else
-       len = sizeof(addr);
+       len = sizeof(s.addr_un);
 #endif
 
        if ( Options & osl_Pipe_CREATE )
@@ -238,7 +242,7 @@ oslPipe SAL_CALL osl_psz_createPipe(cons
                if ( ( stat(name, &status) == 0) &&
                         ( S_ISSOCK(status.st_mode) || S_ISFIFO(status.st_mode) 
) )
                {
-                       if ( connect(pPipe->m_Socket,(struct sockaddr 
*)&addr,len) >= 0 )
+                       if ( connect(pPipe->m_Socket,&s.addr,len) >= 0 )
                        {
                                OSL_TRACE("osl_createPipe : Pipe already in 
use. Errno: %d; %s\n",errno,strerror(errno));
                                close (pPipe->m_Socket);
@@ -250,7 +254,7 @@ oslPipe SAL_CALL osl_psz_createPipe(cons
                }
 
                /* ok, fs clean */
-               if ( bind(pPipe->m_Socket, (struct sockaddr *)&addr, len) < 0 )
+               if ( bind(pPipe->m_Socket, &s.addr, len) < 0 )
                {
                        OSL_TRACE("osl_createPipe : failed to bind socket. 
Errno: %d; %s\n",errno,strerror(errno));
                        close (pPipe->m_Socket);
@@ -282,7 +286,7 @@ oslPipe SAL_CALL osl_psz_createPipe(cons
        {   /* osl_pipe_OPEN */
                if ( access(name, F_OK) != -1 )
                {
-                       if ( connect( pPipe->m_Socket, (struct sockaddr 
*)&addr, len) >= 0 )
+                       if ( connect( pPipe->m_Socket, &s.addr, len) >= 0 )
                        {
                                return (pPipe);
                        }
@@ -321,7 +325,11 @@ void SAL_CALL osl_closePipe( oslPipe pPi
     int nRet;
 #if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     size_t        len;
-       struct sockaddr_un addr;
+    union
+    {
+           struct sockaddr_un addr_un;
+           struct sockaddr addr;
+    } s;
     int fd;
 #endif
     int ConnFD;
@@ -348,19 +356,19 @@ void SAL_CALL osl_closePipe( oslPipe pPi
         pPipe->m_bIsInShutdown = sal_True;
         pPipe->m_Socket = -1;
         fd = socket(AF_UNIX, SOCK_STREAM, 0);
-        memset(&addr, 0, sizeof(addr));
+        memset(&s.addr_un, 0, sizeof(s.addr_un));
 
         OSL_TRACE("osl_destroyPipe : Pipe Name '%s'",pPipe->m_Name);
 
-        addr.sun_family = AF_UNIX;
-        strncpy(addr.sun_path, pPipe->m_Name, sizeof(addr.sun_path));
+        s.addr_un.sun_family = AF_UNIX;
+        strncpy(s.addr_un.sun_path, pPipe->m_Name, sizeof(s.addr_un.sun_path));
 #if defined(FREEBSD)
-        len = SUN_LEN(&addr);
+        len = SUN_LEN(&s.addr_un);
 #else
-        len = sizeof(addr);
+        len = sizeof(s.addr_un);
 #endif
 
-        nRet = connect( fd, (struct sockaddr *)&addr, len);
+        nRet = connect( fd, &s.addr, len);
 #if OSL_DEBUG_LEVEL > 1
         if ( nRet < 0 )
         {

Modified: openoffice/trunk/main/sal/osl/unx/sockimpl.h
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/unx/sockimpl.h?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/unx/sockimpl.h (original)
+++ openoffice/trunk/main/sal/osl/unx/sockimpl.h Wed Feb  8 15:21:17 2017
@@ -55,7 +55,11 @@ struct oslSocketImpl {
 struct oslSocketAddrImpl
 {
        sal_Int32 m_nRefCount;
-       struct sockaddr m_sockaddr;
+    union
+    {
+        struct sockaddr m_sockaddr;
+        struct sockaddr_in m_sockaddr_in;
+    };
 };
 
 struct oslPipeImpl {

Modified: openoffice/trunk/main/sw/source/filter/xml/swxml.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/filter/xml/swxml.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/filter/xml/swxml.cxx (original)
+++ openoffice/trunk/main/sw/source/filter/xml/swxml.cxx Wed Feb  8 15:21:17 
2017
@@ -1084,7 +1084,6 @@ sal_uInt16 XMLReader::GetSectionList( Sf
                        {
                                // get filter
                                // #110680#
-                               // uno::Reference< xml::sax::XDocumentHandler > 
xFilter = new SwXMLSectionList( rStrings );
                                uno::Reference< xml::sax::XDocumentHandler > 
xFilter = new SwXMLSectionList( xServiceFactory, rStrings );
 
                                // connect parser and filter

Modified: openoffice/trunk/main/tools/source/stream/stream.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/tools/source/stream/stream.cxx?rev=1782205&r1=1782204&r2=1782205&view=diff
==============================================================================
--- openoffice/trunk/main/tools/source/stream/stream.cxx (original)
+++ openoffice/trunk/main/tools/source/stream/stream.cxx Wed Feb  8 15:21:17 
2017
@@ -91,7 +91,15 @@ inline static void SwapLongUInt( unsigne
 #ifdef UNX
 inline static void SwapFloat( float& r )
     {
-               *((sal_uInt32*)(void*)&r) = SWAPLONG( *((sal_uInt32*)(void*)&r) 
);
+          union
+          {
+              float f;
+              sal_uInt32 c;
+          } s;
+
+          s.f = r;
+          s.c = SWAPLONG( s.c );
+          r = s.f;
     }
 inline static void SwapDouble( double& r )
     {
@@ -101,12 +109,19 @@ inline static void SwapDouble( double& r
         }
         else
         {
-          sal_uInt32* c = (sal_uInt32*)(void*)&r;
-          c[0] ^= c[1]; // zwei 32-Bit-Werte in situ vertauschen
-          c[1] ^= c[0];
-          c[0] ^= c[1];
-          c[0] = SWAPLONG(c[0]); // und die beiden 32-Bit-Werte selbst in situ 
drehen
-          c[1] = SWAPLONG(c[1]);
+          union
+          {
+              double d;
+              sal_uInt32 c[2];
+          } s;
+
+          s.d = r;
+          s.c[0] ^= s.c[1]; // zwei 32-Bit-Werte in situ vertauschen
+          s.c[1] ^= s.c[0];
+          s.c[0] ^= s.c[1];
+          s.c[0] = SWAPLONG(s.c[0]); // und die beiden 32-Bit-Werte selbst in 
situ drehen
+          s.c[1] = SWAPLONG(s.c[1]);
+          r = s.d;
         }
     }
 #endif


Reply via email to