From b42094b2b06f4837a6df65e6b87caf8139fc0d0d Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Fri, 14 Sep 2012 01:42:30 -0500 Subject: remove use of SAL_MIN() macro Change-Id: Ia91118388240c9a54d010b94aef34ad528ce5761 --- store/source/stordata.hxx | 4 ++-- store/source/storlckb.cxx | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'store') diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index cbf5cd2b46f3..cbd004482e47 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -732,11 +732,11 @@ public: return rtl_crc32 (nPath, pszName, rtl_str_getLength(pszName)); } - sal_Size getName (sal_Char * pBuffer, sal_Size nBufsiz) const + sal_Size getName (sal_Char * pBuffer, sal_Size nBufsize) const { sal_Char const * pszName = PAGE().m_aNameBlock.m_pData; sal_Size nLength = rtl_str_getLength(pszName); - memcpy (pBuffer, pszName, SAL_MIN(nLength, nBufsiz)); + memcpy (pBuffer, pszName, nLength < nBufsize ? nLength : nBufsize); return nLength; } diff --git a/store/source/storlckb.cxx b/store/source/storlckb.cxx index f9c0ff24efa3..539bf3707cac 100644 --- a/store/source/storlckb.cxx +++ b/store/source/storlckb.cxx @@ -167,8 +167,10 @@ storeError OStoreLockBytes::readAt ( nOffset, m_xNode->capacity()); sal_uInt32 nLength = sal_uInt32(aDescr.m_nLength); - nLength = SAL_MIN(nLength, nBytes); - + if(nLength > nBytes) + { + nLength = nBytes; + } memcpy ( &pData[rnDone], &m_xNode->m_pData[aDescr.m_nOffset], @@ -186,7 +188,10 @@ storeError OStoreLockBytes::readAt ( nOffset - m_xNode->capacity(), OStoreDataPageData::capacity(m_xNode->m_aDescr)); // @@@ sal_uInt32 nLength = sal_uInt32(aDescr.m_nLength); - nLength = SAL_MIN(nLength, nBytes); + if(nLength > nBytes) + { + nLength = nBytes; + } storeError eErrCode = aPage.read (aDescr.m_nPage, aData, *m_xManager); if (eErrCode != store_E_None) @@ -259,7 +264,10 @@ storeError OStoreLockBytes::writeAt ( nOffset, m_xNode->capacity()); sal_uInt32 nLength = sal_uInt32(aDescr.m_nLength); - nLength = SAL_MIN(nLength, nBytes); + if(nLength > nBytes) + { + nLength = nBytes; + } memcpy ( &m_xNode->m_pData[aDescr.m_nOffset], @@ -312,7 +320,10 @@ storeError OStoreLockBytes::writeAt ( } // Modify data page. - nLength = SAL_MIN(nLength, nBytes); + if(nLength > nBytes) + { + nLength = nBytes; + } memcpy ( &xData->m_pData[aDescr.m_nOffset], &pData[rnDone], nLength); -- cgit