diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-07-05 12:58:10 +1000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-07-06 15:50:03 +0200 |
commit | 4b7b93be530dd5b7924588fbc5855c6fd057984c (patch) | |
tree | f0e1e7bfd70a5b5b142ff915ea8ef270401532b4 | |
parent | f396f02dd02ef0e921060240bd19d3ad87813bf5 (diff) |
tdf#43157 - osl: convert OSL_ASSERT in unx & w32 tempfile.cxx
Change-Id: I243a5dc4061844af95eae83347ddb15ea7134c0c
Reviewed-on: https://gerrit.libreoffice.org/39542
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r-- | sal/osl/unx/tempfile.cxx | 7 | ||||
-rw-r--r-- | sal/osl/w32/tempfile.cxx | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx index 4894fa43154a..5ba94ded4daa 100644 --- a/sal/osl/unx/tempfile.cxx +++ b/sal/osl/unx/tempfile.cxx @@ -32,6 +32,8 @@ #include "file_url.hxx" #include "file_impl.hxx" +#include <cassert> + oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir ) { oslFileError error; @@ -49,7 +51,7 @@ oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir ) pValue = "/tmp"; rtl_string2UString( &ustrTempPath, pValue, strlen( pValue ), osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS ); - OSL_ASSERT(ustrTempPath != nullptr); + assert(ustrTempPath); error = osl_getFileURLFromSystemPath( ustrTempPath, pustrTempDir ); rtl_uString_release( ustrTempPath ); @@ -97,7 +99,8 @@ static void osl_gen_random_name_impl_(rtl_uString** rand_name) RAND_NAME_LENGTH, RTL_TEXTENCODING_ASCII_US, OSTRING_TO_OUSTRING_CVTFLAGS); - OSL_ASSERT(*rand_name != nullptr); + + assert(*rand_name); } /***************************************************************** diff --git a/sal/osl/w32/tempfile.cxx b/sal/osl/w32/tempfile.cxx index ec50b7ec115d..d69491324931 100644 --- a/sal/osl/w32/tempfile.cxx +++ b/sal/osl/w32/tempfile.cxx @@ -32,6 +32,7 @@ #include <malloc.h> #include <tchar.h> +#include <cassert> // Allocate n number of t's on the stack return a pointer to it in p #define STACK_ALLOC(p, t, n) __try {(p) = static_cast<t*>(_alloca((n)*sizeof(t)));} \ @@ -116,7 +117,7 @@ static bool osl_win32_CreateFile_impl_( DWORD flags = FILE_ATTRIBUTE_NORMAL; HANDLE hFile; - OSL_ASSERT(p_handle); + assert(p_handle); if (b_delete_on_close) flags |= FILE_FLAG_DELETE_ON_CLOSE; |