gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 29 Jun 2011 22:02:58 +0000 (22:02 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 29 Jun 2011 22:02:58 +0000 (22:02 +0000)
Code cleanup.
* cp-namespace.c (cp_add_using_directive): Turn positive comparison to
negative comparisons.

gdb/ChangeLog
gdb/cp-namespace.c

index 8088114269fcd68af1214d9cab9a7f3b3306c6e2..9cabcafe722fcf39f5a29a8362ef6355982e6b6a 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Code cleanup.
+       * cp-namespace.c (cp_add_using_directive): Turn positive comparison to
+       negative comparisons.
+
 2011-06-29  André Pönitz  <andre.poenitz@nokia.com>
 
        * mi/mi-main.c (mi_cmd_list_features): Emit
index 7ff7bf76bc0e434fbf7e0197035d923d66da6cdc..ff4d63e4c583f8b4b4f6d31719aba87bc99c6f62 100644 (file)
@@ -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);