diff options
author | Damjan Jovanovic <damjan@apache.org> | 2018-03-05 20:19:07 +0000 |
---|---|---|
committer | Damjan Jovanovic <damjan@apache.org> | 2018-03-05 20:19:07 +0000 |
commit | dc344511236f5698afd1c002be1ef050ab37c877 (patch) | |
tree | fa353f2ad8c4ee237dd18546577854e3e0865724 | |
parent | d9da41596ac929c64e10337ef08f54dbcf4fca80 (diff) |
Fix use of ::std::min and ::std::max
on types of different sizes.
Patch by: me
Notes
Notes:
prefer: 7e86fc3fe72f67b0d9240b4afad28c66dc482c80
-rw-r--r-- | sal/osl/w32/file.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index 9321ab4a8a19..9bfb08e25915 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -420,7 +420,7 @@ oslFileError FileHandle_Impl::readFileAt ( return osl_File_E_None; } - SIZE_T const bytes = std::min(m_buflen - bufpos, nBytesRequested); + SIZE_T const bytes = std::min(m_buflen - bufpos, (SIZE_T)nBytesRequested); memcpy (&(buffer[*pBytesRead]), &(m_buffer[bufpos]), bytes); nBytesRequested -= bytes, *pBytesRead += bytes, nOffset += bytes; } @@ -490,7 +490,7 @@ oslFileError FileHandle_Impl::writeFileAt ( m_bufptr = bufptr, m_buflen = sal::static_int_cast< SIZE_T >(uDone); } - SIZE_T const bytes = std::min(m_bufsiz - bufpos, nBytesToWrite); + SIZE_T const bytes = std::min(m_bufsiz - bufpos, (SIZE_T)nBytesToWrite); memcpy (&(m_buffer[bufpos]), &(buffer[*pBytesWritten]), bytes); nBytesToWrite -= bytes, *pBytesWritten += bytes, nOffset += bytes; |