From 10d29c390dd58ed629dd27fe5ed35fae28eceec3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 30 Apr 2021 08:20:03 +0200 Subject: throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- binaryurp/source/binaryany.cxx | 20 ++++++++++---------- binaryurp/source/binaryany.hxx | 22 +++++++++++----------- binaryurp/source/bridge.cxx | 8 ++++---- binaryurp/source/bridge.hxx | 6 +++--- binaryurp/source/outgoingrequests.cxx | 2 +- binaryurp/source/outgoingrequests.hxx | 2 +- binaryurp/source/unmarshal.cxx | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) (limited to 'binaryurp') diff --git a/binaryurp/source/binaryany.cxx b/binaryurp/source/binaryany.cxx index af1493331160..17db2f3775ef 100644 --- a/binaryurp/source/binaryany.cxx +++ b/binaryurp/source/binaryany.cxx @@ -50,18 +50,18 @@ void moveInternals(uno_Any & from, uno_Any & to) { } -BinaryAny::BinaryAny() throw () { +BinaryAny::BinaryAny() noexcept { uno_any_construct(&data_, nullptr, nullptr, nullptr); } BinaryAny::BinaryAny(css::uno::TypeDescription const & type, void * value) - throw () + noexcept { assert(type.is()); uno_any_construct(&data_, value, type.get(), nullptr); } -BinaryAny::BinaryAny(uno_Any const & raw) throw () { +BinaryAny::BinaryAny(uno_Any const & raw) noexcept { assert(raw.pType != nullptr); data_.pType = raw.pType; typelib_typedescriptionreference_acquire(data_.pType); @@ -69,37 +69,37 @@ BinaryAny::BinaryAny(uno_Any const & raw) throw () { data_.pReserved = raw.pReserved; } -BinaryAny::BinaryAny(BinaryAny const & other) throw () { +BinaryAny::BinaryAny(BinaryAny const & other) noexcept { uno_type_any_construct(&data_, other.data_.pData, other.data_.pType, nullptr); } -BinaryAny::BinaryAny(BinaryAny && other) throw () { +BinaryAny::BinaryAny(BinaryAny && other) noexcept { moveInternals(other.data_, data_); } -BinaryAny::~BinaryAny() throw () { +BinaryAny::~BinaryAny() noexcept { uno_any_destruct(&data_, nullptr); } -BinaryAny & BinaryAny::operator =(BinaryAny const & other) throw () { +BinaryAny & BinaryAny::operator =(BinaryAny const & other) noexcept { if (&other != this) { uno_type_any_assign(&data_, other.data_.pData, other.data_.pType, nullptr, nullptr); } return *this; } -BinaryAny & BinaryAny::operator =(BinaryAny && other) throw () { +BinaryAny & BinaryAny::operator =(BinaryAny && other) noexcept { uno_any_destruct(&data_, nullptr); moveInternals(other.data_, data_); return *this; } -css::uno::TypeDescription BinaryAny::getType() const throw () { +css::uno::TypeDescription BinaryAny::getType() const noexcept { return css::uno::TypeDescription(data_.pType); } void * BinaryAny::getValue(css::uno::TypeDescription const & type) const - throw () + noexcept { assert(type.is()); assert( diff --git a/binaryurp/source/binaryany.hxx b/binaryurp/source/binaryany.hxx index fdf52216a154..c04fe8f8624a 100644 --- a/binaryurp/source/binaryany.hxx +++ b/binaryurp/source/binaryany.hxx @@ -29,31 +29,31 @@ namespace binaryurp { class BinaryAny { public: - BinaryAny() throw (); + BinaryAny() noexcept; BinaryAny(com::sun::star::uno::TypeDescription const & type, void * value) - throw (); + noexcept; - explicit BinaryAny(uno_Any const & raw) throw (); + explicit BinaryAny(uno_Any const & raw) noexcept; // takes over raw.pData (but copies raw.pType); raw must not be passed // to uno_any_destruct - BinaryAny(BinaryAny const & other) throw (); + BinaryAny(BinaryAny const & other) noexcept; - BinaryAny(BinaryAny && other) throw (); + BinaryAny(BinaryAny && other) noexcept; - ~BinaryAny() throw (); + ~BinaryAny() noexcept; - BinaryAny & operator =(BinaryAny const & other) throw (); + BinaryAny & operator =(BinaryAny const & other) noexcept; - BinaryAny & operator =(BinaryAny && other) throw (); + BinaryAny & operator =(BinaryAny && other) noexcept; - uno_Any& get() throw () { return data_; } + uno_Any& get() noexcept { return data_; } - com::sun::star::uno::TypeDescription getType() const throw (); + com::sun::star::uno::TypeDescription getType() const noexcept; void * getValue(com::sun::star::uno::TypeDescription const & type) const - throw (); + noexcept; private: mutable uno_Any data_; diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index fccef42d98f4..acefb175e8ec 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -103,7 +103,7 @@ public: ~AttachThread(); - const rtl::ByteSequence& getTid() const throw () { return tid_;} + const rtl::ByteSequence& getTid() const noexcept { return tid_;} private: AttachThread(const AttachThread&) = delete; @@ -546,7 +546,7 @@ void Bridge::freeProxy(Proxy & proxy) { terminateWhenUnused(unused); } -void Bridge::incrementCalls(bool normalCall) throw () { +void Bridge::incrementCalls(bool normalCall) noexcept { osl::MutexGuard g(mutex_); assert(calls_ < std::numeric_limits< std::size_t >::max()); ++calls_; @@ -564,7 +564,7 @@ void Bridge::decrementCalls() { terminateWhenUnused(unused); } -void Bridge::incrementActiveCalls() throw () { +void Bridge::incrementActiveCalls() noexcept { osl::MutexGuard g(mutex_); assert( activeCalls_ <= calls_ && @@ -573,7 +573,7 @@ void Bridge::incrementActiveCalls() throw () { passive_.reset(); } -void Bridge::decrementActiveCalls() throw () { +void Bridge::decrementActiveCalls() noexcept { osl::MutexGuard g(mutex_); assert(activeCalls_ <= calls_ && activeCalls_ > 0); --activeCalls_; diff --git a/binaryurp/source/bridge.hxx b/binaryurp/source/bridge.hxx index 1a51ffac0626..e0d5ce39b671 100644 --- a/binaryurp/source/bridge.hxx +++ b/binaryurp/source/bridge.hxx @@ -121,13 +121,13 @@ public: void freeProxy(Proxy & proxy); - void incrementCalls(bool normalCall) throw (); + void incrementCalls(bool normalCall) noexcept; void decrementCalls(); - void incrementActiveCalls() throw (); + void incrementActiveCalls() noexcept; - void decrementActiveCalls() throw (); + void decrementActiveCalls() noexcept; bool makeCall( OUString const & oid, diff --git a/binaryurp/source/outgoingrequests.cxx b/binaryurp/source/outgoingrequests.cxx index d18c01434f8f..859aa8b9270d 100644 --- a/binaryurp/source/outgoingrequests.cxx +++ b/binaryurp/source/outgoingrequests.cxx @@ -53,7 +53,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) { return i->second.back(); } -void OutgoingRequests::pop(rtl::ByteSequence const & tid) throw () { +void OutgoingRequests::pop(rtl::ByteSequence const & tid) noexcept { osl::MutexGuard g(mutex_); Map::iterator i(map_.find(tid)); assert(i != map_.end()); diff --git a/binaryurp/source/outgoingrequests.hxx b/binaryurp/source/outgoingrequests.hxx index 7816032596f1..294119693d02 100644 --- a/binaryurp/source/outgoingrequests.hxx +++ b/binaryurp/source/outgoingrequests.hxx @@ -48,7 +48,7 @@ public: OutgoingRequest top(rtl::ByteSequence const& tid); - void pop(rtl::ByteSequence const& tid) throw(); + void pop(rtl::ByteSequence const& tid) noexcept; private: OutgoingRequests(const OutgoingRequests&) = delete; diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx index 8cf8676edad4..d307c81cc0b5 100644 --- a/binaryurp/source/unmarshal.cxx +++ b/binaryurp/source/unmarshal.cxx @@ -62,7 +62,7 @@ void * allocate(sal_Size size) { std::vector< BinaryAny >::iterator copyMemberValues( css::uno::TypeDescription const & type, - std::vector< BinaryAny >::iterator const & it, void * buffer) throw () + std::vector< BinaryAny >::iterator const & it, void * buffer) noexcept { assert( type.is() && -- cgit