diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2022-09-14 09:16:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 09:16:25 +0200 |
commit | 0a03a4b940b9bb549587d3f22eab9e66d617551c (patch) | |
tree | ab1063cad9ab175c57cca9e06d584d06d20adadd /TAO | |
parent | a457e9d14d9d6aa686ff2ab0498568ced4118a05 (diff) | |
parent | 0615e6ef888bdcbbae4324e1dcbd04a21516e0e3 (diff) | |
download | ATCD-0a03a4b940b9bb549587d3f22eab9e66d617551c.tar.gz |
Merge pull request #1926 from jwillemsen/jwi-taoidlnullptr3
Use nullptr, check pointers with 1, use std::addressof, reduced sloc
Diffstat (limited to 'TAO')
12 files changed, 83 insertions, 84 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp index 6e961b2528c..3390d8f9154 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp @@ -76,8 +76,8 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) *os << "void operator<<= (" << be_idt << be_idt_nl << "::CORBA::Any &_tao_any," << be_nl - << "const " << node->name () << "_forany &_tao_elem" << be_uidt_nl - << ")" << be_uidt_nl + << "const " << node->name () << "_forany &_tao_elem)" << be_uidt_nl + << be_uidt_nl << "{" << be_idt_nl << "TAO::Any_Array_Impl_T<" << be_idt << be_idt_nl << node->name () << "_slice," << be_nl @@ -96,8 +96,8 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) *os << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl << "const ::CORBA::Any &_tao_any," << be_nl - << node->name () << "_forany &_tao_elem" << be_uidt_nl - << ")" << be_uidt_nl + << node->name () << "_forany &_tao_elem)" << be_uidt_nl + << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl << "TAO::Any_Array_Impl_T<" << be_idt << be_idt_nl @@ -107,8 +107,8 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) << "_tao_any," << be_nl << node->name () << "_forany::_tao_any_destructor," << be_nl << (td != nullptr ? td->tc_name () : node->tc_name ()) << "," << be_nl - << "_tao_elem.out ()" << be_uidt_nl - << ");" << be_uidt << be_uidt << be_uidt << be_uidt_nl + << "_tao_elem.out ());" << be_uidt + << be_uidt << be_uidt << be_uidt << be_uidt_nl << "}"; *os << be_global->anyops_versioning_end () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp index 6cb4edbe275..88323b99c55 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp @@ -215,7 +215,7 @@ be_visitor_executor_exs::visit_component (be_component *node) << "reactor = orb->orb_core ()->reactor ();" << be_uidt_nl << "}" << be_uidt << be_uidt_nl << "}" - << be_uidt_nl << "if (reactor == 0)" << be_idt_nl + << be_uidt_nl << "if (!reactor)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::INTERNAL ();" << be_uidt_nl << "}" diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp index 6edb3250910..34f73a86050 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp @@ -664,7 +664,7 @@ be_visitor_servant_svs::gen_provides_top () << "const char * name)" << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (name == 0)" << be_idt_nl + os_ << "if (!name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt << be_nl_2; @@ -713,7 +713,7 @@ be_visitor_servant_svs::gen_publishes_top () << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (publisher_name == 0)" << be_idt_nl + os_ << "if (!publisher_name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -742,7 +742,7 @@ be_visitor_servant_svs::gen_publishes_top () << "::Components::Cookie * ck)" << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (publisher_name == 0)" << be_idt_nl + os_ << "if (!publisher_name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -819,7 +819,7 @@ be_visitor_servant_svs::gen_uses_top () << "::CORBA::Object_ptr connection)" << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (name == 0)" << be_idt_nl + os_ << "if (!name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -849,7 +849,7 @@ be_visitor_servant_svs::gen_uses_top () << (this->node_->has_uses_multiple () ? "ck" : "/* ck */") << ")" << be_uidt_nl << "{" << be_idt_nl - << "if (name == 0)" << be_idt_nl + << "if (!name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -936,7 +936,7 @@ be_visitor_servant_svs::gen_emits_top () << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (emitter_name == 0)" << be_idt_nl + os_ << "if (!emitter_name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -964,7 +964,7 @@ be_visitor_servant_svs::gen_emits_top () << "const char * source_name)" << be_uidt_nl << "{" << be_idt_nl; - os_ << "if (source_name == 0)" << be_idt_nl + os_ << "if (!source_name)" << be_idt_nl << "{" << be_idt_nl << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl << "}" << be_uidt; @@ -1265,7 +1265,7 @@ be_visitor_disconnect_block::visit_uses (be_uses *node) if (is_multiple) { - os_ << "if (ck == 0)" << be_idt_nl + os_ << "if (!ck)" << be_idt_nl << "{" << be_idt_nl << "throw ::Components::CookieRequired ();" << be_uidt_nl << "}" << be_uidt_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp index 909eb22fad3..4e5559aa935 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -275,7 +275,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "TAO_AnyTypeCode_Adapter *adapter =" << be_idt_nl << "ACE_Dynamic_Service<TAO_AnyTypeCode_Adapter>::instance (" << "\"AnyTypeCode_Adapter\");" << be_uidt_nl - << "if (adapter == 0)" << be_idt_nl + << "if (!adapter)" << be_idt_nl << "{" << be_idt_nl // FUZZ: disable check_for_ace_log_categories << "TAOLIB_ERROR_RETURN ((LM_ERROR," << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp index 97e173c8070..fd9383a8607 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp @@ -122,7 +122,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) << "{" << be_idt_nl << node->full_name () << "_ptr _tao_objptr =" << be_idt_nl << node->full_name () << "::_duplicate (_tao_elem);" << be_uidt_nl - << "_tao_any <<= &_tao_objptr;" << be_uidt_nl + << "_tao_any <<= std::addressof(_tao_objptr);" << be_uidt_nl << "}" << be_nl_2; *os << "/// Non-copying insertion." << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp index c9445b0a620..37d37f6a4a2 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp @@ -214,8 +214,7 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << "return proxy;" << be_uidt_nl << "}" << be_uidt_nl << be_nl << "// Verify that an <proxy_factory_> is available else make one." << be_nl - << "if (" - <<"this->proxy_factory_ == 0)" << be_idt_nl + << "if (!this->proxy_factory_)" << be_idt_nl << "ACE_NEW_RETURN (" << "this->proxy_factory_," << be_idt << be_idt_nl << "TAO_" << node->flat_name () diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp index 8bc43ce8117..3455662f9f8 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp @@ -105,7 +105,7 @@ TAO::be_visitor_struct_typecode::visit (AST_Structure * node, { // Should only be possible for user exceptions with no fields. os << "* const " << be_idt_nl - << fields_name.c_str () << " = 0;" << be_uidt_nl << be_uidt_nl; + << fields_name.c_str () << " = nullptr;" << be_uidt_nl << be_uidt_nl; } else { diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp index 66b5843fc78..c0ab0850bbf 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp @@ -218,7 +218,7 @@ int be_visitor_union_cs::visit_union (be_union *node) << node->name () << " &u)" << be_nl; *os << "{" << be_idt_nl; // First check for self-assignment. - *os << "if (&u == this)" << be_idt_nl + *os << "if (std::addressof(u) == this)" << be_idt_nl << "{" << be_idt_nl << "return *this;" << be_uidt_nl << "}" << be_uidt_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp index 0fb1c2a0f9b..9cd5e801add 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp @@ -250,9 +250,9 @@ be_visitor_union_branch_public_assign_cs::visit_interface (be_interface *node) bool bt_is_defined = node->is_defined (); - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl; @@ -304,8 +304,8 @@ be_visitor_union_branch_public_assign_cs::visit_interface (be_interface *node) << "u.u_." << ub->local_name () << "_->in ()" << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ")," << be_uidt_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; + << "*this);" << be_uidt + << be_uidt << be_uidt_nl; } *os << "}" << be_uidt << be_uidt_nl; @@ -347,9 +347,9 @@ be_visitor_union_branch_public_assign_cs::visit_interface_fwd ( bool bt_is_defined = node->full_definition ()->is_defined (); - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl; @@ -401,8 +401,8 @@ be_visitor_union_branch_public_assign_cs::visit_interface_fwd ( << "u.u_." << ub->local_name () << "_->in ()" << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ")," << be_uidt_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; + << "*this);" << be_uidt + << be_uidt << be_uidt_nl; } *os << "}" << be_uidt << be_uidt_nl; @@ -460,9 +460,9 @@ be_visitor_union_branch_public_assign_cs::emit_valuetype_common (be_type *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl; @@ -489,8 +489,8 @@ be_visitor_union_branch_public_assign_cs::emit_valuetype_common (be_type *node) << "this->u_." << ub->local_name () << "_," << be_nl << "OBJECT_FIELD (u.u_." << ub->local_name () << "_->in ())," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; + << "*this);" << be_uidt + << be_uidt << be_uidt_nl; } *os << "}" << be_uidt << be_uidt_nl; @@ -555,8 +555,8 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( << "OBJECT_FIELD (::CORBA::Object" << "::_duplicate (u.u_." << ub->local_name () << "_->in ()))," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; + << "*this);" << be_uidt + << be_uidt << be_uidt_nl; } break; @@ -569,9 +569,9 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( case AST_PredefinedType::PT_any: if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -584,9 +584,9 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( } else { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -594,8 +594,8 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( << "this->u_." << ub->local_name () << "_," << be_nl << bt->name () << " (*u.u_." << ub->local_name () << "_)," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl + << "*this);" << be_uidt + << be_uidt << be_uidt_nl << "}" << be_uidt << be_uidt_nl; } @@ -644,9 +644,9 @@ be_visitor_union_branch_public_assign_cs::visit_sequence (be_sequence *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -659,9 +659,9 @@ be_visitor_union_branch_public_assign_cs::visit_sequence (be_sequence *node) } else { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -669,8 +669,8 @@ be_visitor_union_branch_public_assign_cs::visit_sequence (be_sequence *node) << "this->u_." << ub->local_name () << "_," << be_nl << bt->name () << " (*u.u_." << ub->local_name () << "_)," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl + << "*this);" << be_uidt + << be_uidt << be_uidt_nl << "}" << be_uidt << be_uidt_nl; } @@ -747,9 +747,9 @@ be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node) { if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -762,9 +762,9 @@ be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node) } else { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -772,8 +772,8 @@ be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node) << "this->u_." << ub->local_name () << "_," << be_nl << bt->name () << " (*u.u_." << ub->local_name () << "_)," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl + << "*this);" << be_uidt + << be_uidt << be_uidt_nl << "}" << be_uidt << be_uidt_nl; } } @@ -850,9 +850,9 @@ be_visitor_union_branch_public_assign_cs::visit_union (be_union *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -865,9 +865,9 @@ be_visitor_union_branch_public_assign_cs::visit_union (be_union *node) } else { - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl + *os << "if (!u.u_." << ub->local_name () << "_)" << be_idt_nl << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_uidt_nl << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl @@ -875,8 +875,8 @@ be_visitor_union_branch_public_assign_cs::visit_union (be_union *node) << "this->u_." << ub->local_name () << "_," << be_nl << bt->name () << " (*u.u_." << ub->local_name () << "_)," << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl + << "*this);" << be_uidt + << be_uidt << be_uidt_nl << "}" << be_uidt << be_uidt_nl; } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp index 8f5be509a22..b9f92332ee8 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp @@ -169,7 +169,7 @@ be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) *os << fname << "_free (this->u_." << ub->local_name () << "_);" << be_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_nl; + << "this->u_." << ub->local_name () << "_ = nullptr;" << be_nl; return 0; } @@ -216,7 +216,7 @@ be_visitor_union_branch_public_reset_cs::visit_interface (be_interface *) *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -243,7 +243,7 @@ be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd * *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -271,7 +271,7 @@ be_visitor_union_branch_public_reset_cs::visit_valuebox ( *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -299,7 +299,7 @@ be_visitor_union_branch_public_reset_cs::visit_valuetype ( *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -327,7 +327,7 @@ be_visitor_union_branch_public_reset_cs::visit_valuetype_fwd ( *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -359,21 +359,21 @@ be_visitor_union_branch_public_reset_cs::visit_predefined_type ( *os << "delete this->u_." << ub->local_name () << "_;" << be_nl; *os << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; break; case AST_PredefinedType::PT_pseudo: *os << "::CORBA::release (this->u_." << ub->local_name () << "_);" << be_nl; *os << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; break; case AST_PredefinedType::PT_any: *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; break; case AST_PredefinedType::PT_void: @@ -409,7 +409,7 @@ be_visitor_union_branch_public_reset_cs::visit_sequence ( << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -446,7 +446,7 @@ be_visitor_union_branch_public_reset_cs::visit_string ( *os << ub->local_name () << "_);" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; return 0; } @@ -488,7 +488,7 @@ be_visitor_union_branch_public_reset_cs::visit_structure ( << "_;" << be_nl << "this->u_." << ub->local_name () - << "_ = 0;" << be_nl; + << "_ = nullptr;" << be_nl; } return 0; @@ -548,7 +548,7 @@ be_visitor_union_branch_public_reset_cs::visit_union ( *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." - << ub->local_name () << "_ = 0;" << be_nl; + << ub->local_name () << "_ = nullptr;" << be_nl; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp index d784d89c9a1..944af69fd18 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp @@ -76,7 +76,7 @@ be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node) << be_uidt_nl << "{" << be_idt_nl << "::CORBA::add_ref (_tao_elem);" << be_nl - << "_tao_any <<= &_tao_elem;" << be_uidt_nl + << "_tao_any <<= std::addressof(_tao_elem);" << be_uidt_nl << "}" << be_nl_2; *os << "/// Non-copying insertion." << be_nl @@ -98,8 +98,8 @@ be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node) *os << "::CORBA::Boolean" << be_nl << "operator>>= (" << be_idt << be_idt_nl << "const ::CORBA::Any &_tao_any," << be_nl - << node->full_name () << " *&_tao_elem" << be_uidt_nl - << ")" << be_uidt_nl + << node->full_name () << " *&_tao_elem)" << be_uidt + << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl << "TAO::Any_Impl_T<" << node->name () << ">::extract (" @@ -107,8 +107,8 @@ be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node) << "_tao_any," << be_nl << node->name () << "::_tao_any_destructor," << be_nl << node->tc_name () << "," << be_nl - << "_tao_elem" << be_uidt_nl - << ");" << be_uidt << be_uidt << be_uidt_nl + << "_tao_elem);" << be_uidt + << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl_2; *os << be_global->anyops_versioning_end () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp index 4c5e2425408..7bcd9e89457 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp @@ -78,11 +78,11 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) << node->full_name () << " *_tao_copy =" << be_idt_nl << "_tao_elem ?" << be_idt_nl << node->full_name () << "::_downcast (_tao_elem->_copy_value ())" << be_nl - << ": 0;" << be_uidt << be_uidt_nl - << "_tao_any <<= &_tao_copy;" << be_uidt_nl + << ": nullptr;" << be_uidt << be_uidt_nl + << "_tao_any <<= std::addressof(_tao_copy);" << be_uidt_nl << "#else" << be_idt_nl << "::CORBA::add_ref (_tao_elem);" << be_nl - << "_tao_any <<= &_tao_elem;" << be_uidt_nl + << "_tao_any <<= std::addressof(_tao_elem);" << be_uidt_nl << "#endif" << be_uidt_nl << "}" << be_nl_2; @@ -105,8 +105,8 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) *os << "::CORBA::Boolean" << be_nl << "operator>>= (" << be_idt << be_idt_nl << "const ::CORBA::Any &_tao_any," << be_nl - << node->full_name () << " *&_tao_elem" << be_uidt_nl - << ")" << be_uidt_nl + << node->full_name () << " *&_tao_elem)" << be_uidt + << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl << "TAO::Any_Impl_T<" << node->name () << ">::extract (" @@ -114,8 +114,8 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) << "_tao_any," << be_nl << node->name () << "::_tao_any_destructor," << be_nl << node->tc_name () << "," << be_nl - << "_tao_elem" << be_uidt_nl - << ");" << be_uidt << be_uidt << be_uidt_nl + << "_tao_elem);" << be_uidt + << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl_2; *os << be_global->anyops_versioning_end () << be_nl; |