aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-09-21 17:37:47 +0000
committerTom Tromey <tromey@redhat.com>2012-09-21 17:37:47 +0000
commit1c5b7826c52fb624d1d03762fafc005f8fac62a7 (patch)
tree822bf4f04b7e67427df27e4290febf1c59ba138e /gdb
parent62a49610b840edcddb0cc38d1f2559f627ea0c08 (diff)
downloadgdb-1c5b7826c52fb624d1d03762fafc005f8fac62a7.zip
gdb-1c5b7826c52fb624d1d03762fafc005f8fac62a7.tar.gz
gdb-1c5b7826c52fb624d1d03762fafc005f8fac62a7.tar.bz2
* c-typeprint.c (c_type_print_base) <TYPE_CODE_STRUCT,
TYPE_CODE_UNION>: Unify, removing a goto.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/c-typeprint.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fdbea6f..7aba5e8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
2012-09-21 Andrew Burgess <aburgess@broadcom.com>
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 71d84cf..9ce6f63 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -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