Index: inc/vcompat.hxx
===================================================================
RCS file: /cvs/util/tools/inc/vcompat.hxx,v
retrieving revision 1.3
retrieving revision 1.3.64.1
diff -u -r1.3 -r1.3.64.1
--- inc/vcompat.hxx	9 Sep 2005 14:03:40 -0000	1.3
+++ inc/vcompat.hxx	24 Feb 2006 10:37:41 -0000	1.3.64.1
@@ -48,10 +48,10 @@
 // -----------
 
 #define COMPAT_FORMAT( char1, char2, char3, char4 ) \
-	((ULONG)((((ULONG)(char)(char1)))|				\
-	(((ULONG)(char)(char2))<<8UL)|					\
-	(((ULONG)(char)(char3))<<16UL)|					\
-	((ULONG)(char)(char4))<<24UL))
+	((UINT32)((((UINT32)(char)(char1)))|				\
+	(((UINT32)(char)(char2))<<8UL)|					\
+	(((UINT32)(char)(char3))<<16UL)|					\
+	((UINT32)(char)(char4))<<24UL))
 
 // --------------
 // - ImplCompat -
Index: source/inet/inetmsg.cxx
===================================================================
RCS file: /cvs/util/tools/source/inet/inetmsg.cxx,v
retrieving revision 1.6
retrieving revision 1.6.64.1
diff -u -r1.6 -r1.6.64.1
--- source/inet/inetmsg.cxx	9 Sep 2005 14:23:24 -0000	1.6
+++ source/inet/inetmsg.cxx	24 Feb 2006 10:37:41 -0000	1.6.64.1
@@ -170,11 +170,11 @@
  */
 SvStream& INetMessage::operator<< (SvStream& rStrm) const
 {
-    rStrm << m_nDocSize;
+    rStrm << static_cast<sal_uInt32>(m_nDocSize);
     rStrm.WriteByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
 
     ULONG i, n = m_aHeaderList.Count();
-    rStrm << n;
+    rStrm << static_cast<sal_uInt32>(n);
 
     for (i = 0; i < n; i++)
         rStrm << *((HEADERFIELD *)(m_aHeaderList.GetObject(i)));
@@ -192,12 +192,16 @@
     m_xDocLB.Clear();
     ListCleanup_Impl();
 
+    sal_uInt32 nTemp;
+
     // Copy.
-    rStrm >> m_nDocSize;
+    rStrm >> nTemp;
+    m_nDocSize = nTemp;
     rStrm.ReadByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
 
     ULONG i, n = 0;
-    rStrm >> n;
+    rStrm >> nTemp;
+    n = nTemp;
 
     for (i = 0; i < n; i++)
     {
@@ -935,7 +939,7 @@
     INetMessage::operator<< (rStrm);
 
     for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
-        rStrm << m_nIndex[i];
+        rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
 
     return rStrm;
 }
@@ -947,8 +951,12 @@
 {
     INetMessage::operator>> (rStrm);
 
+    sal_uInt32 nTemp;
     for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
-        rStrm >> m_nIndex[i];
+    {
+        rStrm >> nTemp;
+        m_nIndex[i] = nTemp;
+    }
 
     return rStrm;
 }
@@ -1618,14 +1626,14 @@
     INetRFC822Message::operator<< (rStrm);
 
     for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
-        rStrm << m_nIndex[i];
+        rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
 
 #ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
     rStrm << m_aBoundary;
 #else
     rStrm.WriteByteString (m_aBoundary);
 #endif
-    rStrm << nNumChildren;
+    rStrm << static_cast<sal_uInt32>(nNumChildren);
 
     return rStrm;
 }
@@ -1637,15 +1645,20 @@
 {
     INetRFC822Message::operator>> (rStrm);
 
+    sal_uInt32 nTemp;
     for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
-        rStrm >> m_nIndex[i];
+    {
+        rStrm >> nTemp;
+        m_nIndex[i] = nTemp;
+    }
 
 #ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
     rStrm >> m_aBoundary;
 #else
     rStrm.ReadByteString (m_aBoundary);
 #endif
-    rStrm >> nNumChildren;
+    rStrm >> nTemp;
+    nNumChildren = nTemp;
 
     return rStrm;
 }
Index: source/ref/pstm.cxx
===================================================================
RCS file: /cvs/util/tools/source/ref/pstm.cxx,v
retrieving revision 1.4
retrieving revision 1.4.62.1
diff -u -r1.4 -r1.4.62.1
--- source/ref/pstm.cxx	9 Sep 2005 14:32:20 -0000	1.4
+++ source/ref/pstm.cxx	24 Feb 2006 10:37:41 -0000	1.4.62.1
@@ -143,7 +143,7 @@
 	if( nVer & PERSIST_LIST_DBGUTIL )
 		nObjLen = rStm.ReadLen( &nObjPos );
 
-	ULONG nCount;
+	sal_uInt32 nCount;
 	rStm >> nCount;
 	for( ULONG n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ )
 	{
Index: source/stream/stream.cxx
===================================================================
RCS file: /cvs/util/tools/source/stream/stream.cxx,v
retrieving revision 1.21
retrieving revision 1.21.54.1
diff -u -r1.21 -r1.21.54.1
--- source/stream/stream.cxx	6 Oct 2005 11:05:01 -0000	1.21
+++ source/stream/stream.cxx	1 Mar 2006 11:58:13 -0000	1.21.54.1
@@ -86,10 +86,6 @@
     {   r = SWAPSHORT(r);   }
 inline static void SwapShort( short& r )
     {   r = SWAPSHORT(r);   }
-inline static void SwapInt( int& r )
-    {   r = SWAPSHORT(r);   }
-inline static void SwapUInt( unsigned int& r )
-    {   r = SWAPSHORT(r);   }
 inline static void SwapLong( long& r )
     {   r = SWAPLONG(r);   }
 inline static void SwapULong( sal_uInt32& r )
@@ -152,7 +148,7 @@
 if( (tmp == STREAM_IO_READ) && sizeof(datatype)<=nBufFree) \
 {\
     for (int i = 0; i < sizeof(datatype); i++)\
-        ((char *)&r)[i] = pBufPos[i];\
+        ((char *)&value)[i] = pBufPos[i];\
     nBufActualPos += sizeof(datatype);\
     pBufPos += sizeof(datatype);\
     nBufFree -= sizeof(datatype);\
@@ -1212,11 +1208,9 @@
 SvStream& SvStream::operator >> ( long& r )
 {
 #if(SAL_TYPES_SIZEOFLONG != 4)
-    unsigned int tmp = r;
-    READNUMBER_WITHOUT_SWAP(long,tmp)
+    int tmp = r;
+    *this >> tmp;
     r = tmp;
-    if( bSwap )
-        SwapLong(r);
 #else
     READNUMBER_WITHOUT_SWAP(long,r)
     if( bSwap )
@@ -1355,9 +1349,7 @@
 {
 #if(SAL_TYPES_SIZEOFLONG != 4)
     int tmp = v;
-    if( bSwap )
-        SwapInt(tmp);
-    WRITENUMBER_WITHOUT_SWAP(int,tmp)
+    *this << tmp;
 #else
     if( bSwap )
         SwapLong(v);
