aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-06-29 22:02:58 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-06-29 22:02:58 +0000
commit70c622a3d28b08cb57b8c8569658aa767241e161 (patch)
tree74db14913137cbe1863a28e5940e9e5dd468138d /gdb/cp-namespace.c
parent37e41b0352ff18c675a8566789087ba560825d91 (diff)
downloadgdb-70c622a3d28b08cb57b8c8569658aa767241e161.zip
gdb-70c622a3d28b08cb57b8c8569658aa767241e161.tar.gz
gdb-70c622a3d28b08cb57b8c8569658aa767241e161.tar.bz2
gdb/
Code cleanup. * cp-namespace.c (cp_add_using_directive): Turn positive comparison to negative comparisons.
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r--gdb/cp-namespace.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 7ff7bf7..ff4d63e 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -133,15 +133,23 @@ cp_add_using_directive (const char *dest,
for (current = using_directives; current != NULL; current = current->next)
{
- if (strcmp (current->import_src, src) == 0
- && strcmp (current->import_dest, dest) == 0
- && ((alias == NULL && current->alias == NULL)
- || (alias != NULL && current->alias != NULL
- && strcmp (alias, current->alias) == 0))
- && ((declaration == NULL && current->declaration == NULL)
- || (declaration != NULL && current->declaration != NULL
- && strcmp (declaration, current->declaration) == 0)))
- return;
+ if (strcmp (current->import_src, src) != 0)
+ continue;
+ if (strcmp (current->import_dest, dest) != 0)
+ continue;
+ if ((alias == NULL && current->alias != NULL)
+ || (alias != NULL && current->alias == NULL)
+ || (alias != NULL && current->alias != NULL
+ && strcmp (alias, current->alias) != 0))
+ continue;
+ if ((declaration == NULL && current->declaration != NULL)
+ || (declaration != NULL && current->declaration == NULL)
+ || (declaration != NULL && current->declaration != NULL
+ && strcmp (declaration, current->declaration) != 0))
+ continue;
+
+ /* Parameters exactly match CURRENT. */
+ return;
}
new = OBSTACK_ZALLOC (obstack, struct using_direct);