Kaydet (Commit) 7b4f4f15 authored tarafından Chris Sherlock's avatar Chris Sherlock

osl: followup to 7c6ccc42 for w32/unx file.cxx

As pointed out by sberg, either the issue is a programming error that
needs an assert, or the issue is unusual and should just generated a
warning, but never both.

Change-Id: I07ae1e99597cd6c342791aa268b2240db987ae91
Reviewed-on: https://gerrit.libreoffice.org/39514Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst 3329d220
......@@ -201,7 +201,6 @@ 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 && pnSize);
if ((ppBuffer) && (pnSize))
{
*ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
......
......@@ -181,7 +181,6 @@ 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) && (pnSize));
*ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
*pnSize = m_bufsiz;
......@@ -197,14 +196,12 @@ FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex)
: m_mutex (pMutex)
{
SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::Guard(): null pointer.");
assert(m_mutex);
::EnterCriticalSection (m_mutex);
}
FileHandle_Impl::Guard::~Guard()
{
SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::~Guard(): null pointer.");
assert(m_mutex);
::LeaveCriticalSection (m_mutex);
}
......
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