From 4bea7449711f1832c1db0e9b5447fb2c3415c068 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 18 May 2021 14:39:37 +0200 Subject: loplugin:noexcept (clang-cl) Change-Id: Ife669f959358992b547b408ab5d1f6bf1c1d14bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115744 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- bridges/inc/msvc/amd64.hxx | 4 ++-- bridges/inc/msvc/except.hxx | 18 +++++++++--------- bridges/source/cpp_uno/msvc_shared/except.cxx | 18 +++++++++--------- bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 13 +++++++------ bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx | 2 +- 5 files changed, 28 insertions(+), 27 deletions(-) (limited to 'bridges') diff --git a/bridges/inc/msvc/amd64.hxx b/bridges/inc/msvc/amd64.hxx index fb095446b097..eea88ea96f2f 100644 --- a/bridges/inc/msvc/amd64.hxx +++ b/bridges/inc/msvc/amd64.hxx @@ -33,7 +33,7 @@ struct ExceptionType final ExceptionTypeInfo exc_type_info; explicit ExceptionType(unsigned char* pCode, sal_uInt64 pCodeBase, - typelib_TypeDescription* pTD) throw(); + typelib_TypeDescription* pTD) noexcept; ExceptionType(const ExceptionType&) = delete; ExceptionType& operator=(const ExceptionType&) = delete; @@ -51,7 +51,7 @@ struct RaiseInfo final unsigned char* _code; sal_uInt64 _codeBase; - explicit RaiseInfo(typelib_TypeDescription* pTD) throw(); + explicit RaiseInfo(typelib_TypeDescription* pTD) noexcept; }; #pragma pack(pop) diff --git a/bridges/inc/msvc/except.hxx b/bridges/inc/msvc/except.hxx index aba0ce46248e..798fc44f147c 100644 --- a/bridges/inc/msvc/except.hxx +++ b/bridges/inc/msvc/except.hxx @@ -61,12 +61,12 @@ class ExceptionTypeInfo final char m_d_name[1]; public: - explicit ExceptionTypeInfo(void* data, const char* d_name) throw() + explicit ExceptionTypeInfo(void* data, const char* d_name) noexcept : m_data(data) { ::strcpy(m_d_name, d_name); // #100211# - checked } - virtual ~ExceptionTypeInfo() throw(); + virtual ~ExceptionTypeInfo() noexcept; }; class ExceptionTypeInfoWrapper final @@ -75,7 +75,7 @@ class ExceptionTypeInfoWrapper final ExceptionTypeInfo info; public: - explicit ExceptionTypeInfoWrapper(void* m_data, const char* m_d_name) throw() + explicit ExceptionTypeInfoWrapper(void* m_data, const char* m_d_name) noexcept : info(m_data, m_d_name) { type_info_size = sizeof(ExceptionTypeInfo) + strlen(m_d_name); @@ -90,13 +90,13 @@ class RTTInfos final osl::Mutex m_aMutex; t_string2PtrMap m_allRTTI; - RTTInfos() throw(); - ExceptionTypeInfoWrapper* getInfo(OUString const& rUNOname) throw(); + RTTInfos() noexcept; + ExceptionTypeInfoWrapper* getInfo(OUString const& rUNOname) noexcept; public: ~RTTInfos(); - static type_info* get(OUString const& rUNOname, int* len = nullptr) throw(); + static type_info* get(OUString const& rUNOname, int* len = nullptr) noexcept; }; class ExceptionInfos final @@ -105,12 +105,12 @@ class ExceptionInfos final t_string2PtrMap m_allRaiseInfos; public: - static RaiseInfo* getRaiseInfo(typelib_TypeDescription* pTD) throw(); + static RaiseInfo* getRaiseInfo(typelib_TypeDescription* pTD) noexcept; static DWORD allocationGranularity; - ExceptionInfos() throw(); - ~ExceptionInfos() throw(); + ExceptionInfos() noexcept; + ~ExceptionInfos() noexcept; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx b/bridges/source/cpp_uno/msvc_shared/except.cxx index 4b3d2ae3da0d..283baa75173c 100644 --- a/bridges/source/cpp_uno/msvc_shared/except.cxx +++ b/bridges/source/cpp_uno/msvc_shared/except.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star; -static OUString toUNOname(OUString const& rRTTIname) throw() +static OUString toUNOname(OUString const& rRTTIname) noexcept { OUStringBuffer aRet(64); OUString aStr(rRTTIname.copy(4, rRTTIname.getLength() - 4 - 2)); // filter .?AUzzz@yyy@xxx@@ @@ -67,7 +67,7 @@ static OUString toUNOname(OUString const& rRTTIname) throw() return aRet.makeStringAndClear(); } -static OUString toRTTIname(OUString const& rUNOname) throw() +static OUString toRTTIname(OUString const& rUNOname) noexcept { OUStringBuffer aRet(64); aRet.append(".?AV"); // class ".?AV"; struct ".?AU" @@ -83,9 +83,9 @@ static OUString toRTTIname(OUString const& rUNOname) throw() return aRet.makeStringAndClear(); } -ExceptionTypeInfo::~ExceptionTypeInfo() throw() { (void)m_data; } +ExceptionTypeInfo::~ExceptionTypeInfo() noexcept { (void)m_data; } -ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) throw() +ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) noexcept { ExceptionTypeInfoWrapper* pRTTI; t_string2PtrMap::const_iterator const iFind(m_allRTTI.find(rUNOname)); @@ -107,7 +107,7 @@ ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) throw() return pRTTI; } -type_info* RTTInfos::get(OUString const& rUNOname, int* len) throw() +type_info* RTTInfos::get(OUString const& rUNOname, int* len) noexcept { static RTTInfos* s_pRTTIs = new RTTInfos(); @@ -121,13 +121,13 @@ type_info* RTTInfos::get(OUString const& rUNOname, int* len) throw() return pETIW->get_type_info(); } -RTTInfos::RTTInfos() throw() {} +RTTInfos::RTTInfos() noexcept {} DWORD ExceptionInfos::allocationGranularity = 0; -ExceptionInfos::ExceptionInfos() throw() {} +ExceptionInfos::ExceptionInfos() noexcept {} -ExceptionInfos::~ExceptionInfos() throw() +ExceptionInfos::~ExceptionInfos() noexcept { SAL_INFO("bridges", "> freeing exception infos... <"); @@ -136,7 +136,7 @@ ExceptionInfos::~ExceptionInfos() throw() delete static_cast(rEntry.second); } -RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) throw() +RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) noexcept { static ExceptionInfos* s_pInfos = []() { #if defined _M_AMD64 || defined _M_ARM64 diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx index ec874621baf8..e5836dd11d98 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -256,13 +256,13 @@ void using namespace ::com::sun::star; static void* __cdecl copyConstruct(void* pExcThis, void* pSource, - typelib_TypeDescription* pTD) throw() + typelib_TypeDescription* pTD) noexcept { ::uno_copyData(pExcThis, pSource, pTD, uno::cpp_acquire); return pExcThis; } -static void* __cdecl destruct(void* pExcThis, typelib_TypeDescription* pTD) throw() +static void* __cdecl destruct(void* pExcThis, typelib_TypeDescription* pTD) noexcept { ::uno_destructData(pExcThis, pTD, uno::cpp_release); return pExcThis; @@ -270,7 +270,8 @@ static void* __cdecl destruct(void* pExcThis, typelib_TypeDescription* pTD) thro const int codeSnippetSize = 40; -static void GenerateConstructorTrampoline(unsigned char* code, typelib_TypeDescription* pTD) throw() +static void GenerateConstructorTrampoline(unsigned char* code, + typelib_TypeDescription* pTD) noexcept { unsigned char* p = code; @@ -294,7 +295,7 @@ static void GenerateConstructorTrampoline(unsigned char* code, typelib_TypeDescr assert(p < code + codeSnippetSize); } -static void GenerateDestructorTrampoline(unsigned char* code, typelib_TypeDescription* pTD) throw() +static void GenerateDestructorTrampoline(unsigned char* code, typelib_TypeDescription* pTD) noexcept { unsigned char* p = code; @@ -319,7 +320,7 @@ static void GenerateDestructorTrampoline(unsigned char* code, typelib_TypeDescri } ExceptionType::ExceptionType(unsigned char* pCode, sal_uInt64 pCodeBase, - typelib_TypeDescription* pTD) throw() + typelib_TypeDescription* pTD) noexcept : _n0(0) , _n1(0) , _n2(-1) @@ -355,7 +356,7 @@ ExceptionType::ExceptionType(unsigned char* pCode, sal_uInt64 pCodeBase, * is also member of ExceptionType and can be referenced via 32 bit offset. */ -RaiseInfo::RaiseInfo(typelib_TypeDescription* pTD) throw() +RaiseInfo::RaiseInfo(typelib_TypeDescription* pTD) noexcept : _n0(0) , _n2(0) , _pTD(pTD) diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx index 938775629c17..d5df4a161ef2 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx @@ -50,7 +50,7 @@ bool cpp_call( typelib_MethodParameter * pParams, void * pUnoReturn, void * pUnoArgs[], - uno_Any ** ppUnoExc ) throw () + uno_Any ** ppUnoExc ) noexcept { const int MAXPARAMS = 32; -- cgit