Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACE6_TAO2] Fixed some warnings #2307

Draft
wants to merge 1 commit into
base: ace6tao2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TAO/TAO_IDL/be/be_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ be_interface::copy_ctor_helper (be_interface *derived,
{
// We can't call ourselves in a copy constructor, and
// abstract interfaces don't exist on the skeleton side.
if (derived == base || base->is_abstract ())
if (derived == base || base->is_abstract () || derived->nmembers () > 0)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ TAO_IDL_Copy_Ctor_Worker::emit (be_interface *derived,
TAO_OutStream *os,
be_interface *base)
{
if (derived == base)
if (derived == base || derived->nmembers () > 0)
{
return 0;
}
Expand Down
24 changes: 18 additions & 6 deletions TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,17 @@ be_visitor_interface_ss::visit_interface (be_interface *node)

*os << full_skel_name << "::"
<< local_name_prefix << node_local_name
<< " (void)" << be_idt_nl;
<< " ()";

*os << ": TAO_ServantBase ()" << be_uidt_nl;
bool const init_bases = node->nmembers () == 0;
if (init_bases)
{
*os << be_idt_nl << ": TAO_ServantBase ()" << be_uidt_nl;
}
else
{
*os << be_nl;
}

// Default constructor body.
*os << "{" << be_idt_nl
Expand All @@ -121,11 +129,15 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
*os << full_skel_name << "::"
<< local_name_prefix << node_local_name << " ("
<< "const " << local_name_prefix
<< node_local_name << "& rhs)";
<< node_local_name << " &"
<< (init_bases ? "rhs" : "") << ")";

*os << be_idt_nl
<< ": TAO_Abstract_ServantBase (rhs)," << be_nl
<< " TAO_ServantBase (rhs)";
if (init_bases)
{
*os << be_idt_nl
<< ": TAO_Abstract_ServantBase (rhs)," << be_nl
<< " TAO_ServantBase (rhs)";
}

if (this->generate_copy_ctor (node, os) == -1)
{
Expand Down
43 changes: 24 additions & 19 deletions TAO/tao/Bounded_Array_Sequence_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,38 @@ class bounded_array_sequence
namespace TAO
{
template <typename stream, typename T_array, typename T_slice, typename T_tag, CORBA::ULong MAX>
bool demarshal_sequence(stream & strm, TAO::bounded_array_sequence<T_array, T_slice, T_tag, MAX> & target) {
bool demarshal_sequence (stream &strm, TAO::bounded_array_sequence<T_array, T_slice, T_tag, MAX> &target) {
typedef typename TAO::bounded_array_sequence<T_array, T_slice, T_tag, MAX> sequence;
typedef TAO_Array_Forany_T<T_array, T_slice, T_tag> forany;
typedef TAO::Array_Traits<forany> array_traits;

::CORBA::ULong new_length = 0;
if (!(strm >> new_length)) {
return false;
}
if ((new_length > strm.length()) || (new_length > target.maximum ())) {
return false;
}
sequence tmp;
tmp.length(new_length);
typename sequence::value_type * buffer = tmp.get_buffer();
for(CORBA::ULong i = 0; i < new_length; ++i) {
forany tmp (array_traits::alloc ());
bool const _tao_marshal_flag = (strm >> tmp);
if (_tao_marshal_flag) {
array_traits::copy (buffer[i], tmp.in ());
if (!(strm >> new_length))
{
return false;
}
array_traits::free (tmp.inout ());
if (!_tao_marshal_flag) {
if ((new_length > strm.length ()) || (new_length > target.maximum ()))
{
return false;
}
}
tmp.swap(target);
sequence tmp;
tmp.length (new_length);
typename sequence::value_type *const buffer = tmp.get_buffer ();
for (CORBA::ULong i = 0; i < new_length; ++i)
{
forany wrapper (array_traits::alloc ());
bool const _tao_marshal_flag = strm >> wrapper;
if (_tao_marshal_flag)
{
array_traits::copy (buffer[i], wrapper.in ());
}
array_traits::free (wrapper.inout ());
if (!_tao_marshal_flag)
{
return false;
}
}
tmp.swap (target);
return true;
}

Expand Down
43 changes: 24 additions & 19 deletions TAO/tao/Unbounded_Array_Sequence_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,38 @@ class unbounded_array_sequence
namespace TAO
{
template <typename stream, typename T_array, typename T_slice, typename T_tag>
bool demarshal_sequence(stream & strm, TAO::unbounded_array_sequence<T_array, T_slice, T_tag> & target) {
bool demarshal_sequence (stream &strm, TAO::unbounded_array_sequence<T_array, T_slice, T_tag> &target) {
typedef TAO::unbounded_array_sequence<T_array, T_slice, T_tag> sequence;
typedef TAO_Array_Forany_T <T_array, T_slice, T_tag> forany;
typedef TAO::Array_Traits<forany> array_traits;

::CORBA::ULong new_length = 0;
if (!(strm >> new_length)) {
return false;
}
if (new_length > strm.length()) {
return false;
}
sequence tmp(new_length);
tmp.length(new_length);
typename sequence::value_type * buffer = tmp.get_buffer();
for(CORBA::ULong i = 0; i < new_length; ++i) {
forany tmp (array_traits::alloc ());
bool const _tao_marshal_flag = (strm >> tmp);
if (_tao_marshal_flag) {
array_traits::copy (buffer[i], tmp.in ());
if (!(strm >> new_length))
{
return false;
}
array_traits::free (tmp.inout ());
if (!_tao_marshal_flag) {
if (new_length > strm.length ())
{
return false;
}
}
tmp.swap(target);
sequence tmp (new_length);
tmp.length (new_length);
typename sequence::value_type *const buffer = tmp.get_buffer ();
for (CORBA::ULong i = 0; i < new_length; ++i)
{
forany wrapper (array_traits::alloc ());
bool const _tao_marshal_flag = strm >> wrapper;
if (_tao_marshal_flag)
{
array_traits::copy (buffer[i], wrapper.in ());
}
array_traits::free (wrapper.inout ());
if (!_tao_marshal_flag)
{
return false;
}
}
tmp.swap (target);
return true;
}

Expand Down
Loading