diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-01-04 16:07:38 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-01-04 16:07:38 -0600 |
commit | a4933207212e4ea0958fc1d77d897613fa75b0d7 (patch) | |
tree | 213a2b83b679f0be215e5efcbd5d8d7c10080dd3 | |
parent | b6cf7c9390396281e48c98c19dfc066a9fd5ae75 (diff) | |
download | ATCD-a4933207212e4ea0958fc1d77d897613fa75b0d7.tar.gz |
ast_annotation_appl.cpp: Reduce Variable Scopes
-rw-r--r-- | TAO/TAO_IDL/ast/ast_annotation_appl.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp index 112a7fbee3f..5dd5469d5db 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp @@ -34,9 +34,9 @@ void AST_Annotation_Appl::dump (ACE_OSTREAM_TYPE &o) { dump_i (o, "("); Params::ITERATOR iter (*params_); - Param **i = 0; while (!iter.done ()) { + Param **i = 0; iter.next (i); if ((*i)->id) { @@ -114,13 +114,12 @@ AST_Annotation_Appl::apply_from (AST_Annotation_Decl *decl) } // Make sure all the parameters were used - Params *parameters = params (); - if (parameters) + if (params_) { - Param **param = 0; - for (Param::Iterator it (*parameters); + for (Param::Iterator it (*params_); !it.done (); it.advance ()) { + Param **param = 0; it.next (param); if ((*param) && !(*param)->used) { @@ -151,24 +150,23 @@ AST_Annotation_Appl::annotation_decl () AST_Annotation_Appl::Param * AST_Annotation_Appl::find_param (const char *name) { - Params *parameters = params (); - if (parameters) + if (params_) { // Check for single nameless parameter - if (parameters->size () == 1) + if (params_->size () == 1) { - Param *top; - parameters->top (top); + Param *top = 0; + params_->top (top); if (top && !top->id && top->expr) { // Don't reuse it if used return top->used ? 0 : top; } } - Param **param; - for (Param::Iterator it (*parameters); + for (Param::Iterator it (*params_); !it.done (); it.advance ()) { + Param **param = 0; it.next (param); if ((*param) && (*param)->id && !ACE_OS::strcmp ((*param)->id->get_string (), name)) { |