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

loplugin:nullptr (automatic rewrite)

Change-Id: Ic3516d9069cbe935f5b82aec0afac3facdc814a5
üst 08e49fa3
...@@ -30,18 +30,18 @@ ...@@ -30,18 +30,18 @@
namespace binaryurp { namespace binaryurp {
BinaryAny::BinaryAny() throw () { BinaryAny::BinaryAny() throw () {
uno_any_construct(&data_, 0, 0, 0); uno_any_construct(&data_, nullptr, nullptr, nullptr);
} }
BinaryAny::BinaryAny(css::uno::TypeDescription const & type, void * value) BinaryAny::BinaryAny(css::uno::TypeDescription const & type, void * value)
throw () throw ()
{ {
assert(type.is()); assert(type.is());
uno_any_construct(&data_, value, type.get(), 0); uno_any_construct(&data_, value, type.get(), nullptr);
} }
BinaryAny::BinaryAny(uno_Any const & raw) throw () { BinaryAny::BinaryAny(uno_Any const & raw) throw () {
assert(raw.pType != 0); assert(raw.pType != nullptr);
data_.pType = raw.pType; data_.pType = raw.pType;
typelib_typedescriptionreference_acquire(data_.pType); typelib_typedescriptionreference_acquire(data_.pType);
data_.pData = raw.pData == &raw.pReserved ? &data_.pReserved : raw.pData; data_.pData = raw.pData == &raw.pReserved ? &data_.pReserved : raw.pData;
...@@ -49,16 +49,16 @@ BinaryAny::BinaryAny(uno_Any const & raw) throw () { ...@@ -49,16 +49,16 @@ BinaryAny::BinaryAny(uno_Any const & raw) throw () {
} }
BinaryAny::BinaryAny(BinaryAny const & other) throw () { BinaryAny::BinaryAny(BinaryAny const & other) throw () {
uno_type_any_construct(&data_, other.data_.pData, other.data_.pType, 0); uno_type_any_construct(&data_, other.data_.pData, other.data_.pType, nullptr);
} }
BinaryAny::~BinaryAny() throw () { BinaryAny::~BinaryAny() throw () {
uno_any_destruct(&data_, 0); uno_any_destruct(&data_, nullptr);
} }
BinaryAny & BinaryAny::operator =(BinaryAny const & other) throw () { BinaryAny & BinaryAny::operator =(BinaryAny const & other) throw () {
if (&other != this) { if (&other != this) {
uno_type_any_assign(&data_, other.data_.pData, other.data_.pType, 0, 0); uno_type_any_assign(&data_, other.data_.pData, other.data_.pType, nullptr, nullptr);
} }
return *this; return *this;
} }
......
...@@ -82,19 +82,19 @@ sal_Int32 random() { ...@@ -82,19 +82,19 @@ sal_Int32 random() {
OUString toString(css::uno::TypeDescription const & type) { OUString toString(css::uno::TypeDescription const & type) {
typelib_TypeDescription * d = type.get(); typelib_TypeDescription * d = type.get();
assert(d != 0 && d->pTypeName != 0); assert(d != nullptr && d->pTypeName != nullptr);
return OUString(d->pTypeName); return OUString(d->pTypeName);
} }
extern "C" void SAL_CALL freeProxyCallback( extern "C" void SAL_CALL freeProxyCallback(
SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pProxy) SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pProxy)
{ {
assert(pProxy != 0); assert(pProxy != nullptr);
static_cast< Proxy * >(pProxy)->do_free(); static_cast< Proxy * >(pProxy)->do_free();
} }
bool isThread(salhelper::Thread * thread) { bool isThread(salhelper::Thread * thread) {
assert(thread != 0); assert(thread != nullptr);
return osl::Thread::getCurrentIdentifier() == thread->getIdentifier(); return osl::Thread::getCurrentIdentifier() == thread->getIdentifier();
} }
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
}; };
AttachThread::AttachThread(uno_ThreadPool threadPool): threadPool_(threadPool) { AttachThread::AttachThread(uno_ThreadPool threadPool): threadPool_(threadPool) {
sal_Sequence * s = 0; sal_Sequence * s = nullptr;
uno_getIdOfCurrentThread(&s); uno_getIdOfCurrentThread(&s);
tid_ = rtl::ByteSequence(s, rtl::BYTESEQ_NOACQUIRE); tid_ = rtl::ByteSequence(s, rtl::BYTESEQ_NOACQUIRE);
uno_threadpool_attach(threadPool_); uno_threadpool_attach(threadPool_);
...@@ -190,7 +190,7 @@ Bridge::Bridge( ...@@ -190,7 +190,7 @@ Bridge::Bridge(
css::uno::Reference< css::bridge::XProtocolProperties > >::get()), css::uno::Reference< css::bridge::XProtocolProperties > >::get()),
protPropRequest_("com.sun.star.bridge.XProtocolProperties::requestChange"), protPropRequest_("com.sun.star.bridge.XProtocolProperties::requestChange"),
protPropCommit_("com.sun.star.bridge.XProtocolProperties::commitChange"), protPropCommit_("com.sun.star.bridge.XProtocolProperties::commitChange"),
state_(STATE_INITIAL), threadPool_(0), currentContextMode_(false), state_(STATE_INITIAL), threadPool_(nullptr), currentContextMode_(false),
proxies_(0), calls_(0), normalCall_(false), activeCalls_(0), proxies_(0), calls_(0), normalCall_(false), activeCalls_(0),
mode_(MODE_REQUESTED) mode_(MODE_REQUESTED)
{ {
...@@ -210,10 +210,10 @@ void Bridge::start() { ...@@ -210,10 +210,10 @@ void Bridge::start() {
{ {
osl::MutexGuard g(mutex_); osl::MutexGuard g(mutex_);
assert( assert(
state_ == STATE_INITIAL && threadPool_ == 0 && !writer_.is() && state_ == STATE_INITIAL && threadPool_ == nullptr && !writer_.is() &&
!reader_.is()); !reader_.is());
threadPool_ = uno_threadpool_create(); threadPool_ = uno_threadpool_create();
assert(threadPool_ != 0); assert(threadPool_ != nullptr);
reader_ = r; reader_ = r;
writer_ = w; writer_ = w;
state_ = STATE_STARTED; state_ = STATE_STARTED;
...@@ -252,7 +252,7 @@ void Bridge::terminate(bool final) { ...@@ -252,7 +252,7 @@ void Bridge::terminate(bool final) {
{ {
osl::MutexGuard g2(mutex_); osl::MutexGuard g2(mutex_);
tp = threadPool_; tp = threadPool_;
threadPool_ = 0; threadPool_ = nullptr;
if (reader_.is()) { if (reader_.is()) {
if (!isThread(reader_.get())) { if (!isThread(reader_.get())) {
r = reader_; r = reader_;
...@@ -273,7 +273,7 @@ void Bridge::terminate(bool final) { ...@@ -273,7 +273,7 @@ void Bridge::terminate(bool final) {
} else if (w.is()) { } else if (w.is()) {
w->join(); w->join();
} }
if (tp != 0) { if (tp != nullptr) {
uno_threadpool_destroy(tp); uno_threadpool_destroy(tp);
} }
} }
...@@ -306,7 +306,7 @@ void Bridge::terminate(bool final) { ...@@ -306,7 +306,7 @@ void Bridge::terminate(bool final) {
if (joinW) { if (joinW) {
w->join(); w->join();
} }
assert(tp != 0); assert(tp != nullptr);
uno_threadpool_dispose(tp); uno_threadpool_dispose(tp);
Stubs s; Stubs s;
{ {
...@@ -343,7 +343,7 @@ void Bridge::terminate(bool final) { ...@@ -343,7 +343,7 @@ void Bridge::terminate(bool final) {
{ {
osl::MutexGuard g(mutex_); osl::MutexGuard g(mutex_);
if (final) { if (final) {
threadPool_ = 0; threadPool_ = nullptr;
} }
} }
terminated_.set(); terminated_.set();
...@@ -366,7 +366,7 @@ BinaryAny Bridge::mapCppToBinaryAny(css::uno::Any const & cppAny) { ...@@ -366,7 +366,7 @@ BinaryAny Bridge::mapCppToBinaryAny(css::uno::Any const & cppAny) {
uno_ThreadPool Bridge::getThreadPool() { uno_ThreadPool Bridge::getThreadPool() {
osl::MutexGuard g(mutex_); osl::MutexGuard g(mutex_);
checkDisposed(); checkDisposed();
assert(threadPool_ != 0); assert(threadPool_ != nullptr);
return threadPool_; return threadPool_;
} }
...@@ -608,7 +608,7 @@ bool Bridge::makeCall( ...@@ -608,7 +608,7 @@ bool Bridge::makeCall(
decrementActiveCalls(); decrementActiveCalls();
decrementCalls(); decrementCalls();
} }
if (resp.get() == 0) { if (resp.get() == nullptr) {
throw css::lang::DisposedException( throw css::lang::DisposedException(
"Binary URP bridge disposed during call", "Binary URP bridge disposed during call",
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
......
...@@ -211,8 +211,8 @@ static cppu::ImplementationEntry const services[] = { ...@@ -211,8 +211,8 @@ static cppu::ImplementationEntry const services[] = {
{ &binaryurp::BridgeFactory::static_create, { &binaryurp::BridgeFactory::static_create,
&binaryurp::BridgeFactory::static_getImplementationName, &binaryurp::BridgeFactory::static_getImplementationName,
&binaryurp::BridgeFactory::static_getSupportedServiceNames, &binaryurp::BridgeFactory::static_getSupportedServiceNames,
&cppu::createOneInstanceComponentFactory, 0, 0 }, &cppu::createOneInstanceComponentFactory, nullptr, 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
}; };
} }
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
} }
IdxType add( const T& rContent, bool* pbFound) { IdxType add( const T& rContent, bool* pbFound) {
assert( pbFound != NULL); assert( pbFound != nullptr);
if( !size_) { if( !size_) {
*pbFound = false; *pbFound = false;
return cache::ignore; return cache::ignore;
......
...@@ -38,7 +38,7 @@ css::uno::UnoInterfaceReference get() { ...@@ -38,7 +38,7 @@ css::uno::UnoInterfaceReference get() {
css::uno::UnoInterfaceReference cc; css::uno::UnoInterfaceReference cc;
if (!uno_getCurrentContext( if (!uno_getCurrentContext(
reinterpret_cast< void ** >(&cc.m_pUnoI), reinterpret_cast< void ** >(&cc.m_pUnoI),
OUString(UNO_LB_UNO).pData, 0)) OUString(UNO_LB_UNO).pData, nullptr))
{ {
throw css::uno::RuntimeException("uno_getCurrentContext failed"); throw css::uno::RuntimeException("uno_getCurrentContext failed");
} }
...@@ -49,7 +49,7 @@ void set(css::uno::UnoInterfaceReference const & value) { ...@@ -49,7 +49,7 @@ void set(css::uno::UnoInterfaceReference const & value) {
css::uno::UnoInterfaceReference cc(value); css::uno::UnoInterfaceReference cc(value);
if (!uno_setCurrentContext( if (!uno_setCurrentContext(
cc.m_pUnoI, cc.m_pUnoI,
OUString(UNO_LB_UNO).pData, 0)) OUString(UNO_LB_UNO).pData, nullptr))
{ {
throw css::uno::RuntimeException("uno_setCurrentContext failed"); throw css::uno::RuntimeException("uno_setCurrentContext failed");
} }
......
...@@ -123,10 +123,10 @@ bool IncomingRequest::execute_throw( ...@@ -123,10 +123,10 @@ bool IncomingRequest::execute_throw(
BinaryAny * returnValue, std::vector< BinaryAny > * outArguments) const BinaryAny * returnValue, std::vector< BinaryAny > * outArguments) const
{ {
OSL_ASSERT( OSL_ASSERT(
returnValue != 0 && returnValue != nullptr &&
returnValue->getType().equals( returnValue->getType().equals(
css::uno::TypeDescription(cppu::UnoType<void>::get())) && css::uno::TypeDescription(cppu::UnoType<void>::get())) &&
outArguments != 0 && outArguments->empty()); outArguments != nullptr && outArguments->empty());
bool isExc = false; bool isExc = false;
switch (functionId_) { switch (functionId_) {
case SPECIAL_FUNCTION_ID_RESERVED: case SPECIAL_FUNCTION_ID_RESERVED:
...@@ -237,19 +237,19 @@ bool IncomingRequest::execute_throw( ...@@ -237,19 +237,19 @@ bool IncomingRequest::execute_throw(
uno_Any exc; uno_Any exc;
uno_Any * pexc = &exc; uno_Any * pexc = &exc;
(*object_.get()->pDispatcher)( (*object_.get()->pDispatcher)(
object_.get(), member_.get(), retBuf.empty() ? 0 : &retBuf[0], object_.get(), member_.get(), retBuf.empty() ? nullptr : &retBuf[0],
args.empty() ? 0 : &args[0], &pexc); args.empty() ? nullptr : &args[0], &pexc);
isExc = pexc != 0; isExc = pexc != nullptr;
if (isExc) { if (isExc) {
*returnValue = BinaryAny( *returnValue = BinaryAny(
css::uno::TypeDescription( css::uno::TypeDescription(
cppu::UnoType< css::uno::Any >::get()), cppu::UnoType< css::uno::Any >::get()),
&exc); &exc);
uno_any_destruct(&exc, 0); uno_any_destruct(&exc, nullptr);
} else { } else {
if (!retBuf.empty()) { if (!retBuf.empty()) {
*returnValue = BinaryAny(retType, &retBuf[0]); *returnValue = BinaryAny(retType, &retBuf[0]);
uno_destructData(&retBuf[0], retType.get(), 0); uno_destructData(&retBuf[0], retType.get(), nullptr);
} }
if (!outArguments->empty()) { if (!outArguments->empty()) {
OSL_ASSERT( OSL_ASSERT(
...@@ -271,7 +271,7 @@ bool IncomingRequest::execute_throw( ...@@ -271,7 +271,7 @@ bool IncomingRequest::execute_throw(
} }
if (!mtd->pParams[k].bIn) { if (!mtd->pParams[k].bIn) {
uno_type_destructData( uno_type_destructData(
&(*j++)[0], mtd->pParams[k].pTypeRef, 0); &(*j++)[0], mtd->pParams[k].pTypeRef, nullptr);
} }
} }
OSL_ASSERT(i == outArguments->end()); OSL_ASSERT(i == outArguments->end());
......
...@@ -72,7 +72,7 @@ void writeCompressed(std::vector< unsigned char > * buffer, sal_uInt32 value) { ...@@ -72,7 +72,7 @@ void writeCompressed(std::vector< unsigned char > * buffer, sal_uInt32 value) {
void writeString( void writeString(
std::vector< unsigned char > * buffer, OUString const & value) std::vector< unsigned char > * buffer, OUString const & value)
{ {
assert(buffer != 0); assert(buffer != nullptr);
OString v; OString v;
if (!value.convertToString( if (!value.convertToString(
&v, RTL_TEXTENCODING_UTF8, &v, RTL_TEXTENCODING_UTF8,
...@@ -97,7 +97,7 @@ Marshal::Marshal(rtl::Reference< Bridge > const & bridge, WriterState & state): ...@@ -97,7 +97,7 @@ Marshal::Marshal(rtl::Reference< Bridge > const & bridge, WriterState & state):
Marshal::~Marshal() {} Marshal::~Marshal() {}
void Marshal::write8(std::vector< unsigned char > * buffer, sal_uInt8 value) { void Marshal::write8(std::vector< unsigned char > * buffer, sal_uInt8 value) {
assert(buffer != 0); assert(buffer != nullptr);
buffer->push_back(value); buffer->push_back(value);
} }
...@@ -187,7 +187,7 @@ void Marshal::writeValue( ...@@ -187,7 +187,7 @@ void Marshal::writeValue(
std::vector< unsigned char > * buffer, std::vector< unsigned char > * buffer,
css::uno::TypeDescription const & type, void const * value) css::uno::TypeDescription const & type, void const * value)
{ {
assert(buffer != 0 && type.is()); assert(buffer != nullptr && type.is());
type.makeComplete(); type.makeComplete();
switch (type.get()->eTypeClass) { switch (type.get()->eTypeClass) {
case typelib_TypeClass_VOID: case typelib_TypeClass_VOID:
...@@ -279,11 +279,11 @@ void Marshal::writeMemberValues( ...@@ -279,11 +279,11 @@ void Marshal::writeMemberValues(
type.is() && type.is() &&
(type.get()->eTypeClass == typelib_TypeClass_STRUCT || (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) && type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
aggregateValue != 0); aggregateValue != nullptr);
type.makeComplete(); type.makeComplete();
typelib_CompoundTypeDescription * ctd = typelib_CompoundTypeDescription * ctd =
reinterpret_cast< typelib_CompoundTypeDescription * >(type.get()); reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
if (ctd->pBaseTypeDescription != 0) { if (ctd->pBaseTypeDescription != nullptr) {
writeMemberValues( writeMemberValues(
buffer, buffer,
css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase),
......
...@@ -42,12 +42,12 @@ namespace binaryurp { ...@@ -42,12 +42,12 @@ namespace binaryurp {
namespace { namespace {
extern "C" void SAL_CALL proxy_acquireInterface(uno_Interface * pInterface) { extern "C" void SAL_CALL proxy_acquireInterface(uno_Interface * pInterface) {
assert(pInterface != 0); assert(pInterface != nullptr);
static_cast< Proxy * >(pInterface)->do_acquire(); static_cast< Proxy * >(pInterface)->do_acquire();
} }
extern "C" void SAL_CALL proxy_releaseInterface(uno_Interface * pInterface) { extern "C" void SAL_CALL proxy_releaseInterface(uno_Interface * pInterface) {
assert(pInterface != 0); assert(pInterface != nullptr);
static_cast< Proxy * >(pInterface)->do_release(); static_cast< Proxy * >(pInterface)->do_release();
} }
...@@ -55,7 +55,7 @@ extern "C" void SAL_CALL proxy_dispatchInterface( ...@@ -55,7 +55,7 @@ extern "C" void SAL_CALL proxy_dispatchInterface(
uno_Interface * pUnoI, typelib_TypeDescription const * pMemberType, uno_Interface * pUnoI, typelib_TypeDescription const * pMemberType,
void * pReturn, void ** pArgs, uno_Any ** ppException) void * pReturn, void ** pArgs, uno_Any ** ppException)
{ {
assert(pUnoI != 0); assert(pUnoI != nullptr);
static_cast< Proxy * >(pUnoI)->do_dispatch( static_cast< Proxy * >(pUnoI)->do_dispatch(
pMemberType, pReturn, pArgs, ppException); pMemberType, pReturn, pArgs, ppException);
} }
...@@ -132,12 +132,12 @@ void Proxy::do_dispatch_throw( ...@@ -132,12 +132,12 @@ void Proxy::do_dispatch_throw(
void ** arguments, uno_Any ** exception) const void ** arguments, uno_Any ** exception) const
{ {
//TODO: Optimize queryInterface: //TODO: Optimize queryInterface:
assert(member != 0); assert(member != nullptr);
bool bSetter = false; bool bSetter = false;
std::vector< BinaryAny > inArgs; std::vector< BinaryAny > inArgs;
switch (member->eTypeClass) { switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE: case typelib_TypeClass_INTERFACE_ATTRIBUTE:
bSetter = returnValue == 0; bSetter = returnValue == nullptr;
if (bSetter) { if (bSetter) {
inArgs.push_back( inArgs.push_back(
BinaryAny( BinaryAny(
...@@ -178,7 +178,7 @@ void Proxy::do_dispatch_throw( ...@@ -178,7 +178,7 @@ void Proxy::do_dispatch_throw(
{ {
assert(ret.getType().get()->eTypeClass == typelib_TypeClass_EXCEPTION); assert(ret.getType().get()->eTypeClass == typelib_TypeClass_EXCEPTION);
uno_any_construct( uno_any_construct(
*exception, ret.getValue(ret.getType()), ret.getType().get(), 0); *exception, ret.getValue(ret.getType()), ret.getType().get(), nullptr);
} else { } else {
switch (member->eTypeClass) { switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE: case typelib_TypeClass_INTERFACE_ATTRIBUTE:
...@@ -188,7 +188,7 @@ void Proxy::do_dispatch_throw( ...@@ -188,7 +188,7 @@ void Proxy::do_dispatch_throw(
typelib_InterfaceAttributeTypeDescription const * >( typelib_InterfaceAttributeTypeDescription const * >(
member)-> member)->
pAttributeTypeRef); pAttributeTypeRef);
uno_copyData(returnValue, ret.getValue(t), t.get(), 0); uno_copyData(returnValue, ret.getValue(t), t.get(), nullptr);
} }
break; break;
case typelib_TypeClass_INTERFACE_METHOD: case typelib_TypeClass_INTERFACE_METHOD:
...@@ -199,7 +199,7 @@ void Proxy::do_dispatch_throw( ...@@ -199,7 +199,7 @@ void Proxy::do_dispatch_throw(
member); member);
css::uno::TypeDescription t(mtd->pReturnTypeRef); css::uno::TypeDescription t(mtd->pReturnTypeRef);
if (t.get()->eTypeClass != typelib_TypeClass_VOID) { if (t.get()->eTypeClass != typelib_TypeClass_VOID) {
uno_copyData(returnValue, ret.getValue(t), t.get(), 0); uno_copyData(returnValue, ret.getValue(t), t.get(), nullptr);
} }
std::vector< BinaryAny >::iterator i(outArgs.begin()); std::vector< BinaryAny >::iterator i(outArgs.begin());
for (sal_Int32 j = 0; j != mtd->nParams; ++j) { for (sal_Int32 j = 0; j != mtd->nParams; ++j) {
...@@ -208,10 +208,10 @@ void Proxy::do_dispatch_throw( ...@@ -208,10 +208,10 @@ void Proxy::do_dispatch_throw(
if (mtd->pParams[j].bIn) { if (mtd->pParams[j].bIn) {
(void) uno_assignData( (void) uno_assignData(
arguments[j], pt.get(), i++->getValue(pt), arguments[j], pt.get(), i++->getValue(pt),
pt.get(), 0, 0, 0); pt.get(), nullptr, nullptr, nullptr);
} else { } else {
uno_copyData( uno_copyData(
arguments[j], i++->getValue(pt), pt.get(), 0); arguments[j], i++->getValue(pt), pt.get(), nullptr);
} }
} }
} }
...@@ -222,14 +222,14 @@ void Proxy::do_dispatch_throw( ...@@ -222,14 +222,14 @@ void Proxy::do_dispatch_throw(
assert(false); // this cannot happen assert(false); // this cannot happen
break; break;
} }
*exception = 0; *exception = nullptr;
} }
} }
bool Proxy::isProxy( bool Proxy::isProxy(
rtl::Reference< Bridge > const & bridge, OUString * oid) const rtl::Reference< Bridge > const & bridge, OUString * oid) const
{ {
assert(oid != 0); assert(oid != nullptr);
if (bridge == bridge_) { if (bridge == bridge_) {
*oid = oid_; *oid = oid_;
return true; return true;
......
...@@ -79,7 +79,7 @@ css::uno::Sequence< sal_Int8 > read( ...@@ -79,7 +79,7 @@ css::uno::Sequence< sal_Int8 > read(
} }
extern "C" void SAL_CALL request(void * pThreadSpecificData) { extern "C" void SAL_CALL request(void * pThreadSpecificData) {
assert(pThreadSpecificData != 0); assert(pThreadSpecificData != nullptr);
std::unique_ptr< IncomingRequest >( std::unique_ptr< IncomingRequest >(
static_cast< IncomingRequest * >(pThreadSpecificData))-> static_cast< IncomingRequest * >(pThreadSpecificData))->
execute(); execute();
...@@ -359,7 +359,7 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) { ...@@ -359,7 +359,7 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) {
ret.getType().get())) ret.getType().get()))
{ {
sal_Int32 n = 0; sal_Int32 n = 0;
typelib_TypeDescriptionReference ** p = 0; typelib_TypeDescriptionReference ** p = nullptr;
switch (req.member.get()->eTypeClass) { switch (req.member.get()->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE: case typelib_TypeClass_INTERFACE_ATTRIBUTE:
{ {
...@@ -443,7 +443,7 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) { ...@@ -443,7 +443,7 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) {
std::unique_ptr< IncomingReply > resp( std::unique_ptr< IncomingReply > resp(
new IncomingReply(exc, ret, outArgs)); new IncomingReply(exc, ret, outArgs));
uno_threadpool_putJob( uno_threadpool_putJob(
bridge_->getThreadPool(), tid.getHandle(), resp.get(), 0, bridge_->getThreadPool(), tid.getHandle(), resp.get(), nullptr,
false); false);
resp.release(); resp.release();
break; break;
......
...@@ -56,7 +56,7 @@ namespace { ...@@ -56,7 +56,7 @@ namespace {
void * allocate(sal_Size size) { void * allocate(sal_Size size) {
void * p = rtl_allocateMemory(size); void * p = rtl_allocateMemory(size);
if (p == 0) { if (p == nullptr) {
throw std::bad_alloc(); throw std::bad_alloc();
} }
return p; return p;
...@@ -70,12 +70,12 @@ std::vector< BinaryAny >::iterator copyMemberValues( ...@@ -70,12 +70,12 @@ std::vector< BinaryAny >::iterator copyMemberValues(
type.is() && type.is() &&
(type.get()->eTypeClass == typelib_TypeClass_STRUCT || (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) && type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
buffer != 0); buffer != nullptr);
type.makeComplete(); type.makeComplete();
std::vector< BinaryAny >::iterator i(it); std::vector< BinaryAny >::iterator i(it);
typelib_CompoundTypeDescription * ctd = typelib_CompoundTypeDescription * ctd =
reinterpret_cast< typelib_CompoundTypeDescription * >(type.get()); reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
if (ctd->pBaseTypeDescription != 0) { if (ctd->pBaseTypeDescription != nullptr) {
i = copyMemberValues( i = copyMemberValues(
css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), i, css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), i,
buffer); buffer);
...@@ -84,7 +84,7 @@ std::vector< BinaryAny >::iterator copyMemberValues( ...@@ -84,7 +84,7 @@ std::vector< BinaryAny >::iterator copyMemberValues(
uno_type_copyData( uno_type_copyData(
static_cast< char * >(buffer) + ctd->pMemberOffsets[j], static_cast< char * >(buffer) + ctd->pMemberOffsets[j],
i++->getValue(css::uno::TypeDescription(ctd->ppTypeRefs[j])), i++->getValue(css::uno::TypeDescription(ctd->ppTypeRefs[j])),
ctd->ppTypeRefs[j], 0); ctd->ppTypeRefs[j], nullptr);
} }
return i; return i;
} }
...@@ -345,7 +345,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { ...@@ -345,7 +345,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
raw.pType = reinterpret_cast< typelib_TypeDescriptionReference * >( raw.pType = reinterpret_cast< typelib_TypeDescriptionReference * >(
type.get()); type.get());
raw.pData = buf; raw.pData = buf;
raw.pReserved = 0; raw.pReserved = nullptr;
return BinaryAny(raw); return BinaryAny(raw);
} }
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
...@@ -427,7 +427,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) { ...@@ -427,7 +427,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
"binaryurp::Unmarshal: sequence size too large"); "binaryurp::Unmarshal: sequence size too large");
} }
if (n == 0) { if (n == 0) {
return BinaryAny(type, 0); return BinaryAny(type, nullptr);
} }
css::uno::TypeDescription ctd( css::uno::TypeDescription ctd(
reinterpret_cast< typelib_IndirectTypeDescription * >( reinterpret_cast< typelib_IndirectTypeDescription * >(
...@@ -461,7 +461,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) { ...@@ -461,7 +461,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
for (sal_uInt32 i = 0; i != n; ++i) { for (sal_uInt32 i = 0; i != n; ++i) {
uno_copyData( uno_copyData(
static_cast< sal_Sequence * >(buf)->elements + i * ctd.get()->nSize, static_cast< sal_Sequence * >(buf)->elements + i * ctd.get()->nSize,
as[i].getValue(ctd), ctd.get(), 0); as[i].getValue(ctd), ctd.get(), nullptr);
} }
return BinaryAny(type, &buf); return BinaryAny(type, &buf);
} }
...@@ -473,11 +473,11 @@ void Unmarshal::readMemberValues( ...@@ -473,11 +473,11 @@ void Unmarshal::readMemberValues(
type.is() && type.is() &&
(type.get()->eTypeClass == typelib_TypeClass_STRUCT || (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) && type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
values != 0); values != nullptr);
type.makeComplete(); type.makeComplete();
typelib_CompoundTypeDescription * ctd = typelib_CompoundTypeDescription * ctd =
reinterpret_cast< typelib_CompoundTypeDescription * >(type.get()); reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
if (ctd->pBaseTypeDescription != 0) { if (ctd->pBaseTypeDescription != nullptr) {
readMemberValues( readMemberValues(
css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase),
values); values);
......
...@@ -204,7 +204,7 @@ void Writer::sendRequest( ...@@ -204,7 +204,7 @@ void Writer::sendRequest(
typelib_InterfaceAttributeTypeDescription * atd = typelib_InterfaceAttributeTypeDescription * atd =
reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >( reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
member.get()); member.get());
OSL_ASSERT(atd->pInterface != 0); OSL_ASSERT(atd->pInterface != nullptr);
if (!t.is()) { if (!t.is()) {
t = css::uno::TypeDescription(&atd->pInterface->aBase); t = css::uno::TypeDescription(&atd->pInterface->aBase);
} }
...@@ -221,7 +221,7 @@ void Writer::sendRequest( ...@@ -221,7 +221,7 @@ void Writer::sendRequest(
typelib_InterfaceMethodTypeDescription * mtd = typelib_InterfaceMethodTypeDescription * mtd =
reinterpret_cast< typelib_InterfaceMethodTypeDescription * >( reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
member.get()); member.get());
assert(mtd->pInterface != 0); assert(mtd->pInterface != nullptr);
if (!t.is()) { if (!t.is()) {
t = css::uno::TypeDescription(&mtd->pInterface->aBase); t = css::uno::TypeDescription(&mtd->pInterface->aBase);
} }
......
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