diff options
-rw-r--r-- | sal/osl/unx/file.cxx | 10 | ||||
-rw-r--r-- | sal/osl/w32/file.cxx | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index f95651dab55a..17790211b02d 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -200,12 +200,10 @@ FileHandle_Impl::Allocator::~Allocator() void FileHandle_Impl::Allocator::allocate(sal_uInt8 **ppBuffer, size_t *pnSize) { - SAL_WARN_IF((!ppBuffer) || (!pnSize), "sal.osl", "FileHandle_Impl::Allocator::allocate(): contract violation"); - if (ppBuffer && pnSize) - { - *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)); - *pnSize = m_bufsiz; - } + assert(ppBuffer != nullptr); + assert(pnSize != nullptr); + *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)); + *pnSize = m_bufsiz; } void FileHandle_Impl::Allocator::deallocate(sal_uInt8 * pBuffer) diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index f49076ed4970..3738683402af 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -31,6 +31,7 @@ #include "file_url.hxx" #include "file_error.hxx" +#include <cassert> #include <cstdio> #include <algorithm> #include <limits> @@ -180,9 +181,9 @@ FileHandle_Impl::Allocator::~Allocator() void FileHandle_Impl::Allocator::allocate (sal_uInt8 **ppBuffer, SIZE_T * pnSize) { - SAL_WARN_IF((!ppBuffer) || (!pnSize), "sal.osl", "FileHandle_Impl::Allocator::allocate(): contract violation"); + assert(ppBuffer != nullptr); + assert(pnSize != nullptr); *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)); - *pnSize = m_bufsiz; } @@ -195,13 +196,12 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer) FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex) : m_mutex (pMutex) { - SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::Guard(): null pointer."); + assert(pMutex != nullptr); ::EnterCriticalSection (m_mutex); } FileHandle_Impl::Guard::~Guard() { - SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::~Guard(): null pointer."); ::LeaveCriticalSection (m_mutex); } |