summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/util/utl_scope.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/util/utl_scope.cpp')
-rw-r--r--TAO/TAO_IDL/util/utl_scope.cpp37
1 files changed, 12 insertions, 25 deletions
diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp
index 12711646731..fd948268d18 100644
--- a/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/TAO/TAO_IDL/util/utl_scope.cpp
@@ -878,7 +878,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
continue;
}
- long equal = 0;
+ long equal;
if (scope_offset == 0)
{
@@ -886,13 +886,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
}
else
{
- // If d is an argument in some other scope,
- // whether or not it matches e is irrelevant,
- // and can only cause problems if it does.
- if (d->node_type () != AST_Decl::NT_argument)
- {
- equal = item_name->compare (e);
- }
+ equal = item_name->compare (e);
}
if (equal)
@@ -937,11 +931,11 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
* Implements lookup by name for scoped names
*/
AST_Decl *
-UTL_Scope::lookup_by_name (UTL_ScopedName *e,
- idl_bool treat_as_ref,
- idl_bool in_parent,
- long start_index,
- long scope_offset)
+UTL_Scope::lookup_by_name(UTL_ScopedName *e,
+ idl_bool treat_as_ref,
+ idl_bool in_parent,
+ long start_index,
+ long scope_offset)
{
AST_Decl *d;
UTL_Scope *t = NULL;
@@ -998,15 +992,12 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
while (1)
{
- d = lookup_by_name_local (e->head (),
- treat_as_ref,
- index,
- scope_offset);
+ d = lookup_by_name_local(e->head(), treat_as_ref, index, scope_offset);
// If we have popped up to a parent scope, we
// must check the other children, if we haven't
// had any luck so far.
- if (d == NULL && scope_offset > 1)
+ if (d == NULL && scope_offset > 0)
{
UTL_ScopeActiveIterator *iter =
new UTL_ScopeActiveIterator (this,
@@ -1016,11 +1007,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
{
d = iter->item ();
UTL_Scope *t = DeclAsScope (d);
- if (t == NULL)
- {
- d = NULL;
- }
- else
+ if (t != NULL)
{
AST_Interface *i =
AST_Interface::narrow_from_scope (t);
@@ -1030,7 +1017,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
treat_as_ref,
0,
0,
- scope_offset - 1);
+ --scope_offset);
}
else
{
@@ -1081,7 +1068,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
treat_as_ref,
in_parent,
0,
- scope_offset + 1);
+ ++scope_offset);
}
}
}