* c-typeprint.c (c_type_print_base) <TYPE_CODE_STRUCT,
authorTom Tromey <tromey@redhat.com>
Fri, 21 Sep 2012 17:37:47 +0000 (17:37 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 21 Sep 2012 17:37:47 +0000 (17:37 +0000)
TYPE_CODE_UNION>: Unify, removing a goto.

gdb/ChangeLog
gdb/c-typeprint.c

index fdbea6f4067741a6923f61b37e2e762e39285c3a..7aba5e8b8b4921c9517247be3e7577b4c1c3e466 100644 (file)
@@ -1,3 +1,8 @@
+2012-09-21  Tom Tromey  <tromey@redhat.com>
+
+       * c-typeprint.c (c_type_print_base) <TYPE_CODE_STRUCT,
+       TYPE_CODE_UNION>: Unify, removing a goto.
+
 2012-09-21  Tom Tromey  <tromey@redhat.com>
 
        * c-typeprint.c (cp_type_print_derivation_info): Fix comment.
index 71d84cffbefac66f2d7dc907a0c946365362ea84..9ce6f632b712a52b7e4b8c8bf60476d57c240e91 100644 (file)
@@ -768,18 +768,14 @@ c_type_print_base (struct type *type, struct ui_file *stream,
       break;
 
     case TYPE_CODE_STRUCT:
+    case TYPE_CODE_UNION:
       c_type_print_modifier (type, stream, 0, 1);
-      if (TYPE_DECLARED_CLASS (type))
+      if (TYPE_CODE (type) == TYPE_CODE_UNION)
+       fprintf_filtered (stream, "union ");
+      else if (TYPE_DECLARED_CLASS (type))
        fprintf_filtered (stream, "class ");
       else
        fprintf_filtered (stream, "struct ");
-      goto struct_union;
-
-    case TYPE_CODE_UNION:
-      c_type_print_modifier (type, stream, 0, 1);
-      fprintf_filtered (stream, "union ");
-
-    struct_union:
 
       /* Print the tag if it exists.  The HP aCC compiler emits a
          spurious "{unnamed struct}"/"{unnamed union}"/"{unnamed