summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-13 12:03:03 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-13 13:34:44 +0200
commit647382f52351a7586459201203e399956b763527 (patch)
treec7174243a55cd50865c1700cf956f95ab2ea4dd4 /sal
parent51bb68928933bf5d72efb9193f1be6af6e72c80f (diff)
These arguments can apparently never be null
Fixing 7b4f4f15971047664fa278fff96b959d53b272b3 "osl: followup to 7c6ccc42 for w32/unx file.cxx" for good... Change-Id: Icedaaa0b0f909d802dbdcf4fdaa40fd338bcbf11 Reviewed-on: https://gerrit.libreoffice.org/39892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file.cxx10
-rw-r--r--sal/osl/w32/file.cxx8
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);
}