Kaydet (Commit) 34d8710f authored tarafından Noel Grandin's avatar Noel Grandin

remove local copies of std::min,std::max

Change-Id: I067c4dcabad55180e4734fb06338a8e843713936
Reviewed-on: https://gerrit.libreoffice.org/47692Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e9f521d4
......@@ -527,8 +527,8 @@ sal_Int32 OMarkableInputStream::readSomeBytes(Sequence< sal_Int8 >& aData, sal_I
// read from buffer
sal_Int32 nRead = 0;
sal_Int32 nInBuffer = m_pBuffer->getSize() - m_nCurrentPos;
sal_Int32 nAdditionalBytesToRead = Min(nMaxBytesToRead-nInBuffer,m_input->available());
nAdditionalBytesToRead = Max(0 , nAdditionalBytesToRead );
sal_Int32 nAdditionalBytesToRead = std::min<sal_Int32>(nMaxBytesToRead-nInBuffer,m_input->available());
nAdditionalBytesToRead = std::max<sal_Int32>(0 , nAdditionalBytesToRead );
// read enough bytes into buffer
if( 0 == nInBuffer ) {
......@@ -543,7 +543,7 @@ sal_Int32 OMarkableInputStream::readSomeBytes(Sequence< sal_Int8 >& aData, sal_I
m_pBuffer->writeAt( m_pBuffer->getSize() , aData );
}
nBytesRead = Min( nMaxBytesToRead , nInBuffer + nRead );
nBytesRead = std::min( nMaxBytesToRead , nInBuffer + nRead );
// now take everything from buffer !
m_pBuffer->readAt( m_nCurrentPos , aData , nBytesRead );
......
......@@ -159,7 +159,7 @@ sal_Int32 OPipeImpl::readSomeBytes(Sequence< sal_Int8 >& aData, sal_Int32 nMaxBy
}
if( m_pFIFO->getSize() )
{
sal_Int32 nSize = Min( nMaxBytesToRead , m_pFIFO->getSize() );
sal_Int32 nSize = std::min( nMaxBytesToRead , m_pFIFO->getSize() );
aData.realloc( nSize );
m_pFIFO->read( aData , nSize );
return nSize;
......@@ -197,7 +197,7 @@ void OPipeImpl::skipBytes(sal_Int32 nBytesToSkip)
}
m_nBytesToSkip += nBytesToSkip;
nBytesToSkip = Min( m_pFIFO->getSize() , m_nBytesToSkip );
nBytesToSkip = std::min( m_pFIFO->getSize() , m_nBytesToSkip );
m_pFIFO->skip( nBytesToSkip );
m_nBytesToSkip -= nBytesToSkip;
}
......
......@@ -148,7 +148,7 @@ void MemRingBuffer::writeAt( sal_Int32 nPos, const Sequence<sal_Int8> &seq )
// one area copy
memcpy( &( m_p[nStartWritingIndex]), seq.getConstArray() , nLen );
}
m_nOccupiedBuffer = Max( nPos + seq.getLength() , m_nOccupiedBuffer );
m_nOccupiedBuffer = std::max( nPos + seq.getLength() , m_nOccupiedBuffer );
checkInvariants();
}
......
......@@ -24,9 +24,6 @@
#include <assert.h>
#define Max( a, b ) (((a)>(b)) ? (a) : (b) )
#define Min( a, b ) (((a)<(b)) ? (a) : (b) )
namespace io_stm
{
......
......@@ -60,9 +60,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::linguistic2;
using namespace linguistic;
// min, max
#define Max(a,b) (a > b ? a : b)
Hyphenator::Hyphenator() :
aEvtListeners ( GetLinguMutex() )
{
......@@ -364,8 +361,8 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo
{
const bool bFailed = 0 != hnj_hyphen_hyphenate3( dict, lcword.get(), n, hyphens.get(), nullptr,
&rep, &pos, &cut, minLead, minTrail,
Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2))) );
std::max<sal_Int16>(dict->clhmin, std::max<sal_Int16>(dict->clhmin, 2) + std::max(0, minLead - std::max<sal_Int16>(dict->lhmin, 2))),
std::max<sal_Int16>(dict->crhmin, std::max<sal_Int16>(dict->crhmin, 2) + std::max(0, minTrail - std::max<sal_Int16>(dict->rhmin, 2))) );
if (bFailed)
{
// whoops something did not work
......@@ -600,8 +597,8 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
{
const bool bFailed = 0 != hnj_hyphen_hyphenate3(dict, lcword.get(), n, hyphens.get(), nullptr,
&rep, &pos, &cut, minLead, minTrail,
Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2))) );
std::max<sal_Int16>(dict->clhmin, std::max<sal_Int16>(dict->clhmin, 2) + std::max(0, minLead - std::max<sal_Int16>(dict->lhmin, 2))),
std::max<sal_Int16>(dict->crhmin, std::max<sal_Int16>(dict->crhmin, 2) + std::max(0, minTrail - std::max<sal_Int16>(dict->rhmin, 2))) );
if (bFailed)
{
if (rep)
......
......@@ -309,8 +309,6 @@ void FileStreamWrapper_Impl::checkError()
#define COMMIT_RESULT_NOTHING_TO_DO 1
#define COMMIT_RESULT_SUCCESS 2
#define min( x, y ) (( x < y ) ? x : y)
SotClipboardFormatId GetFormatId_Impl( const SvGlobalName& aName )
{
if ( aName == SvGlobalName( SO3_SW_CLASSID_60 ) )
......@@ -803,7 +801,7 @@ sal_uInt64 UCBStorageStream_Impl::ReadSourceWriteTemporary(sal_uInt64 aLength)
for (sal_uInt64 nInd = 0; nInd < aLength && aReaded == 32000 ; nInd += 32000)
{
sal_uLong aToCopy = min( aLength - nInd, 32000 );
sal_uLong aToCopy = std::min<sal_uInt64>( aLength - nInd, 32000 );
aReaded = m_rSource->readBytes( aData, aToCopy );
aResult += m_pStream->WriteBytes(aData.getArray(), aReaded);
}
......
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