From 34d8710fff4859d455b51a7e0d90fe3a35bf2e6b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 9 Jan 2018 13:28:35 +0200 Subject: remove local copies of std::min,std::max Change-Id: I067c4dcabad55180e4734fb06338a8e843713936 Reviewed-on: https://gerrit.libreoffice.org/47692 Tested-by: Jenkins Reviewed-by: Noel Grandin --- io/source/stm/omark.cxx | 6 +++--- io/source/stm/opipe.cxx | 4 ++-- io/source/stm/streamhelper.cxx | 2 +- io/source/stm/streamhelper.hxx | 3 --- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'io') diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx index fa0e0ae2cb80..a49ea4df7015 100644 --- a/io/source/stm/omark.cxx +++ b/io/source/stm/omark.cxx @@ -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(nMaxBytesToRead-nInBuffer,m_input->available()); + nAdditionalBytesToRead = std::max(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 ); diff --git a/io/source/stm/opipe.cxx b/io/source/stm/opipe.cxx index afdc92feef54..1065629f91f9 100644 --- a/io/source/stm/opipe.cxx +++ b/io/source/stm/opipe.cxx @@ -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; } diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx index efe53dcc42ab..ffd1726c6754 100644 --- a/io/source/stm/streamhelper.cxx +++ b/io/source/stm/streamhelper.cxx @@ -148,7 +148,7 @@ void MemRingBuffer::writeAt( sal_Int32 nPos, const Sequence &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(); } diff --git a/io/source/stm/streamhelper.hxx b/io/source/stm/streamhelper.hxx index c03673d6f4df..94d7c60a75bc 100644 --- a/io/source/stm/streamhelper.hxx +++ b/io/source/stm/streamhelper.hxx @@ -24,9 +24,6 @@ #include -#define Max( a, b ) (((a)>(b)) ? (a) : (b) ) -#define Min( a, b ) (((a)<(b)) ? (a) : (b) ) - namespace io_stm { -- cgit