Author: damjan Date: Mon Mar 5 20:19:07 2018 New Revision: 1825937 URL: http://svn.apache.org/viewvc?rev=1825937&view=rev Log: Fix use of ::std::min and ::std::max on types of different sizes.
Patch by: me Modified: openoffice/trunk/main/sal/osl/w32/file.cxx Modified: openoffice/trunk/main/sal/osl/w32/file.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/w32/file.cxx?rev=1825937&r1=1825936&r2=1825937&view=diff ============================================================================== --- openoffice/trunk/main/sal/osl/w32/file.cxx (original) +++ openoffice/trunk/main/sal/osl/w32/file.cxx Mon Mar 5 20:19:07 2018 @@ -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::writeFileA 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;