summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/ast/ast_template_module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_template_module.cpp')
-rw-r--r--TAO/TAO_IDL/ast/ast_template_module.cpp57
1 files changed, 24 insertions, 33 deletions
diff --git a/TAO/TAO_IDL/ast/ast_template_module.cpp b/TAO/TAO_IDL/ast/ast_template_module.cpp
index 364040dc4ca..6383e2167bf 100644
--- a/TAO/TAO_IDL/ast/ast_template_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_template_module.cpp
@@ -29,12 +29,12 @@ AST_Template_Module::AST_Template_Module (
{
}
-AST_Template_Module::~AST_Template_Module (void)
+AST_Template_Module::~AST_Template_Module ()
{
}
FE_Utils::T_PARAMLIST_INFO *
-AST_Template_Module::template_params (void) const
+AST_Template_Module::template_params () const
{
return this->template_params_;
}
@@ -55,30 +55,28 @@ AST_Template_Module::match_arg_names (FE_Utils::T_ARGLIST *args)
!i.done ();
i.advance (), ++slot)
{
- AST_Decl **item = 0;
+ AST_Decl **item = nullptr;
i.next (item);
AST_Decl *d = *item;
if (d->node_type () == AST_Decl::NT_typedef)
{
- AST_Typedef *td =
- AST_Typedef::narrow_from_decl (d);
+ AST_Typedef *td = dynamic_cast<AST_Typedef*> (d);
d = td->primitive_base_type ();
}
- FE_Utils::T_Param_Info *param = 0;
+ FE_Utils::T_Param_Info *param = nullptr;
(void) this->template_params_->get (param, slot);
- const char *s = 0;
+ const char *s = nullptr;
if (! this->match_one_param (param, d))
{
UTL_ScopedName *n = d->name ();
- if (n == 0)
+ if (n == nullptr)
{
- AST_Constant *c =
- AST_Constant::narrow_from_decl (d);
+ AST_Constant *c = dynamic_cast<AST_Constant*> (d);
s = c->exprtype_to_string ();
}
@@ -101,15 +99,15 @@ AST_Template_Module::match_param_refs (UTL_StrList *refs,
UTL_Scope *decl_scope)
{
UTL_Scope *s = decl_scope;
- AST_Template_Module *enclosing = 0;
+ AST_Template_Module *enclosing = nullptr;
- while (enclosing == 0 && s != 0)
+ while (enclosing == nullptr && s != nullptr)
{
- enclosing = AST_Template_Module::narrow_from_scope (s);
+ enclosing = dynamic_cast<AST_Template_Module*> (s);
s = ScopeAsDecl (s)->defined_in ();
}
- if (enclosing == 0)
+ if (enclosing == nullptr)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("AST_Template_Module::")
@@ -126,7 +124,7 @@ AST_Template_Module::match_param_refs (UTL_StrList *refs,
FE_Utils::T_Param_Info *enclosing_param =
enclosing->find_param (i.item ());
- if (enclosing_param == 0)
+ if (enclosing_param == nullptr)
{
// Enclosing param not found
return false;
@@ -143,10 +141,10 @@ AST_Template_Module::match_param_refs (UTL_StrList *refs,
}
void
-AST_Template_Module::destroy (void)
+AST_Template_Module::destroy ()
{
delete this->template_params_;
- this->template_params_ = 0;
+ this->template_params_ = nullptr;
this->AST_Module::destroy ();
}
@@ -161,9 +159,7 @@ AST_Template_Module_Ref *
AST_Template_Module::fe_add_template_module_ref (
AST_Template_Module_Ref *m)
{
- return
- AST_Template_Module_Ref::narrow_from_decl (
- this->fe_add_ref_decl (m));
+ return dynamic_cast<AST_Template_Module_Ref*> (this->fe_add_ref_decl (m));
}
void
@@ -182,7 +178,7 @@ AST_Template_Module::match_one_param (FE_Utils::T_Param_Info *param,
if (d->node_type () == AST_Decl::NT_typedef)
{
- AST_Typedef *td = AST_Typedef::narrow_from_decl (d);
+ AST_Typedef *td = dynamic_cast<AST_Typedef*> (d);
d = td->primitive_base_type ();
}
@@ -190,8 +186,7 @@ AST_Template_Module::match_one_param (FE_Utils::T_Param_Info *param,
if (other_type == AST_Decl::NT_const)
{
- AST_Constant *c =
- AST_Constant::narrow_from_decl (d);
+ AST_Constant *c = dynamic_cast<AST_Constant*> (d);
AST_Expression *ex = c->constant_value ();
@@ -199,15 +194,15 @@ AST_Template_Module::match_one_param (FE_Utils::T_Param_Info *param,
ex->check_and_coerce (param->const_type_,
param->enum_const_type_decl_);
- if (ev == 0)
+ if (ev == nullptr)
{
idl_global->err ()->coercion_error (ex,
param->const_type_);
}
- bool retval = (ev != 0);
+ bool retval = (ev != nullptr);
delete ev;
- ev = 0;
+ ev = nullptr;
return retval;
}
@@ -222,7 +217,7 @@ AST_Template_Module::find_param (UTL_String *name)
!i.done ();
i.advance ())
{
- FE_Utils::T_Param_Info *param = 0;
+ FE_Utils::T_Param_Info *param = nullptr;
i.next (param);
if (param->name_ == name->get_string ())
@@ -231,7 +226,7 @@ AST_Template_Module::find_param (UTL_String *name)
}
}
- return 0;
+ return nullptr;
}
bool
@@ -243,7 +238,7 @@ AST_Template_Module::match_param_by_type (
!i.done ();
i.advance ())
{
- FE_Utils::T_Param_Info *my_param = 0;
+ FE_Utils::T_Param_Info *my_param = nullptr;
i.next (my_param);
if (param->type_ == my_param->type_)
@@ -278,7 +273,3 @@ AST_Template_Module::match_param_by_type (
return false;
}
-
-IMPL_NARROW_FROM_DECL (AST_Template_Module)
-IMPL_NARROW_FROM_SCOPE (AST_Template_Module)
-