[Libreoffice-commits] core.git: sal/osl
Chris Sherlock
chris.sherlock79 at gmail.com
Thu Jul 6 13:50:31 UTC 2017
sal/osl/unx/tempfile.cxx | 7 +++++--
sal/osl/w32/tempfile.cxx | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 4b7b93be530dd5b7924588fbc5855c6fd057984c
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Wed Jul 5 12:58:10 2017 +1000
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 at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
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;
More information about the Libreoffice-commits
mailing list