diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-01-09 13:15:32 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-01-09 13:44:23 +0100 |
commit | 4eae9d19cce5356d536ae509861a5c95f65aea4a (patch) | |
tree | 2674c54e3088a38097abffa726a02e7ccf193ef8 /sal | |
parent | 4356aef48a8fcbd9dd019c0ca2d6a189d7332d0c (diff) |
sal: remove OSL_ENSURE_FILE, better use SAL_LOG/SAL_INFO
Change-Id: I43d77cbf572acc4c27785990e28b43b35d71c96d
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file_error.c | 21 | ||||
-rw-r--r-- | sal/osl/w32/file_error.h | 8 | ||||
-rw-r--r-- | sal/osl/w32/file_url.cxx | 26 |
3 files changed, 12 insertions, 43 deletions
diff --git a/sal/osl/w32/file_error.c b/sal/osl/w32/file_error.c index 3bb2e49def9d..3697c9d15862 100644 --- a/sal/osl/w32/file_error.c +++ b/sal/osl/w32/file_error.c @@ -122,25 +122,4 @@ oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError) return osl_File_E_INVAL; } -//##################################################### -#if OSL_DEBUG_LEVEL > 0 -void _osl_warnFile( const char *message, rtl_uString *ustrFile ) -{ - char szBuffer[2048]; - - if (ustrFile) - { - rtl_String *strFile = NULL; - - rtl_uString2String( &strFile, rtl_uString_getStr( ustrFile ), rtl_uString_getLength( ustrFile ), - osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS ); - snprintf( szBuffer, sizeof(szBuffer), message, strFile->buffer ); - rtl_string_release( strFile ); - - message = szBuffer; - } - OSL_FAIL( message ); -} -#endif /* OSL_DEBUG_LEVEL */ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/w32/file_error.h b/sal/osl/w32/file_error.h index d134e67960d2..d31f1f842b79 100644 --- a/sal/osl/w32/file_error.h +++ b/sal/osl/w32/file_error.h @@ -21,7 +21,6 @@ #define INCLUDED_OSL_FILE_ERROR_H #include "osl/file.h" -#include "rtl/ustring.h" #ifdef __cplusplus extern "C" { @@ -29,13 +28,6 @@ extern "C" { oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError); -#if OSL_DEBUG_LEVEL > 0 -void _osl_warnFile (const char * message, rtl_uString * ustrFile); -#define OSL_ENSURE_FILE( cond, msg, file ) ( (cond) ? (void)0 : _osl_warnFile( msg, file ) ) -#else -#define OSL_ENSURE_FILE( cond, msg, file ) ((void)0) -#endif - #ifdef __cplusplus } #endif diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 51f132865d4e..233b56e62bee 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -711,10 +711,11 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p /* If the length of strUTF8 and strURL differs it indicates that the URL was not correct encoded */ - OSL_ENSURE_FILE( - strUTF8->length == strURL->length || - 0 != rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\\\", 7 ) - ,"osl_getSystemPathFromFileURL: \"%s\" is not encoded !!!", strURL ); + SAL_WARN_IF( + strUTF8->length != strURL->length && + 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\\\", 7 ) + , "sal.osl" + ,"osl_getSystemPathFromFileURL: \"" << strURL << "\" is not encoded !!!"); bValidEncoded = _osl_decodeURL( strUTF8, &strDecodedURL ); @@ -809,10 +810,9 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p if ( IsValidFilePath( strTempPath, NULL, VALIDATEPATH_ALLOW_RELATIVE | VALIDATEPATH_ALLOW_ELLIPSE, &strTempPath ) ) nError = osl_File_E_None; } - /* - else - OSL_ENSURE_FILE( !nError, "osl_getSystemPathFromFileURL: \"%s\" is not an absolute FileURL !!!", strURL ); - */ + else + SAL_INFO_IF(nError, "sal.osl", + "osl_getSystemPathFromFileURL: \"" << strURL << "\" is not an absolute FileURL"); } @@ -825,9 +825,8 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p if ( strTempPath ) rtl_uString_release( strTempPath ); - /* - OSL_ENSURE_FILE( !nError, "osl_getSystemPathFromFileURL: \"%s\" is not a FileURL !!!", strURL ); - */ + SAL_INFO_IF(nError, "sal.osl", + "osl_getSystemPathFromFileURL: \"" << strURL << "\" is not a FileURL"); return nError; } @@ -933,9 +932,8 @@ oslFileError _osl_getFileURLFromSystemPath( rtl_uString* strPath, rtl_uString** if ( strTempURL ) rtl_uString_release( strTempURL ); - /* - OSL_ENSURE_FILE( !nError, "osl_getFileURLFromSystemPath: \"%s\" is not a systemPath !!!", strPath ); - */ + SAL_INFO_IF(nError, "sal.osl", + "osl_getFileURLFromSystemPath: \"" << strPath << "\" is not a systemPath"); return nError; } |