Kaydet (Commit) 4e3cf9cd authored tarafından Michael Stahl's avatar Michael Stahl

MSVC helpfully provides warning C4310: cast truncates constant value

Change-Id: I985216d7bade6cbb3a037b07fe44438543d63ba0
üst 0dd6d4ed
......@@ -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 );
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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)
......
......@@ -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 )
......
......@@ -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() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment