Kaydet (Commit) 14255b68 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Coverity 1308555, 1308562, 1308600: Drop some SAL_THROW_EXTERN_C

...from most rtl/bootstrap.h functions.  They are effectively only called from
C++ code (there is no plain C UNO binding), so it should be fine to let std
exceptions (like bad_alloc or length_error) propagate from their implementations
to call sites.

(The exception is rtl_bootstrap_args_close, which is typically called from C++
dtors, so should not throw anyway.)

This would strictly speaking be an [API CHANGE], but it should make no practical
difference whether a process terminates abruptly because an exception cannot
pass through a SAL_THROW_EXTERN_C() nothrow specification or because legacy
client code does not expect exceptions to be thrown from functions from which
SAL_THROW_EXTERN_C() has now been removed.

Change-Id: I08e8479e9c5731e46021aadd6a725c1793024d10
üst 26d1a597
...@@ -118,8 +118,7 @@ extern "C" { ...@@ -118,8 +118,7 @@ extern "C" {
@param pFileUri URL of the inifile with path but WITHOUT suffix (.ini or rc) @param pFileUri URL of the inifile with path but WITHOUT suffix (.ini or rc)
*/ */
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri ) SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri );
SAL_THROW_EXTERN_C();
/** /**
@param ppValue @param ppValue
...@@ -139,8 +138,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri ...@@ -139,8 +138,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri
<code>sal_True</code>. <code>sal_True</code>.
*/ */
SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get( SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get(
rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault ) rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault );
SAL_THROW_EXTERN_C();
/** Sets a bootstrap parameter. /** Sets a bootstrap parameter.
...@@ -150,8 +148,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get( ...@@ -150,8 +148,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get(
value of bootstrap parameter value of bootstrap parameter
*/ */
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_set( SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_set(
rtl_uString * pName, rtl_uString * pValue ) rtl_uString * pName, rtl_uString * pValue );
SAL_THROW_EXTERN_C();
typedef void * rtlBootstrapHandle; typedef void * rtlBootstrapHandle;
...@@ -163,8 +160,7 @@ typedef void * rtlBootstrapHandle; ...@@ -163,8 +160,7 @@ typedef void * rtlBootstrapHandle;
@return Handle for a bootstrap argument @return Handle for a bootstrap argument
container container
*/ */
SAL_DLLPUBLIC rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName) SAL_DLLPUBLIC rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName);
SAL_THROW_EXTERN_C();
/** /**
Closes a bootstrap agument container. Closes a bootstrap agument container.
...@@ -182,8 +178,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_args_close(rtlBootstrapHandle handle) ...@@ -182,8 +178,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_args_close(rtlBootstrapHandle handle)
@return The status of the retrieval, <code>sal_True</code> on success. @return The status of the retrieval, <code>sal_True</code> on success.
*/ */
SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get_from_handle( SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
rtlBootstrapHandle handle, rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault) rtlBootstrapHandle handle, rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault);
SAL_THROW_EXTERN_C();
/** Returns the name of the inifile associated with this handle. /** Returns the name of the inifile associated with this handle.
...@@ -192,8 +187,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get_from_handle( ...@@ -192,8 +187,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
@param ppIniName [out] contains after the call the name of the ini-filename. @param ppIniName [out] contains after the call the name of the ini-filename.
*/ */
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_get_iniName_from_handle( SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_get_iniName_from_handle(
rtlBootstrapHandle handle, rtl_uString ** ppIniName) rtlBootstrapHandle handle, rtl_uString ** ppIniName);
SAL_THROW_EXTERN_C();
/** Expands a macro using bootstrap variables. /** Expands a macro using bootstrap variables.
...@@ -222,8 +216,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_expandMacros( ...@@ -222,8 +216,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_expandMacros(
@since UDK 3.2.9 @since UDK 3.2.9
*/ */
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_encode( SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_encode(
rtl_uString const * value, rtl_uString ** encoded ) rtl_uString const * value, rtl_uString ** encoded );
SAL_THROW_EXTERN_C();
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -629,7 +629,7 @@ bootstrap_map::t * bootstrap_map::m_map = NULL; ...@@ -629,7 +629,7 @@ bootstrap_map::t * bootstrap_map::m_map = NULL;
rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open ( rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open (
rtl_uString * pIniName rtl_uString * pIniName
) SAL_THROW_EXTERN_C() )
{ {
OUString iniName( pIniName ); OUString iniName( pIniName );
...@@ -721,7 +721,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle( ...@@ -721,7 +721,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
rtl_uString * pName, rtl_uString * pName,
rtl_uString ** ppValue, rtl_uString ** ppValue,
rtl_uString * pDefault rtl_uString * pDefault
) SAL_THROW_EXTERN_C() )
{ {
osl::MutexGuard guard( osl::Mutex::getGlobalMutex() ); osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
...@@ -740,7 +740,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle( ...@@ -740,7 +740,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
void SAL_CALL rtl_bootstrap_get_iniName_from_handle ( void SAL_CALL rtl_bootstrap_get_iniName_from_handle (
rtlBootstrapHandle handle, rtlBootstrapHandle handle,
rtl_uString ** ppIniName rtl_uString ** ppIniName
) SAL_THROW_EXTERN_C() )
{ {
if(ppIniName) if(ppIniName)
{ {
...@@ -759,7 +759,7 @@ void SAL_CALL rtl_bootstrap_get_iniName_from_handle ( ...@@ -759,7 +759,7 @@ void SAL_CALL rtl_bootstrap_get_iniName_from_handle (
void SAL_CALL rtl_bootstrap_setIniFileName ( void SAL_CALL rtl_bootstrap_setIniFileName (
rtl_uString * pName rtl_uString * pName
) SAL_THROW_EXTERN_C() )
{ {
osl::MutexGuard guard( osl::Mutex::getGlobalMutex() ); osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
OUString & file = getIniFileName_Impl(); OUString & file = getIniFileName_Impl();
...@@ -770,7 +770,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get ( ...@@ -770,7 +770,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get (
rtl_uString * pName, rtl_uString * pName,
rtl_uString ** ppValue, rtl_uString ** ppValue,
rtl_uString * pDefault rtl_uString * pDefault
) SAL_THROW_EXTERN_C() )
{ {
return rtl_bootstrap_get_from_handle(0, pName, ppValue, pDefault); return rtl_bootstrap_get_from_handle(0, pName, ppValue, pDefault);
} }
...@@ -778,7 +778,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get ( ...@@ -778,7 +778,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get (
void SAL_CALL rtl_bootstrap_set ( void SAL_CALL rtl_bootstrap_set (
rtl_uString * pName, rtl_uString * pName,
rtl_uString * pValue rtl_uString * pValue
) SAL_THROW_EXTERN_C() )
{ {
const OUString name( pName ); const OUString name( pName );
const OUString value( pValue ); const OUString value( pValue );
...@@ -827,7 +827,6 @@ void SAL_CALL rtl_bootstrap_expandMacros(rtl_uString ** macro) ...@@ -827,7 +827,6 @@ void SAL_CALL rtl_bootstrap_expandMacros(rtl_uString ** macro)
} }
void rtl_bootstrap_encode( rtl_uString const * value, rtl_uString ** encoded ) void rtl_bootstrap_encode( rtl_uString const * value, rtl_uString ** encoded )
SAL_THROW_EXTERN_C()
{ {
OSL_ASSERT(value != NULL); OSL_ASSERT(value != NULL);
rtl::OUStringBuffer b; rtl::OUStringBuffer b;
......
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