summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-02-09 18:13:19 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-02-09 18:13:19 +0000
commit4eb7734dbc8ba855788857188532f467571e27d9 (patch)
tree80b59c5df5338b0aace6b5c4c5cfbd4cb7508046 /TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
parentaf674f6e56db98fbaffea8ee1d0a6fad201cf871 (diff)
downloadATCD-4eb7734dbc8ba855788857188532f467571e27d9.tar.gz
ChangeLogTag: Tue Feb 9 18:12:00 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
index 16fe99b84fc..9e774b8c4dd 100644
--- a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
@@ -41,14 +41,21 @@ be_visitor_native_ch::visit_native (be_native *node)
TAO_OutStream *os = this->ctx_->stream ();
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
+ *os << be_nl << be_nl
+ << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__
+ << be_nl << be_nl;
const char *node_name = node->full_name ();
+
if (ACE_OS::strcmp (node_name, "PortableServer::ServantLocator::Cookie") == 0)
- *os << "typedef void *Cookie;" << be_nl;
+ {
+ *os << "typedef void *Cookie;" << be_nl;
+ }
else if (ACE_OS::strcmp (node_name, "CORBA::VoidData") == 0)
- *os << "typedef void *VoidData;" << be_nl;
+ {
+ *os << "typedef void *VoidData;" << be_nl;
+ }
else if (idl_global->dcps_support_zero_copy_read ()
&& 0 == ACE_OS::strcmp (node->full_name (),"DDS::SampleInfoSeq"))
{
@@ -68,13 +75,17 @@ be_visitor_native_ch::visit_native (be_native *node)
// strip the "Seq" ending to get the sample's name
const size_t max_name_length = 2000;
+
if (ACE_OS::strlen (node_name) >= max_name_length)
{
return -1;
}
+
char sample_name[max_name_length];
- ACE_OS::strncpy (sample_name, node_name, ACE_OS::strlen (node_name)-3);
- sample_name[ACE_OS::strlen (node_name)-3] = '\0';
+ ACE_OS::strncpy (sample_name,
+ node_name,
+ ACE_OS::strlen (node_name) - 3);
+ sample_name[ACE_OS::strlen (node_name) - 3] = '\0';
*os << be_nl << be_nl
<< "typedef ::TAO::DCPS::ZeroCopyDataSeq< "