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" {
@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_THROW_EXTERN_C();
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri );
/**
@param ppValue
......@@ -139,8 +138,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_setIniFileName( rtl_uString *pFileUri
<code>sal_True</code>.
*/
SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get(
rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault )
SAL_THROW_EXTERN_C();
rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault );
/** Sets a bootstrap parameter.
......@@ -150,8 +148,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get(
value of bootstrap parameter
*/
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_set(
rtl_uString * pName, rtl_uString * pValue )
SAL_THROW_EXTERN_C();
rtl_uString * pName, rtl_uString * pValue );
typedef void * rtlBootstrapHandle;
......@@ -163,8 +160,7 @@ typedef void * rtlBootstrapHandle;
@return Handle for a bootstrap argument
container
*/
SAL_DLLPUBLIC rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName)
SAL_THROW_EXTERN_C();
SAL_DLLPUBLIC rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName);
/**
Closes a bootstrap agument container.
......@@ -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.
*/
SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
rtlBootstrapHandle handle, rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault)
SAL_THROW_EXTERN_C();
rtlBootstrapHandle handle, rtl_uString *pName, rtl_uString **ppValue, rtl_uString *pDefault);
/** 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(
@param ppIniName [out] contains after the call the name of the ini-filename.
*/
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_get_iniName_from_handle(
rtlBootstrapHandle handle, rtl_uString ** ppIniName)
SAL_THROW_EXTERN_C();
rtlBootstrapHandle handle, rtl_uString ** ppIniName);
/** Expands a macro using bootstrap variables.
......@@ -222,8 +216,7 @@ SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_expandMacros(
@since UDK 3.2.9
*/
SAL_DLLPUBLIC void SAL_CALL rtl_bootstrap_encode(
rtl_uString const * value, rtl_uString ** encoded )
SAL_THROW_EXTERN_C();
rtl_uString const * value, rtl_uString ** encoded );
#ifdef __cplusplus
}
......
......@@ -629,7 +629,7 @@ bootstrap_map::t * bootstrap_map::m_map = NULL;
rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open (
rtl_uString * pIniName
) SAL_THROW_EXTERN_C()
)
{
OUString iniName( pIniName );
......@@ -721,7 +721,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
rtl_uString * pName,
rtl_uString ** ppValue,
rtl_uString * pDefault
) SAL_THROW_EXTERN_C()
)
{
osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
......@@ -740,7 +740,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle(
void SAL_CALL rtl_bootstrap_get_iniName_from_handle (
rtlBootstrapHandle handle,
rtl_uString ** ppIniName
) SAL_THROW_EXTERN_C()
)
{
if(ppIniName)
{
......@@ -759,7 +759,7 @@ void SAL_CALL rtl_bootstrap_get_iniName_from_handle (
void SAL_CALL rtl_bootstrap_setIniFileName (
rtl_uString * pName
) SAL_THROW_EXTERN_C()
)
{
osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
OUString & file = getIniFileName_Impl();
......@@ -770,7 +770,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get (
rtl_uString * pName,
rtl_uString ** ppValue,
rtl_uString * pDefault
) SAL_THROW_EXTERN_C()
)
{
return rtl_bootstrap_get_from_handle(0, pName, ppValue, pDefault);
}
......@@ -778,7 +778,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get (
void SAL_CALL rtl_bootstrap_set (
rtl_uString * pName,
rtl_uString * pValue
) SAL_THROW_EXTERN_C()
)
{
const OUString name( pName );
const OUString value( pValue );
......@@ -827,7 +827,6 @@ void SAL_CALL rtl_bootstrap_expandMacros(rtl_uString ** macro)
}
void rtl_bootstrap_encode( rtl_uString const * value, rtl_uString ** encoded )
SAL_THROW_EXTERN_C()
{
OSL_ASSERT(value != NULL);
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