loplugin:nullptr

...in non-dependent templated code that Clang trunk now apparently processes
more aggressively, presumably since <https://github.com/llvm/llvm-project/
commit/878a24ee244a24c39d1c57e9af2e88c621f7cce9> "Reapply 'Fix crash on switch
conditions of non-integer types in templates'"

Change-Id: Ia3e4bc6cfe7cea9f816e9282563a8b38e40f0cec
Reviewed-on: https://gerrit.libreoffice.org/84649
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2019-12-06 16:19:29 +01:00
parent 08615ce879
commit a596dd99de
2 changed files with 5 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ inline Sequence< E >::Sequence()
const Type & rType = ::cppu::getTypeFavourUnsigned( this ); const Type & rType = ::cppu::getTypeFavourUnsigned( this );
::uno_type_sequence_construct( ::uno_type_sequence_construct(
&_pSequence, rType.getTypeLibType(), &_pSequence, rType.getTypeLibType(),
0, 0, cpp_acquire ); NULL, 0, cpp_acquire );
// no bad_alloc, because empty sequence is statically allocated in cppu // no bad_alloc, because empty sequence is statically allocated in cppu
} }
@@ -102,7 +102,7 @@ inline Sequence< E >::Sequence( sal_Int32 len )
bool success = bool success =
::uno_type_sequence_construct( ::uno_type_sequence_construct(
&_pSequence, rType.getTypeLibType(), &_pSequence, rType.getTypeLibType(),
0, len, cpp_acquire ); NULL, len, cpp_acquire );
if (! success) if (! success)
throw ::std::bad_alloc(); throw ::std::bad_alloc();
} }

View File

@@ -417,12 +417,12 @@ class PageHolderObject
public: public:
bool construct (rtl::Reference< PageData::Allocator > const & rxAllocator) bool construct (rtl::Reference< PageData::Allocator > const & rxAllocator)
{ {
if ((m_xPage.get() == 0) && rxAllocator.is()) if ((m_xPage.get() == nullptr) && rxAllocator.is())
{ {
std::shared_ptr<PageData> tmp (rxAllocator->construct<T>(), PageData::Deallocate(rxAllocator)); std::shared_ptr<PageData> tmp (rxAllocator->construct<T>(), PageData::Deallocate(rxAllocator));
m_xPage.swap (tmp); m_xPage.swap (tmp);
} }
return (m_xPage.get() != 0); return (m_xPage.get() != nullptr);
} }
explicit PageHolderObject (std::shared_ptr<PageData> const & rxPage = std::shared_ptr<PageData>()) explicit PageHolderObject (std::shared_ptr<PageData> const & rxPage = std::shared_ptr<PageData>())
@@ -447,7 +447,7 @@ public:
bool is() const bool is() const
{ {
return (m_xPage.get() != 0); return (m_xPage.get() != nullptr);
} }
std::shared_ptr<PageData> & get() { return m_xPage; } std::shared_ptr<PageData> & get() { return m_xPage; }