summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp129
1 files changed, 32 insertions, 97 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
index 5995c25313b..808646a479d 100644
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
@@ -72,25 +72,6 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node)
-1);
}
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // @@ (JP) TODO - change state arg to _CI when the rest of
- // the cdr_op files get unhacked.
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
// for anonymous arrays, the type name has a _ prepended. We compute the
// fullname with or without the underscore and use it later on.
char fname [NAMEBUFSIZE]; // to hold the full and
@@ -301,91 +282,45 @@ be_visitor_array_cdr_op_ci::visit_predefined_type (be_predefined_type *node)
}
// handle special case to avoid compiler errors
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " ((";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << " ((const ";
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
-
switch (node->pt ())
{
- case AST_PredefinedType::PT_long:
- *os << "ACE_CDR::Long *)";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ACE_CDR::ULong *)";
- break;
- case AST_PredefinedType::PT_short:
- *os << "ACE_CDR::Short *)";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ACE_CDR::UShort *)";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "ACE_CDR::Octet *)";
- break;
case AST_PredefinedType::PT_char:
- *os << "ACE_CDR::Char *)";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "ACE_CDR::WChar *)";
- break;
- case AST_PredefinedType::PT_float:
- *os << "ACE_CDR::Float *)";
- break;
- case AST_PredefinedType::PT_double:
- *os << "ACE_CDR::Double *)";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "ACE_CDR::LongLong *)";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ACE_CDR::ULongLong *)";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "ACE_CDR::LongDouble *)";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "ACE_CDR::Boolean *)";
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << " ((char *)_tao_array.inout (), ";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << " ((const char *)_tao_array.in (), ";
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_ci::"
+ "visit_predefined_type - "
+ "bad substate in context\n"),
+ -1);
+ }
break;
default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // handle special case to avoid compiler errors
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " _tao_array.out (), ";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "_tao_array.in (), ";
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << " (_tao_array.inout (), ";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << " (_tao_array.in (), ";
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_ci::"
+ "visit_predefined_type - "
+ "bad substate in context\n"),
+ -1);
+ }
break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
}
-
// generate a product of all the dimensions. This will be the total length of
// the "unfolded" single dimensional array.
for (i = 0; i < array->n_dims (); i++)