summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang-Ming Huang <huangh@ociweb.com>2016-09-22 16:38:33 -0500
committerHuang-Ming Huang <huangh@ociweb.com>2016-09-22 16:38:33 -0500
commitf1e42feed37f849562a1782f7f80a8ad371a3e46 (patch)
treeb6345d93944ece5cd1aed170a6e0e08be6a03efa
parent784a25d9950a1c5587a1ca51c41ca6f84b9e3e60 (diff)
downloadATCD-f1e42feed37f849562a1782f7f80a8ad371a3e46.tar.gz
Remove null reference checks
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp9
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp8
-rw-r--r--TAO/tao/AnyTypeCode/Any.cpp15
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<CORBA::Any *>( 0 ); // Use non-copying insertion of a NULL
- else
- TAO::Any_Dual_Impl_T<CORBA::Any>::insert_copy (
- any,
- CORBA::Any::_tao_any_destructor,
- CORBA::_tc_any,
- a
- );
+ TAO::Any_Dual_Impl_T<CORBA::Any>::insert_copy (
+ any,
+ CORBA::Any::_tao_any_destructor,
+ CORBA::_tc_any,
+ a
+ );
}
// Insertion of Any - non-copying.