summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-16 15:10:13 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-16 15:10:13 +0000
commitc8fd035e8aa161c9bdd65ad892a27cff72e297f4 (patch)
treee0b8b4b9f1282aaf4843a72855c68f74f1e12691
parent25ab8826a9c3503b3f6d35ed4cd6bd12b88dc0f5 (diff)
downloadATCD-c8fd035e8aa161c9bdd65ad892a27cff72e297f4.tar.gz
The 'alloc_flag' argument to the _access() method is
sometimes used and sometimes not. To avoid unused arg warnings AND 'undefined' compile errors, had to add ACE_UNUSED_ARG (alloc_flag) on a case-by-case basis.
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp67
2 files changed, 38 insertions, 31 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
index 789394d6f72..ee9933346a7 100644
--- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
@@ -193,7 +193,7 @@ int be_visitor_union_cs::visit_union (be_union *node)
os->indent ();
*os << "// the virtual overloaded access method" << be_nl;
*os << "void *" << node->name () << "::_access ("
- << " CORBA::Boolean alloc_flag)" << be_nl;
+ << "CORBA::Boolean alloc_flag)" << be_nl;
*os << "{" << be_idt_nl;
*os << "switch (this->disc_)" << be_nl;
*os << "{" << be_idt_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp
index 04e57571655..c5f48b562b9 100644
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp
@@ -156,10 +156,10 @@ be_visitor_union_branch_public_access_cs::visit_array (be_array *node)
}
os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = " << fname
- << "_alloc ();" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "this->u_." << ub->local_name () << "_ = " << fname
+ << "_alloc ();" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
return 0;
}
@@ -181,7 +181,8 @@ be_visitor_union_branch_public_access_cs::visit_enum (be_enum *)
), -1);
}
TAO_OutStream *os = this->ctx_->stream ();
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
return 0;
}
@@ -211,12 +212,12 @@ be_visitor_union_branch_public_access_cs::visit_interface (be_interface *node)
), -1);
}
TAO_OutStream *os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, "
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, "
<< "(TAO_Object_Field_T<"
<< bt->name () << ","
- << bt->name () << "_var>), 0);" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ << bt->name () << "_var>), 0);" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
return 0;
}
@@ -238,7 +239,8 @@ be_visitor_union_branch_public_access_cs::visit_interface_fwd (be_interface_fwd
), -1);
}
TAO_OutStream *os = this->ctx_->stream ();
- *os << "return (CORBA::Object_ptr) &this->u_." << ub->local_name ()
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return (CORBA::Object_ptr) &this->u_." << ub->local_name ()
<< "_->inout ();" << be_uidt_nl;
return 0;
@@ -273,18 +275,21 @@ be_visitor_union_branch_public_access_cs::visit_predefined_type (be_predefined_t
switch (node->pt ())
{
case AST_PredefinedType::PT_pseudo:
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
break;
case AST_PredefinedType::PT_any:
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
+ << ";" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
break;
case AST_PredefinedType::PT_void:
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl;
break;
default:
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
}
return 0;
}
@@ -314,10 +319,10 @@ be_visitor_union_branch_public_access_cs::visit_sequence (be_sequence *node)
), -1);
}
os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
+ << ";" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
return 0;
}
@@ -339,7 +344,8 @@ be_visitor_union_branch_public_access_cs::visit_string (be_string *)
), -1);
}
TAO_OutStream *os = this->ctx_->stream ();
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
return 0;
}
@@ -371,14 +377,15 @@ be_visitor_union_branch_public_access_cs::visit_structure (be_structure *node)
os = this->ctx_->stream ();
if (bt->size_type () == be_type::VARIABLE)
{
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
+ << ";" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
}
else
{
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl
+ << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
}
return 0;
@@ -430,10 +437,10 @@ be_visitor_union_branch_public_access_cs::visit_union (be_union *node)
), -1);
}
os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
+ *os << "if (alloc_flag)" << be_idt_nl
+ << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
+ << ";" << be_uidt_nl
+ << "return this->u_." << ub->local_name () << "_;" << be_uidt;
return 0;
}