From 4e3cf9cd8eb4602883339e5c9b9d4edcf05929d0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sun, 30 Mar 2014 23:08:54 +0200 Subject: MSVC helpfully provides warning C4310: cast truncates constant value Change-Id: I985216d7bade6cbb3a037b07fe44438543d63ba0 --- basic/source/runtime/iosys.cxx | 2 +- sot/source/sdstor/stgstrms.cxx | 2 +- sot/source/sdstor/ucbstorage.cxx | 2 +- svl/source/misc/strmadpt.cxx | 4 ++-- tools/source/stream/stream.cxx | 6 +++--- tools/source/stream/strmwnt.cxx | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 43942b8d9426..be07963fd2a8 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -375,7 +375,7 @@ sal_uInt64 OslStream::SeekPos( sal_uInt64 nPos ) { ::osl::FileBase::RC rc = ::osl::FileBase::E_None; // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); if( nPos == STREAM_SEEK_TO_END ) { rc = maFile.setPos( osl_Pos_End, 0 ); diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 214b32ebda52..62118b8a427c 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1284,7 +1284,7 @@ sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n ) sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(n != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(n != SAL_MAX_UINT32); if( n == STREAM_SEEK_TO_END ) n = GetSize(); if( n && n > THRESHOLD && !pStrm ) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index deb5303eb1b4..b26a355f395d 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -942,7 +942,7 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) sal_uInt64 UCBStorageStream_Impl::SeekPos(sal_uInt64 const nPos) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); if( !Init() ) return 0; diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index bc7eaac93ca2..8023efb476c4 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -449,7 +449,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) return 0; } // check if a truncated STREAM_SEEK_TO_END was passed - assert(m_nSeekedFrom != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(m_nSeekedFrom != SAL_MAX_UINT32); sal_uInt32 nRead = 0; if (m_xSeekable.is()) { @@ -551,7 +551,7 @@ void SvInputStream::FlushData() sal_uInt64 SvInputStream::SeekPos(sal_uInt64 const nPos) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); if (open()) { if (nPos == STREAM_SEEK_TO_END) diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index a8ce39c5d63b..7a41595ccf61 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -309,7 +309,7 @@ ErrCode SvAsyncLockBytes::FillAppend(const void * pBuffer, sal_Size nCount, sal_uInt64 SvAsyncLockBytes::Seek(sal_uInt64 const nPos) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); if (nPos != STREAM_SEEK_TO_END) m_nSize = nPos; return m_nSize; @@ -346,7 +346,7 @@ sal_Size SvStream::PutData( const void* pData, sal_Size nSize ) sal_uInt64 SvStream::SeekPos(sal_uInt64 const nPos) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); if( !GetError() && nPos == STREAM_SEEK_TO_END ) { DBG_ASSERT( xLockBytes.Is(), "pure virtual function" ); @@ -1843,7 +1843,7 @@ sal_uInt64 SvMemoryStream::SeekPos(sal_uInt64 const nNewPos) // nSize: Size of allocated buffer // check if a truncated STREAM_SEEK_TO_END was passed - assert(nNewPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nNewPos != SAL_MAX_UINT32); if( nNewPos < nEndOfData ) nPos = nNewPos; else if( nNewPos == STREAM_SEEK_TO_END ) diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index ad4f1336339b..8989921effcf 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -163,7 +163,7 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos) { // check if a truncated STREAM_SEEK_TO_END was passed - assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END); + assert(nPos != SAL_MAX_UINT32); DWORD nNewPos = 0; if( IsOpen() ) { -- cgit