From f1e42feed37f849562a1782f7f80a8ad371a3e46 Mon Sep 17 00:00:00 2001 From: Huang-Ming Huang Date: Thu, 22 Sep 2016 16:38:33 -0500 Subject: Remove null reference checks --- TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp | 12 ------------ TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp | 9 --------- TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp | 8 -------- TAO/tao/AnyTypeCode/Any.cpp | 15 ++++++--------- 4 files changed, 6 insertions(+), 38 deletions(-) diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp index e9fe0189bca..fb60b2eb2e4 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp @@ -221,12 +221,6 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) << ")" << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" - << be_idt_nl - << "_tao_any <<= static_cast< ::" << node->name () - << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T< ::" << node->name () << ">::insert_copy (" << be_idt << be_idt_nl << "_tao_any," << be_nl @@ -301,12 +295,6 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" - << be_idt_nl - << "_tao_any <<= static_cast<" << node->name () - << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy (" << be_idt << be_idt_nl << "_tao_any," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp index a898b868ff2..33402290f7a 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp @@ -113,11 +113,6 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl - << "_tao_any <<= static_cast< ::" << node->name () << " *>( 0 ); " - << "// Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T< ::" << node->name () << ">::insert_copy (" << be_idt << be_idt_nl << "_tao_any," << be_nl @@ -191,10 +186,6 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl - << "_tao_any <<= static_cast<" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy (" << be_idt_nl << "_tao_any," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp index 25ef8997291..73ff0b66ce8 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp @@ -109,10 +109,6 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) << ")" << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl - << "_tao_any <<= static_cast< ::" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T< ::" << node->name () << ">::insert_copy (" << be_idt << be_idt_nl << "_tao_any," << be_nl @@ -186,10 +182,6 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) << ")" << be_uidt_nl << "{" << be_idt_nl - << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl - << "_tao_any <<= static_cast<" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl - << "else" << be_idt_nl - << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy (" << be_idt << be_idt_nl << "_tao_any," << be_nl diff --git a/TAO/tao/AnyTypeCode/Any.cpp b/TAO/tao/AnyTypeCode/Any.cpp index 13619326827..b74124189a3 100644 --- a/TAO/tao/AnyTypeCode/Any.cpp +++ b/TAO/tao/AnyTypeCode/Any.cpp @@ -425,15 +425,12 @@ operator<<= (CORBA::Any &any, CORBA::LongDouble ld) void operator<<= (CORBA::Any &any, const CORBA::Any &a) { - if (0 == &a) // Trying to de-reference NULL Any - any <<= static_cast( 0 ); // Use non-copying insertion of a NULL - else - TAO::Any_Dual_Impl_T::insert_copy ( - any, - CORBA::Any::_tao_any_destructor, - CORBA::_tc_any, - a - ); + TAO::Any_Dual_Impl_T::insert_copy ( + any, + CORBA::Any::_tao_any_destructor, + CORBA::_tc_any, + a + ); } // Insertion of Any - non-copying. -- cgit v1.2.1