Kaydet (Commit) 4b7b93be authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Michael Meeks

tdf#43157 - osl: convert OSL_ASSERT in unx & w32 tempfile.cxx

Change-Id: I243a5dc4061844af95eae83347ddb15ea7134c0c
Reviewed-on: https://gerrit.libreoffice.org/39542Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst f396f02d
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "file_url.hxx" #include "file_url.hxx"
#include "file_impl.hxx" #include "file_impl.hxx"
#include <cassert>
oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir ) oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir )
{ {
oslFileError error; oslFileError error;
...@@ -49,7 +51,7 @@ oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir ) ...@@ -49,7 +51,7 @@ oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir )
pValue = "/tmp"; pValue = "/tmp";
rtl_string2UString( &ustrTempPath, pValue, strlen( pValue ), osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS ); rtl_string2UString( &ustrTempPath, pValue, strlen( pValue ), osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
OSL_ASSERT(ustrTempPath != nullptr); assert(ustrTempPath);
error = osl_getFileURLFromSystemPath( ustrTempPath, pustrTempDir ); error = osl_getFileURLFromSystemPath( ustrTempPath, pustrTempDir );
rtl_uString_release( ustrTempPath ); rtl_uString_release( ustrTempPath );
...@@ -97,7 +99,8 @@ static void osl_gen_random_name_impl_(rtl_uString** rand_name) ...@@ -97,7 +99,8 @@ static void osl_gen_random_name_impl_(rtl_uString** rand_name)
RAND_NAME_LENGTH, RAND_NAME_LENGTH,
RTL_TEXTENCODING_ASCII_US, RTL_TEXTENCODING_ASCII_US,
OSTRING_TO_OUSTRING_CVTFLAGS); OSTRING_TO_OUSTRING_CVTFLAGS);
OSL_ASSERT(*rand_name != nullptr);
assert(*rand_name);
} }
/***************************************************************** /*****************************************************************
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <malloc.h> #include <malloc.h>
#include <tchar.h> #include <tchar.h>
#include <cassert>
// Allocate n number of t's on the stack return a pointer to it in p // 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)));} \ #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_( ...@@ -116,7 +117,7 @@ static bool osl_win32_CreateFile_impl_(
DWORD flags = FILE_ATTRIBUTE_NORMAL; DWORD flags = FILE_ATTRIBUTE_NORMAL;
HANDLE hFile; HANDLE hFile;
OSL_ASSERT(p_handle); assert(p_handle);
if (b_delete_on_close) if (b_delete_on_close)
flags |= FILE_FLAG_DELETE_ON_CLOSE; flags |= FILE_FLAG_DELETE_ON_CLOSE;
......
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